19.09.2011, 21:31
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
Help
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
{
#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
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
{
#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
:\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.
stock GetPlayerZone(playerid)
{
for(new i=0; i < sizeof(ZoneInfo); i++)
{
if(IsPlayerInZone(playerid, i))
{
return i;
}
}
return -1;
}