06.03.2014, 22:27
There is a problem with the /id command ,whenever i do /id [ID] it says No Players Found it only works when i do /id [Player Name] Can someone help me with it ?
pawn Код:
CMD:id(playerid, params[])
{
new string[128], name[24];
if(sscanf(params, "s[24]", name)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [Name/PartOfName]");
else
{
new count;
foreach(Player, i)
{
new pname[24];
GetPlayerName(i, pname, sizeof(pname));
if(strfind(pname, name, true) != -1)
{
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", i, GetPlayerNameEx(i), PlayerInfo[i][pLevel], GetPlayerPing(i));
SendClientMessageEx(playerid, COLOR_WHITE, string);
count ++;
}
}
if(count == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, " No players found.");
}
return 1;
}