Foreach Error
#2

pawn Код:
stock CounterRadio(const string[])
{
    foreach(Player, i)
    {
        if(GetPlayerState(i) != PLAYER_STATE_NONE)
        {
            if(GetPlayerClass[i] == TEAM_COUNTER)
            {
                SendClientMessage(i, BLUE, string);
            }
        }
    }
    return 1;
}
Add the following line to the top of your script:
pawn Код:
#include <foreach>
This requires you to download and place the foreach include file into your pawno/includes/ folder.
The foreach thread can be found here if you do not already have the include file: https://sampforum.blast.hk/showthread.php?tid=92679

EDIT: StuartD, you were literally 1 or 2 seconds behind me, I couldn't believe that :P
Reply


Messages In This Thread
Foreach Error - by dakata994 - 29.11.2013, 06:53
Re: Foreach Error - by Threshold - 29.11.2013, 07:03
Re: Foreach Error - by StuartD - 29.11.2013, 07:03
Re: Foreach Error - by iZN - 29.11.2013, 07:04
Re: Foreach Error - by dakata994 - 29.11.2013, 07:05
Re: Foreach Error - by Sublime - 29.11.2013, 07:06
Re: Foreach Error - by Threshold - 29.11.2013, 07:07
Re: Foreach Error - by iZN - 29.11.2013, 07:08

Forum Jump:


Users browsing this thread: 1 Guest(s)