13.02.2017, 15:10
Yes you need to check for INVALID_PLAYER_ID
PHP код:
CMD:id(playerid, params[])
{
new id, string[144];
if(sscanf(params, "u", id))
return SendClientMessage(playerid, COLOR_RED,"Use: /id [Nume/ID]");
if(id != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "Name:%s(%i) | Scor:%i | Class:%s | Admin:%i | VIP:%i", pName(id), id,APlayerData[id][PlayerScore], GetPlayerClassEx(id), APlayerData[id][PlayerLevel], APlayerData[id][VPlayerLevel]);
SendClientMessage(playerid, Grey, string);
}
else
return SendClientMessage(playerid, COLOR_RED, "Error: Invalid PlayerID/PlayerName.");
return 1;
}