altv-vchat's People
altv-vchat's Issues
Server crashed after use commands
My gamemode - Clientside: JS, Serverside: C#
I got regiserCmd work, and command works well.
But after using the command, there is a crash without logs(errors), I can only judge that it is the crash after using the command.(Not typing!!!)
but sometimes it works, Doesn't seem to be a problem with registerCmd. I tested it without registerCmd, it crash my server too.
I put log test(server -> chat.ts):
if (words.length > 0) { if (this.optionsService.getOption('logPlayerCommands')) this.loggerService.log(
[Commmand] ${player.name}: ${message}`);
let args = words.split(' ');
let cmdName = args.shift() ?? '';
const invoked = this.commandService.invoke(player, cmdName, args);
logError("Invoked doing, result = " + invoked)
if (invoked)
{
logError("Invoked success, result = " + invoked)
return;
}
logError("Invoked failed, result = " + invoked)
const unknownCommandMessage = this.optionsService
.getOption('unknownCommandMessage')
.replace('{0}', cmdName);
try {
this.mountService.waitForMount(
player,
this.windowService.send(player, unknownCommandMessage, MessageType.Error),
);
logError("The command doesnt exists")
}
catch (e) {
logError(`[Error] ${e}`);
}
}`
i have no idea...
not working clearMessageHistory(); clearMessages();
i have some issues. I've try to clear messages after playr disconnect from server and nothing happened. Messages still there.
here is the code `alt.on('playerDisconnect', playerDisconnect);
function playerDisconnect(player) {
if (!player || !player.valid) {
return;
}
let pos;
let ID = player.getSyncedMeta('ID');
pos = player.pos;
global.DB.query(
'UPDATE characters SET x=?, y=?, z=?, h=?, hp=?, armour=? WHERE uuid=?',
[pos.x, pos.y, pos.z, pos.z - 1, player.health, player.armour, ID],
function (err, r) {}
);
chat.clearMessageHistory(player);
chat.clearMessages(player);
alt.log(${player.name} has disconnected from the server.
);
}`
maybe i do something wrong? can you help me?
Functions with function parameter can't be imported to C#
Firstly thanks for this wonderful project.
I loved the entire logic, but I needed to import my existing C# commands to VChat and failed it.
The problem is functions with function parameter, in this case the following export function:
altv-vchat/packages/types/index.d.ts
Line 64 in 1e5ab58
can't be imported to C# environment.
I tried a couple of ways but it's not possible in my case. I tried the following way:
// Functions without function parameter works โ
๐
Alt.Import("altv-vchat", "muteAllPlayers", out Action muteAllPlayers);
// Throws exception โ ๐
Alt.Import("altv-vchat", "registerCmd", out Action<string, Action<IPlayer, string[]>> registerCmd);
registerCmd("ping", (player, args) =>
{
Console.WriteLine("Hello, World!");
});
removeSuggestion not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.