Array manipulation
#6

It might be the strcmp function try this one.
pawn Код:
stock GetPlayerID(const PName[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new pName[MAX_PLAYER_NAME];
            GetPlayerName(i, pName, sizeof(pName));
            if(!strcmp(PName, pName))
            {
                return i;
            }
        }
    }
    return -1;
}
Reply


Messages In This Thread
Array manipulation ( Fixed thank you to all for the help) - by Hornet600 - 03.04.2011, 15:16
Re: Array manipulation - by iggy1 - 03.04.2011, 15:22
Re: Array manipulation - by Hornet600 - 03.04.2011, 15:23
Re: Array manipulation - by iggy1 - 03.04.2011, 15:24
Re: Array manipulation - by Hornet600 - 03.04.2011, 15:25
Re: Array manipulation - by iggy1 - 03.04.2011, 15:34
Re: Array manipulation - by Hornet600 - 03.04.2011, 15:41
Re: Array manipulation - by iggy1 - 03.04.2011, 15:45
Re: Array manipulation - by Hornet600 - 03.04.2011, 15:50
Re: Array manipulation - by Miguel - 03.04.2011, 15:51

Forum Jump:


Users browsing this thread: 5 Guest(s)