#Defines not working for me
#1

I'm just woundring why defines doesn't work for me,il give you a example,since i'm scripting a Turf takeover systeme.
Help
Reply
#2

Elaborate.
Reply
#3

pawn Code:
if(GetPlayersInZone(i, ZoneAttacker[i]) >= 1) // there must be at least 1 attacker left
            {
                ZoneAttackTime[i]++;
                if(ZoneAttackTime[i] == TAKEOVER_TIME) // zone has been under attack for enough time and attackers take over the zone
                {
pawn Code:
#define TAKEOVER_TIME 120 // how many seconds needed to take over the zone
#define MIN_DEATHS_TO_START_WAR 3 // how many team members must be killed in a zone to start a war
Reply
#4

Quote:
Originally Posted by Kush
View Post
Elaborate.
You mean what?
Reply
#5

Quote:
Originally Posted by Issam
View Post
You mean what?
I mean, define what you mean by "#defines not working"
Reply
#6

Quote:
Originally Posted by Kush
View Post
I mean, define what you mean by "#defines not working"
Here is a example:
pawn Code:
if(GetPlayersInZone(i, ZoneAttacker[i]) >= 1) // there must be at least 1 attacker left
            {
                ZoneAttackTime[i]++;
                if(ZoneAttackTime[i] == TAKEOVER_TIME) // zone has been under attack for enough time and attackers take over the zone
                {
pawn Code:
#define TAKEOVER_TIME 120 // how many seconds needed to take over the zone
#define MIN_DEATHS_TO_START_WAR 3 // how many team members must be killed in a zone to start a war

C
Code:
:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(100) : warning 217: loose indentation
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(612) : warning 235: public function lacks forward declaration (symbol "ZoneTimer")
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(618) : error 017: undefined symbol "GetPlayersInZone"
C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ms.pwn(621) : error 017: undefined symbol "TAKEOVER_TIME"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Quote:
Originally Posted by Issam
View Post
also help with warning in line 612
LINE:
[pawn]public ZoneTimer()
add this on top of your script.
Code:
forward ZoneTimer();
Reply
#8

Thanks,fixed.
ANYONE Help with DEFINES?
Reply
#9

Check that you didn't put your defines below #if defined FILTERSCRIPT, or they will not work (provided that you're not actually building a filterscript). Consult page 118 and 119 of pawn-lang.pdf to learn more about it.
Reply
#10

Y O U A R E A W E S O M E V I N C E
All my life, i ve been missed up with defines, so i didn't use them
its hard for me to edit my GameMode
Reply
#11

C:\DOCUME~1\SOUADU~1.000\Bureau\MYSERV~1\GAMEMO~1\ ms.pwn(651) : warning 203: symbol is never used: "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

pawn Code:
stock GetPlayerZone(playerid)
{
    for(new i=0; i < sizeof(ZoneInfo); i++)
    {
        if(IsPlayerInZone(playerid, i))
        {
            return i;
        }
    }
    return -1;
}
Help me removing the warning.
Reply
#12

Which line is giving you the errors?
Reply
#13

Quote:
Originally Posted by Memoryz
View Post
Which line is giving you the errors?
its warning,and its the FIRST! :P
If the warning fixes,errors gets fixed too.. if you know what i mean.

stock GetPlayerZone(playerid)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)