28.11.2011, 23:24
PlayerInfo й do outro GM, nao vai funcionar nesse novo.
pawn Код:
stock ReturnUser(PlayerName[])
{
if(IsNumeric(PlayerName))
return strval(PlayerName);
else
{
new found=0, id;
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,PlayerName,true) == pos)
{
found++;
id = i;
}
}
}
}
}
if(found == 1)
return id;
else
return INVALID_PLAYER_ID;
}
}