10.06.2013, 02:23
Use the following function:
pawn Код:
stock GetPlayerIdFromText(text[]) {
new name[24];
for(new i = 0; i != MAX_PLAYERS; i++) {
if(!IsPlayerConnected(i)) continue;
GetPlayerName(i, name, 24);
if(!strcmp(name, text)) {
return i;
}
}
return INVALID_PLAYER_ID;
}