Foreach problem
#1

Hello there, i'm getting 4 errors while compiling my gamemode,
This is the errors I am getting

Код:
C:\Users\Admin\Desktop\AMRP\gamemodes\AMRP.pwn(3900) : error 017: undefined symbol "foreach"
C:\Users\Admin\Desktop\AMRP\gamemodes\AMRP.pwn(3900) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\AMRP\gamemodes\AMRP.pwn(3900) : error 017: undefined symbol "Player"
C:\Users\Admin\Desktop\AMRP\gamemodes\AMRP.pwn(3900) : fatal error 107: too many error messages on one line

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


4 Errors.
Код:
		{
	 	    foreach(new i: Player) if(GetPlayerVehicleID(i) != 0 && GetPlayerVehicleID(i) == GetPlayerVehicleID(index)) {
				PlayAudioStreamForPlayer(i, data);
Anyone got a solution?
Reply
#2

Try adding
#include <foreach> at the top if you have not and add
foreach(Player, i)
Reply
#3

Quote:
Originally Posted by Scottylad
Посмотреть сообщение
Try adding
#include <foreach> at the top if you have not and add
foreach(Player, i)
I've added the #include <foreach> at all the includes,
Could i replace "foreach(new i: Player)" with "foreach(Player, i)"?
Reply
#4

You could try, I use 'foreach(Player, i)' But the one you are using is more updated but your 'Foreach' could be an old one so try using mine else get a new <foreach> include.
Reply
#5

Quote:
Originally Posted by Scottylad
Посмотреть сообщение
You could try, I use 'foreach(Player, i)' But the one you are using is more updated but your 'Foreach' could be an old one so try using mine else get a new <foreach> include.
Alright, will try it out, Thanks <3 +1 rep
Reply
#6

No problem, any time buddy <3
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)