SA-MP Forums Archive
help pls - 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: help pls (/showthread.php?tid=525386)



help pls - BryanD - 11.07.2014

I have a problem with code
code:
Код:
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(2337) : warning 216: nested comment
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3444) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3942) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3992) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(9423) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(11373) : warning 216: nested comment
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12068) : error 017: undefined symbol "foreach"
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12068) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12068) : error 017: undefined symbol "i"
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12068) : fatal error 107: too many error messages on one line

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


4 Errors.
thats worked before i don't know what happend now..


Re : help pls - S4t3K - 11.07.2014

Add this line at the top of your mode

pawn Код:
#include <YSI\y_iterate>



Re: Re : help pls - BryanD - 11.07.2014

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
Add this line at the top of your mode

pawn Код:
#include <YSI\y_iterate>
still same error
Код:
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(2338) : warning 216: nested comment
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3445) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3943) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(3993) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(9424) : warning 217: loose indentation
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(11374) : warning 216: nested comment
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12069) : error 017: undefined symbol "foreach"
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12069) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12069) : error 017: undefined symbol "i"
C:\Users\user\Desktop\org\scr\script\gamemodes\NBGv1.0.9.2.pwn(12069) : fatal error 107: too many error messages on one line

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


4 Errors.



Re: help pls - Scrillex - 11.07.2014

Maybe show the lines... It would be much easier to say whats wrong!


Re: help pls - BryanD - 11.07.2014

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Maybe show the lines... It would be much easier to say whats wrong!
Код:
CMD:resethunt(playerid,params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 3) {
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5)
	        return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
			
		HuntedTime = 0;
		foreach(new i : Player) {
			if(Hunted[i] != 0) {
				SetPlayerHealth(i, 0.0);
				Hunted[i] = 0;
			}
		}
		SendClientMessage(playerid,COLOR_WHITE, "The grim reaper has awaken.");
	}
	return true;
}
here you go


Re : help pls - Clad - 11.07.2014

pawn Код:
#include foreach
Test this include :/


Re: Re : help pls - BryanD - 11.07.2014

Quote:
Originally Posted by Clad
Посмотреть сообщение
pawn Код:
#include foreach
Test this include :/
i have it already, thats something in the code maybe?
and i have a codes with this foreach..


Re: help pls - SHE790 - 11.07.2014

pawn Код:
CMD:resethunt(playerid,params[]) {
       if(PlayerInfo[playerid][pAdmin] >= 3) {
       if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5)
       return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
           
       HuntedTime = 0;
       foreach(new i : Player) {
       if(Hunted[i] != 0) {
       SetPlayerHealth(i, 0.0);
       Hunted[i] = 0;
            }
        }
       SendClientMessage(playerid,COLOR_WHITE, "The grim reaper has awaken.");
    }
       return true;
}



Re: help pls - BryanD - 11.07.2014

Quote:
Originally Posted by SHE790
Посмотреть сообщение
pawn Код:
CMD:resethunt(playerid,params[]) {
       if(PlayerInfo[playerid][pAdmin] >= 3) {
       if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 5)
       return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
           
       HuntedTime = 0;
       foreach(new i : Player) {
       if(Hunted[i] != 0) {
       SetPlayerHealth(i, 0.0);
       Hunted[i] = 0;
            }
        }
       SendClientMessage(playerid,COLOR_WHITE, "The grim reaper has awaken.");
    }
       return true;
}
same error :P


Re: help pls - BlackM - 11.07.2014

Well I aint familiar with foreach, but as u could nt get it to work yet maybe u can try out:


Код:
for(new i; i < MAX_PLAYERS; i++)
{
           if(Hunted[i] != 0)
           {
                 SetPlayerHealth(i, 0.0);
                 Hunted[i] = 0;
           }
}
You can replace MAX_PLAYERS with whatever array size u gave to the variable "Hunted"
Hope this helps