CMD to teleport to A certain point by position x y z
#1

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

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
Reply
#3

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

ok i will check
Reply
#5

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
Reply
#6

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
Reply
#7

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!
Reply
#8

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
Reply
#9

Please be more precise in explaining what you need next time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)