CMD:gotoid
#1

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?
Reply
#2

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;
}
Reply
#3

pawn Код:
if(id == INVALID_PLAYER_ID) return //do whatever you want here
Reply


Forum Jump:


Users browsing this thread: