Help Plz in Foreach
#1

Errors:
F:\Samp\Servers\Grand Thef Auto DeadlyDM 4.6\gamemodes\flatout.pwn(63586) : warning 219: local variable "m" shadows a variable at a preceding level
F:\Samp\Servers\Grand Thef Auto DeadlyDM 4.6\gamemodes\flatout.pwn(85141) : error 017: undefined symbol "foreach"
F:\Samp\Servers\Grand Thef Auto DeadlyDM 4.6\gamemodes\flatout.pwn(85141) : error 029: invalid expression, assumed zero
F:\Samp\Servers\Grand Thef Auto DeadlyDM 4.6\gamemodes\flatout.pwn(85141) : error 017: undefined symbol "botid"
F:\Samp\Servers\Grand Thef Auto DeadlyDM 4.6\gamemodes\flatout.pwn(85141) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Code
foreach (new botid : Bot)
{
if(!strcmp(pName[botid],"Emelie"))
{
if(bottargeted == 1)
{
bottargeted=2;
ApplyAnimation(botid,"PED","handsup",3.1,0,1,1,1,0 ,1);
}
else if(bottargeted==0)
{
if(GetPlayerSpeed(botid,true) > 0) ApplyAnimation(botid,"PED","WOMAN_walkpro",4.1,1,1 ,1,1,1);
else ApplyAnimation(botid,"PED","woman_idlestance",3.1, 1,1,1,1,0,1);
}
}
}


I have included Foreach but still getting errors
Reply
#2

at top of script

pawn Код:
#include <foreach>

EDIT:

And foreach usage is

pawn Код:
foreach(Player, i)
{
//code
}
Reply
#3

already did but still i want to use it for botid not player
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)