09.01.2011, 04:36
In the function, there's no "playerid" param. That's why it isn't working.
Use an "GetIDFromName" function:
Use an "GetIDFromName" function:
pawn Код:
stock GetIDFromName(name[])
{
new pName[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++){
GetPlayerName(i, pName, MAX_PLAYER_NAME);
if(!strcmp(name, pName, false))
return i;
else continue;
}
return -1;
}