07.03.2011, 17:44
eu uso esse
pawn Код:
if(strcmp(cmd,"/getid",true) == 0 || strcmp(cmd, "/id", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_DBLUE,"Uso correto: /getid [parte do nick]");
return 1;
}
format(string,sizeof(string),"Searched for: \"%s\": ",tmp);
SendClientMessage(playerid,COLOR_RED,string);
new found=0;
for(new i=0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new foundname[MAX_PLAYER_NAME];
GetPlayerName(i, foundname, MAX_PLAYER_NAME);
new namelen = strlen(foundname);
new bool:searched=false;
for(new pos=0; pos <= namelen; pos++)
{
if(searched != true)
{
if(strfind(foundname,tmp,true) == pos)
{
found++;
format(string,sizeof(string),"%d. %s (ID %d)",found,foundname,i);
SendClientMessage(playerid, COLOR_GREEN ,string);
searched = true;
}
}
}
}
}
return 1;
}