20.12.2013, 14:16
Hello i have create this for find player ID but all work good but have one problem on player id dont find it good so here is script
Thank you
pawn Код:
dcmd_id(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /id <part of name>");
new players, Names[MAX_PLAYER_NAME];
for(new i=0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, Names, MAX_PLAYER_NAME);
new len = strlen(Names);
new bool:searched=false;
for(new pos=0; pos <= len; pos++)
{
if(searched != true)
{
if(strfind(Names,params,true) == pos)
{
players++;
SendClientMessage(playerid, 0xE89B5BBB, "Players found:");
format(string,sizeof(string),"> %s (ID:%d)",Names,playerid);
SendClientMessage(playerid, COLOR_WHITE ,string);
searched = true;
}
}
}
}
}
if(players == 0)
SendClientMessage(playerid, 0xFF0000FF, "Player not found.");
return 1;
}