[Help]Need /goto help
#2

pawn Код:
COMMAND:goto(playerid, params[])
{
    new id = strval(params);
    if(PlayerInfo[playerid][Admin] > 0 || PlayerInfo[playerid][Helper] > 0)
    {
        if(strlen(params) == 0)return SendClientMessage(playerid, COLOR_WHITE, "[INFO]: /goto [id]");
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(id,x,y,z);
        SetPlayerPos(playerid,x+1,y+1,z);
        }
    }
    else return SendClientMessage(playerid, COLOR_RED, "You must be Helper/Admin to use that command.");
    return 1;
}
If you want to "goto" someone, you want to move yourself, not "id" - Wrong variable

That should work

I also changed this line:
pawn Код:
if(strlen(params) == 0)return SendClientMessage(playerid, COLOR_WHITE, "[INFO]: /goto [id]");
as you were just asking the script about cell "0" in params.
Reply


Messages In This Thread
[Help]Need /goto help - by Alex_Valde - 01.10.2010, 18:28
Re: [Help]Need /goto help - by Ash. - 01.10.2010, 18:30
Re: [Help]Need /goto help - by Alex_Valde - 01.10.2010, 18:40
Re: [Help]Need /goto help - by bigcomfycouch - 01.10.2010, 18:45
Re: [Help]Need /goto help - by Grim_ - 01.10.2010, 18:48
Re: [Help]Need /goto help - by bigcomfycouch - 01.10.2010, 18:51
Re: [Help]Need /goto help - by Alex_Valde - 01.10.2010, 18:54
Re: [Help]Need /goto help - by [Lsrcr]Rafa - 01.10.2010, 19:17

Forum Jump:


Users browsing this thread: 1 Guest(s)