SA-MP Forums Archive
Compiler error - 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: Compiler error (/showthread.php?tid=599266)



Compiler error - iKevin - 23.01.2016

When I compile my new version of my gamemode (v1.1c) I get this errors in the compiler output;

Код:
C:\Users\Kevin Burke\Desktop\CGRP\Backup\CGRP\gamemodes\CG-RPv1.pwn(1354) : error 017: undefined symbol "foreach"
C:\Users\Kevin Burke\Desktop\CGRP\Backup\CGRP\gamemodes\CG-RPv1.pwn(1354) : error 029: invalid expression, assumed zero
C:\Users\Kevin Burke\Desktop\CGRP\Backup\CGRP\gamemodes\CG-RPv1.pwn(1354) : error 017: undefined symbol "i"
C:\Users\Kevin Burke\Desktop\CGRP\Backup\CGRP\gamemodes\CG-RPv1.pwn(1354) : fatal error 107: too many error messages on one line

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


4 Errors.
Then I switch to line 1354, and this is in it;

Код:
    foreach(new i : Player)
I have foreach.inc in my pawno/includes, but shit aint working. I also have #include <foreach>

This is the whole code from line 1352-1359;

Код:
IsVehicleOccupied( vehicleid )
{
    foreach(new i : Player)
    {
     if( IsPlayerInVehicle( i, vehicleid ) ) return 1;
    }
    return 0;
}
Any solution?


Re: Compiler error - Lumineux - 23.01.2016

So you have foreach.inc in your includes folder, but do you have #include "foreach" in your gamemode ?


Re: Compiler error - iKevin - 23.01.2016

Quote:
Originally Posted by Lumineux
Посмотреть сообщение
So you have foreach.inc in your includes folder, but do you have #include "foreach" in your gamemode ?
Yep I do.. Also this is the whole code from line 1352-1359

Код:
IsVehicleOccupied( vehicleid )
{
    foreach(new i : Player)
    {
     if( IsPlayerInVehicle( i, vehicleid ) ) return 1;
    }
    return 0;
}



Re: Compiler error - iKevin - 23.01.2016

Someone please help me.


Re: Compiler error - iKevin - 23.01.2016

Anybody?


Re: Compiler error - iKevin - 23.01.2016

Hello?


Re: Compiler error - iKevin - 23.01.2016

Come on, bump


Re: Compiler error - Ripster - 23.01.2016

Код:
IsVehicleOccupied( vehicleid )
{
    foreach(Player, i)
    {
     if( IsPlayerInVehicle( i, vehicleid ) ) return 1;
    }
    return 0;
}
Maybe?


Re: Compiler error - iKevin - 23.01.2016

Let me check, thanks bruh


Re: Compiler error - Ripster - 23.01.2016

try with this http://www.solidfiles.com/d/6d56b1968c/
Код:
foreach(Player, i)