GetPlayerID(byname) bug
#3

Quote:
Originally Posted by iSpark
Посмотреть сообщение
There should be a ! before strcmp.
strcmp returns value 0 if the strings match.
That part of the code is right though.. he is still checking if it returns 0.

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


Messages In This Thread
GetPlayerID(byname) bug - by GospodinX - 02.06.2018, 17:44
Re: GetPlayerID(byname) bug - by iSpark - 02.06.2018, 18:14
Re: GetPlayerID(byname) bug - by Cell_ - 02.06.2018, 20:03
Re: GetPlayerID(byname) bug - by GTLS - 03.06.2018, 06:19

Forum Jump:


Users browsing this thread: 1 Guest(s)