02.06.2018, 20:03
Quote:
There should be a ! before strcmp.
strcmp returns value 0 if the strings match. |
Try this:
pawn Код:
GetPlayerID(name[])
{
new playerName[24];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerName(i, playerName, 24);
if(!strcmp(playerName, playerName, false)) return i;
}
return INVALID_PLAYER_ID;
}