Hi all!
I have problem with the player position.
I wrote a simple vehicle spawn command and I get this error message:
The client.player exists only on client side? Or how can I get the player position?
Thank you!
Code:
I have problem with the player position.
I wrote a simple vehicle spawn command and I get this error message:
QuoteTypeError: client.player is null
The client.player exists only on client side? Or how can I get the player position?
Thank you!
Code:
Code Select
addEventHandler('OnPlayerCommand', (event, client, command, parameters) => {
console.log(`(Command) ${client.name} has used the command '/${command} ${parameters}'.`);
switch(command){
case "v":
case "veh":
case "vehicle":
var veh = gta.createVehicle(parseInt(parameters), client.player.position);
addToWorld(veh);
client.player.warpIntoVehicle(veh, 0);
break;
default:
message("UNK CMD");
break;
}
});