CMD:gotoid - 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)
+--- Thread: CMD:gotoid (
/showthread.php?tid=406686)
CMD:gotoid -
UnknownGamer - 11.01.2013
pawn Код:
CMD:gotoid(playerid, params[])
{
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoid [id]");
new Float:idx,Float:idy,Float:idz;
GetPlayerPos(id, idx, idy, idz);
SetPlayerPos(playerid, idx, idy+4, idz);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
How would I make that say if you enter an ID that isnt online?
PlayerID isnt found?
Re: CMD:gotoid -
DaRk_RaiN - 11.01.2013
pawn Код:
CMD:gotoid(playerid, params[])
{
new id;
if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoid [id]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "Player not connected!");//Here
new Float:idx,Float:idy,Float:idz;
GetPlayerPos(id, idx, idy, idz);
SetPlayerPos(playerid, idx, idy+4, idz);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
Re: CMD:gotoid -
JaKe Elite - 11.01.2013
pawn Код:
if(id == INVALID_PLAYER_ID) return //do whatever you want here