17.11.2008, 21:13
LarzI aka. D'x_Orzizt ye it surely should work I just wanted mention that you create the array 'pname' inside the loop (thats inefficient)
Ah and changed GetPlayerFullname, its indirect the same
pawn Code:
stock GetPlayerID(partofname[])
{
for(new i, m = GetMaxPlayers(), pname[MAX_PLAER_NAME]; i < m; i++)
{
GetPlayerName(i, pname, MAX_PLAYER_NAME);
if(strfind(pname, partofname, true)) return i;
}
return INVALID_PLAYER_ID;
}
pawn Code:
stock GetPlayerFullname(partofname[])
{
new id = GetPlayerID(partofname), pname[MAX_PLAYER_NAME];
if(id != INVALID_PLAYER_ID) GetPlayerName(id, pname, MAX_PLAYER_NAME);
return pname;
}

