SA-MP Forums Archive
CMD to teleport to A certain point by position x y z - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD to teleport to A certain point by position x y z (/showthread.php?tid=661030)



CMD to teleport to A certain point by position x y z - vikoo - 19.11.2018

i wanna to teleport to a position but idk about cmds anyone know?


Re: CMD to teleport to A certain point by position x y z - v1k1nG - 19.11.2018

SetPlayerPos

PHP код:
CMD:teleport(playeridparams[]){
    
SetPlayerPos(playeridyour x y and z coordinates);
    
SetPlayerInterior(playeridinterior); // only if you teleport in interior, set the interior id
    
return 1;

Assuming your using zcmd or pawn.cmd


Re: CMD to teleport to A certain point by position x y z - vikoo - 19.11.2018

i mean to teleport to this position inside the server
1480.27161, -1642.37793, 13.15613


Re: CMD to teleport to A certain point by position x y z - vikoo - 19.11.2018

ok i will check


Re: CMD to teleport to A certain point by position x y z - v1k1nG - 19.11.2018

PHP код:
CMD:teleport(playeridparams[]){
    
SetPlayerPos(playerid1480.27161, -1642.3779313.15613);
    return 
1;

See the cords, it is quite a simple function.
Also read the documentation for more info
https://sampwiki.blast.hk/wiki/SetPlayerPos


Re: CMD to teleport to A certain point by position x y z - vikoo - 19.11.2018

bro i mean i wanna to goto to any pos in my server cmd like /gotopos 1480.27161, -1642.37793, 13.15613

/gotopos 7872.70166, -1637.35852, 40.74157


Re: CMD to teleport to A certain point by position x y z - d3Pedro - 20.11.2018

pawn Код:
CMD:gotopos(playerid, params[])
{
    new Float:x, Float:y, Float:z, interiorid;

    if(sscanf(params, "fffI(0)", x, y, z, interiorid))
    {
        return SendClientMessage(playerid, -1, "/gotopos [x] [y] [z] [interior]"); //default interior is pointed as 0
    }
    SetPlayerPos(playerid, x, y, z);
    SetPlayerInterior(playerid, interiorid);
    return 1;
}
You can remove interior if you want, but i bet you want to test mappings, so you should need that!


Re: CMD to teleport to A certain point by position x y z - vikoo - 20.11.2018

Quote:
Originally Posted by ConnorW
Посмотреть сообщение
pawn Код:
CMD:gotopos(playerid, params[])
{
    new Float:x, Float:y, Float:z, interiorid;

    if(sscanf(params, "fffI(0)", x, y, z, interiorid))
    {
        return SendClientMessage(playerid, -1, "/gotopos [x] [y] [z] [interior]"); //default interior is pointed as 0
    }
    SetPlayerPos(playerid, x, y, z);
    SetPlayerInterior(playerid, interiorid);
    return 1;
}
You can remove interior if you want, but i bet you want to test mappings, so you should need that!
yes iam really wanna test maps thx man +Rep


Re: CMD to teleport to A certain point by position x y z - v1k1nG - 20.11.2018

Please be more precise in explaining what you need next time