samp-node-lib
samp-node-lib copied to clipboard
player.GetPlayerName() returns undefined
Hello, i tested OnPlayerConnect function
sampNodeLib.OnPlayerConnect((player) => {
console.log(`[Node] Player ${player.playerid} connected`);
console.log(player.GetPlayerName())
})
In result i got: [Node] Player 0 connected undefined
If i set in samp-node.json log_level: 4
I got this error when called sampNodeLib.getPlayers()
[ERROR]: [callNative] native function: GetMaxPlayers not found.
And OnPlayerConnect: [ERROR]: [callNative] native function: GetPlayerName not found.
Use
player.GetPlayerName(24); // 24 = The length of the string that should be stored (read this: https://open.mp/docs/scripting/functions/GetPlayerName)
Use
player.GetPlayerName(24); // 24 = The length of the string that should be stored (read this: https://open.mp/docs/scripting/functions/GetPlayerName)
What about this? https://github.com/peterszombati/samp-node-lib/issues/8#issuecomment-1187730390
Use
player.GetPlayerName(24); // 24 = The length of the string that should be stored (read this: https://open.mp/docs/scripting/functions/GetPlayerName)
Same error and returns undefined.