Jump to content

Command is not executed


Recommended Posts

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:


        public void Teleport(Client client)
            if (!client.HasData("player"))
                GTANetworkMethods.Player player = client.GetData("player");

                NAPI.ClientEvent.TriggerClientEvent(client, "mapmarker_getposition");



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);

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 by DerStr1k3r
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...