DerStr1k3r 9 Posted August 31, 2018 (edited) Hello community, I have a little problem there. I am in the process of writing a command that you can teleports via Map Marker. The function seems to be correct, but it does not work. My Code is: C#: [Command("port")] public void Teleport(Client client) { if (!client.HasData("player")) return; GTANetworkMethods.Player player = client.GetData("player"); NAPI.ClientEvent.TriggerClientEvent(client, "mapmarker_getposition"); } Js: const player = mp.players.local; mp.events.add('mapmarker_getposition', () => { var player = mp.players.local.position; var coords = NAPI.ClientEvent.GetWaypointPosition(); coords.Z = 2000; NAPI.ClientEvent.SetEntityPosition(player, coords); descent(); }); function descent() { var player = mp.players.local.position; var pos = NAPI.ClientEvent.GetEntityPosition(player); var ground = NAPI.ClientEvent.GetGroundHeight(pos); pos.Z = pos.Z - 100; if (ground == 0) { NAPI.ClientEvent.SetEntityPosition(player, pos); NAPI.after(1, "descent"); } else { pos.Z = ground; NAPI.ClientEvent.SetEntityPosition(player, pos); } } Does any one of you know a tip? Edited August 31, 2018 by DerStr1k3r Share this post Link to post Share on other sites
Xabi 142 Posted August 31, 2018 What are those NAPI.ClientEvent client-side? Also, where do you set that "player" data to the player with something like client.SetData("player", YourData);? Share this post Link to post Share on other sites