Get playerid from variable
#2

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;
}
Reply


Messages In This Thread
Get playerid from variable - by Tanush123 - 10.06.2013, 02:16
Respuesta: Get playerid from variable - by admantis - 10.06.2013, 02:23
Re: Get playerid from variable - by cristip - 10.06.2013, 02:29

Forum Jump:


Users browsing this thread: 2 Guest(s)