yello, help with goto
#1

help please, when i do /goto <id>, i teleported to ls
pawn Код:
dcmd_GOTO(playerid,params[])
    {
            new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
            new tmp[256], Index;
            tmp = strtok(params,Index), id = strval(tmp);
            GetPlayerName(id,on,sizeof(on));
            GetPlayerName(playerid,n,sizeof(n));
            if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,ORANGE,"You need to be level 1 to use this command!");
            if(!strlen(params)) return SendClientMessage(playerid,RED,"USAGE: /goto <ID> ");
            if(!IsPlayerConnected(id)) return SendClientMessage(playerid,RED,"Invalid ID");
            SendClientMessage(id,ORANGE, "An Admin has teleported to you.");
            SetPlayerPos(playerid,id,id,id);
            return 1;
    }
Reply
#2

please help!
Reply
#3

You got the get the taget's postion
pawn Код:
new Float: Pos[3];
GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
Reply
#4

thanks
Reply
#5

Dont use 256 for your arrays when you dont need it. Use someting like 100. And DCMD is old and outdated, you should look into using zcmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)