[Help] Gang Zones
#1

Hello , i have a gang function . it update automatically . I mean when i enter into a zone it start turfing automatically but i want a change .The change is that when player type /war the so the war start up . I tried to make a code like
CMD:war(playerid, params[]) and then putting the code of the callback into its braces . but it don't work as there is a SetTimer code . Help me please if you can . following is the code.
OnGameModeInit()
PHP код:
SetTimer("ZoneTimer"1000true); 
PHP код:
public ZoneTimer()
{
    for(new 
i=0sizeof(ZoneInfo); i++) // loop all zones
    
{
        if(
ZoneAttacker[i] != -1// zone is being attacked
        
{
            if(
GetPlayersInZone(iZoneAttacker[i]) >= MIN_MEMBERS_TO_START_WAR// team has enough members in the zone
            
{
                
ZoneAttackTime[i]++;
                if(
ZoneAttackTime[i] == TAKEOVER_TIME// zone has been under attack for enough time and attackers take over the zone
                
{
                    
GangZoneStopFlashForAll(ZoneID[i]);
                    
ZoneInfo[i][zTeam] = ZoneAttacker[i];
                    
GangZoneShowForAll(ZoneID[i], GetTeamZoneColor(ZoneInfo[i][zTeam])); // update the zone color for new team
                    
ZoneAttacker[i] = -1;
                }
            }
            else 
// attackers failed to take over the zone
            
{
                
GangZoneStopFlashForAll(ZoneID[i]);
                
ZoneAttacker[i] = -1;
            }
        }
        else 
// check if somebody is attacking
        
{
            for(new 
t=0sizeof(Teams); t++) // loop all teams
            
{
                if(
Teams[t] != ZoneInfo[i][zTeam] && GetPlayersInZone(iTeams[t]) >= MIN_MEMBERS_TO_START_WAR// if there are enough enemies in the zone
                
{
                    
ZoneAttacker[i] = Teams[t];
                    
ZoneAttackTime[i] = 0;
                    
GangZoneFlashForAll(ZoneID[i], GetTeamZoneColor(ZoneAttacker[i]));
                }
            }
        }
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)