SA-MP Forums Archive
/goto [ID] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /goto [ID] (/showthread.php?tid=126766)



/goto [ID] - mrbubl3s - 10.02.2010

I'm having problems with a /goto [ID] command, an example would be nice.


Re: /goto [ID] - [HiC]TheKiller - 10.02.2010

pawn Код:
dcmd_Goto(playerid, params[])
{
    new id = strval(params)
    else if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000AA, "/Goto [playerid]");
    else if(id == playerid) return SendClientMessage(playerid, 0xFF0000AA, "You cannot goto yourself...");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected");
    else
    {
        new Float:X, Float:Y, Float:Z, Pname[24];
        GetPlayerPos(id, X, Y, Z);
        GetPlayerName(id, Pname, 24);
        SetPlayerPos(playerid, X, Y, Z);
        new String[56];
        format(String, sizeof(String), "You have teleported to %s(%d)", Pname, id);
        SendClientMessage(playerid, 0xFF0000AA, String);
    }
    return 1;
}



Re: /goto [ID] - mrbubl3s - 10.02.2010

Sweet, thanks.