function(player,position){
player ?
This is a client script ? For client you don't have player as pattern
And make sure that you using call arguments in array.
See this exemple:
/* ServerSide Script*/
let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100);
function playerEnterColshapeHandler(player, shape) {
if(shape == someColShape) {
console.log(`${player.name} entered the colshape`);
//ZancudoBunker
player.call("playerCreateWaypoint", [-3058.714, 3329.19, 12.5844])
/* I can only use numbers, string or boolean.
If I need send object to client I have to convert in JSON format
*/
}
}
mp.events.add("playerEnterColshape", playerEnterColshapeHandler);
/* ClientSide script*/
var player_location = null;
mp.events.add("playerCreateWaypoint",function(x, y, z) {
player_location = new mp.Vector3(x, y, z);
mp.game.graphics.notify(`Press ~r~G ~w~if you want teleport to the waypoint.`);
});
//Get keycode here -> http://keycode.info/
mp.keys.bind(71/*G*/, true, function() {
if(player_location !== null)
{
mp.players.local.position = player_location;
player_location = null;
}
});
https://wiki.rage.mp/index.php?title=Player::call