Help me, teleport command.
#1

Hey guys, I made a teleport command script which teleports you to the co-ordinates you chose.

PHP код:
    if(strcmp(cmd"/xgoto"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
         if(
PlayerInfo[playerid][pAdmin] < 5)
        {
            
SendClientMessage(playerid,COLOR_GRAD2,"Permission Denied.");
            return 
1;
        }
        }
    new 
Float:xFloat:yFloat:z;
    new 
string[100];
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp))
    {
        
SendClientMessage(playeridCOLOR_GRAD2"Usage: /xgoto <X Float> <Y Float> <Z Float>");
        return 
1;
        }
     return 
1;
    } 
It's not working, please help me to find the mistake and how I can fix it?
Thanks in advance, volcaN131.
Reply
#2

try this :
pawn Код:
CMD:xgoto(playerid, params[]){
    if(PlayerInfo[playerid][pAdmin] >= 5){
        new Float: pos[3], int;
        if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoco [x coordinate] [y coordinate] [z coordinate] [interior]");

        SendClientMessage(playerid, COLOR_GRAD2, "You have been teleported to the coordinates specified.");
        SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        SetPlayerInterior(playerid, int);
    }
    return 1;
}
}
Reply
#3

Where should I paste it man?
Reply
#4

try to use ZCMD dude ..

paste it anywhere outside other method / function in ur script ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)