Help :)
#1

Is there a way to make a team assist system when you're capturing a zone and there's someone else came to the checkpoint which is capturing the zone and you're already capturing and he's in the same team , Is there a way to increase the team by two seconds instead of one and the both who were capturing the zone get score/cash ? thanks

PHP код:
//Zone1
new basecapturer1 = -1;
new 
zone1time;
new 
zone1timer=0;
new 
zonecp1;
new 
zonecapturing1;
new 
zone1capturedby;
new 
Text:capzone1;
stock CreateZone1Text()
{
         
capzone1 TextDrawCreate(240.0240.0" ");
        
TextDrawLetterSize(capzone10.251.4);
        
TextDrawSetProportional(capzone11);
        
TextDrawSetShadow(capzone11);
        
TextDrawAlignment(capzone11);
}
public 
OnGameModeInit()
{
CreateZone1Text();
zonecp1 CreateDynamicCP(170.8172,1985.8171,20.0259,4.0,-1,-1,-1,20.0);
return 
1;
}
zonetext TextDrawCreate(320.0420.0"~G~Zone has been captured!");
    
TextDrawLetterSize(zonetext0.251.4);
    
TextDrawSetProportional(zonetext1);
    
TextDrawSetShadow(zonetext1);
    
TextDrawAlignment(zonetext2);
    
    
zonetext2 TextDrawCreate(320.0420.0"~r~You have failed to capture this zone!");
    
TextDrawLetterSize(zonetext20.251.4);
    
TextDrawSetProportional(zonetext21);
    
TextDrawSetShadow(zonetext21);
    
TextDrawAlignment(zonetext22);
forward zonecapture1(playerid);
public 
zonecapture1(playerid)
{
      new 
string[120];
      if(
Team[playerid] == 1)
      {
          
GangZoneFlashForAll(gang[2],COLOR_TERRORIST);
      }
      else
      {
        
GangZoneFlashForAll(gang[2],COLOR_ARMY);
      }
      
zone1timer++;
      
format(stringsizeof(string), "~P~You've started a zone war ~B~%d~w~/~R~30"zone1timer);
      
TextDrawSetString(capzone1string);
      
TextDrawShowForPlayer(playeridcapzone1);
      if(
zone1timer == 30)
      {
        
KillTimer(zone1time);
        
GangZoneStopFlashForAll(gang[2]);
        
GangZoneShowForAll(gang[2],GetPlayerColor(playerid));
        
TextDrawDestroy(capzone1);
        
xps[playerid] = xps[playerid]+500;
        
GivePlayerScore(playerid,3);
        
GivePlayerMoney(playerid500);
        
zonecapturing1 0;
        
zone1timer=0;
        
basecapturer1 = -1;
        if(
Team[playerid] == 1)
          {
              if(
zone1capturedby == 2)
            {
            
format(stringsizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We lost the Old Office!");
            
SendMessageToTerriost(COLOR_TERRORISTstring);
            }
              
format(stringsizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We took over the Old Office!");
            
SendMessageToArmy(COLOR_ARMYstring);
            
zone1capturedby 1;
              
armykills armykills+3;
         }
          else if(
Team1[playerid] == 2)
          {
              if(
zone1capturedby == 1)
            {
            
format(stringsizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We lost the Old Office!");
            
SendMessageToArmy(COLOR_ARMYstring);
            }
            
format(stringsizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We took over the Old Office!");
            
SendMessageToTerriost(COLOR_TERRORISTstring);
            
terrkills terrkills+3;
            
zone1capturedby 2;
          }
          
SendClientMessage(playeridCOLOR_SILVER"You have captured this base and earned 500 cash, 500xp and 3 score.");
          
TextDrawShowForPlayer(playeridzonetext);
        
SetTextDrawTimer(playeridzonetext4000);
        
CreateZone1Text();
      }
      return 
1;
}
public 
OnPlayerEnterDynamicCP(playerid,checkpointid)
{
    new 
string[200];
    if(
checkpointid == zonecp1)
    {
        if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_RED"You cannot capture the bases on vehicles!");
        if(
zonecapturing1 == 1) return SendClientMessage(playeridCOLOR_RED"The base already getting captured!");
        if(
Team[playerid] == 1)
          {
            if(
zone1capturedby == 1) return SendClientMessage(playeridCOLOR_RED"Your team already captured this base!");
        }
        else if(
Team1[playerid] == 2)
        {
            if(
zone1capturedby == 2) return SendClientMessage(playeridCOLOR_RED"Your team already captured this base!");
        }
        
GangZoneShowForAll(gang[2],GetPlayerColor(playerid));
        
zone1time SetTimerEx("zonecapture1"10001"i"playerid);
        if(
Team[playerid] == 1)
        {
            
format(stringsizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}We are currently attacking the Old Office!");
            
SendMessageToArmy(COLOR_ARMYstring);
            
format(stringsizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}The S.W.A.T is currently attacking the Old Office!");
            
SendMessageToTerriost(COLOR_TERRORISTstring);
        }
        else if(
Team1[playerid] == 2)
        {
            
format(stringsizeof(string), "{FF0000}[Team Radio] Intel: {FFFFFF}We are currently attacking the Old Office!");
            
SendMessageToTerriost(COLOR_TERRORISTstring);
            
format(stringsizeof(string), "{006FFF}[Team Radio] Intel: {FFFFFF}The Terrorists Are currently attacking the Old Office!");
            
SendMessageToArmy(COLOR_ARMYstring);
        }
        
basecapturer1 playerid;
        
zonecapturing1 1;
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == zonecp1)
    {
        if(
playerid == basecapturer1)
        {
             if(
zonecapturing1 == 1)
            {
                
KillTimer(zone1time);
                
TextDrawDestroy(capzone1);
                
CreateZone1Text();
                if(
zone1capturedby == 0)
                {
                    
GangZoneHideForAll(gang[2]);
                }
                else if(
zone1capturedby == 1)
                {
                    
GangZoneStopFlashForAll(gang[2]);
                    
GangZoneShowForAll(gang[2],COLOR_ARMY);
                }
                else if(
zone1capturedby == 2)
                {
                    
GangZoneStopFlashForAll(gang[2]);
                    
GangZoneShowForAll(gang[2],COLOR_TERRORIST);
                }
                
zonecapturing1 0;
                  
zone1timer=0;
                  
basecapturer1 = -1;
                
SendClientMessage(playeridCOLOR_RED"You have failed to capture this base!");
                
TextDrawShowForPlayer(playeridzonetext2);
                
SetTextDrawTimer(playeridzonetext24000);
               }
        }
    }
    return 
1;

But note: do not give me the tutorials links becasue I'll not use another code Because I've scripted 17 zones with this one already so tell me how to make it with this code , thanks in advance
Reply
#2

When you enter the cp just et a global var to true
then when someone will go in the cp check if the var = true, then he'll be an assistant

check every seconds (from the first player's timer) if global var is true and if it is, divide the time left by two or something like that

If I've undertood your request
Reply
#3

Loop the zone's capturing with 1 for each time.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)