SA-MP Forums Archive
Foreach Hep plz - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Foreach Hep plz (/showthread.php?tid=500785)



Foreach Hep plz - AleemIqbalBhatti - 15.03.2014

foreach (new botid : Bot)
{
}
I want to use this function but when i use it says unidentified Foreach and botid

This is 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);
}
}
}


Re: Foreach Hep plz - MP2 - 15.03.2014

Learn to indent. For ours and your own benefit. You're going to have endless problems if you don't indent.


Re: Foreach Hep plz - AleemIqbalBhatti - 15.03.2014

i know but i think its foreach.inc problem can Some one give me link that can help


Re: Foreach Hep plz - MP2 - 15.03.2014

You haven't even explained your problems. You've just said 'foreach' and thrown some code in. How are we meant to know what your problem is? The foreach code doesn't even have anything in it..