War System Help
#1

i have this war system

PHP код:
new ntimer[MAX_PLAYERS];
new 
wtimer[MAX_PLAYERS];
new 
acceptwar 0;
new 
Killing[MAX_TEAMS],
    
bool:IsWar;
forward WarEnded();
public 
WarEnded()
{
    new 
str[128];
    
IsWar false;
    
format(str128,"{FFFFFF}[WAR OVER]:TheTriads-LSV-Grove: %d kills || The Mafia-VLA-{CD3278}Ballas: %d kills,",Killing[18] + Killing[6] + Killing[15], Killing[5] + Killing[17] + Killing[16]);
    
SendClientMessageToAll(COLOR_WHITE,str);
    if(
Killing[18] + Killing[6] + Killing[15] > Killing[5] + Killing[16] + Killing[17])
    {
        for(new 
aa<MAX_PLAYERS;a++)
        {
            if(
PlayerInfo[a][pLeader] == 18 || PlayerInfo[a][pLeader] == || PlayerInfo[a][pLeader] == 15 || PlayerInfo[a][pMember] == 18
            
|| PlayerInfo[a][pMember] == || PlayerInfo[a][pMember] == 16)
            {
                new 
randombani 1000+random(4001);// bani random intre 1k si 5k
                
new randomdroguri 1000+random(4001);// droguri random intre 1k si 5k
                
new randommats 1000+random(4001);// mats random intre 1k si 5k
                
PlayerInfo[a][pMats] += randommats;
                
PlayerInfo[a][pDrugs] += randomdroguri;
                
GivePlayerMoney(arandombani);
                
SendClientMessageToAll(COLOR_WHITE,"Triads-LSV-Grove Win the war");
                
SendClientMessageToAll(COLOR_WHITE,"{00FA9A}Membrii aliantei castigatoare au primit  mats, drugs si $$$$ pentru castigarea warului!");
            }
        }
    }
    else
    {
        for(new 
kk<MAX_PLAYERS;k++)
        {
            if(
PlayerInfo[k][pLeader] == || PlayerInfo[k][pLeader] == 16 || PlayerInfo[k][pLeader] == 17 || PlayerInfo[k][pMember] == 5
            
|| PlayerInfo[k][pMember] == 16 || PlayerInfo[k][pMember] == 17)
            {
                new 
randombani 1000+random(4001);// bani random intre 1k si 5k
                
new randomdroguri 1000+random(4001);// droguri random intre 1k si 5k
                
new randommats 1000+random(4001);// mats random intre 1k si 5k
                
PlayerInfo[a][pMats] += randommats;
                
PlayerInfo[a][pDrugs] += randomdroguri;
                
GivePlayerMoney(arandombani);
                
SendClientMessageToAll(COLOR_WHITE,"Mafia-VLA-Ballas Win the war");
                
SendClientMessageToAll(COLOR_WHITE,"{00FA9A}Membrii aliantei castigatoare au primit mats, drugs si $$$0 pentru castigarea warului!");            }
        }
    }
    for(new 
i;i<MAX_TEAMS;i++)
    {
        
Killing[i] = 0;
    }
    return 
1;
}
if(
strcmp(cmd"/startwar"true) == 0)
     {
         if(
IsPlayerConnected(playerid))
          {
            if(
wtimer[playerid] < 1)
            { }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"You must wait 12 hours for every war");
                return 
1;
            }
            if(
PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pLeader] == 15)
              {
                  
acceptwar 1;
                new 
x_nr[256];
                
x_nr strtok(cmdtextidx);
                if(!
strlen(x_nr))
                {
                        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /startwar list , /startwar [locul]");
                        return 
1;
                  }
                  if(
strcmp(x_nr,"list",true) == 0)
                   {
                    
SendClientMessage(playeridCOLOR_YELLOW"_________Locuri_List_________");
                    
SendClientMessage(playeridCOLOR_GRAD1"1:GS/LS 2: BS/LS  3: Madd Dog House");
                     return 
1;
                  }
                   else if(
strcmp(x_nr,"1",true) == 0)
                   {
                    
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {8B5A2B}Triads-{DBDB70}LSV{D3D3D3}-{66CD00}Grove {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
                    return 
1;
                }
                else if(
strcmp(x_nr,"2",true) == 0)
                {
                    
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {8B5A2B}Triads-{DBDB70}LSV{D3D3D3}-{66CD00}Grove {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
                    return 
1;
                }
                else if(
strcmp(x_nr,"3",true) == 0)
                {
                       
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {8B5A2B}Triads-{DBDB70}LSV{D3D3D3}-{66CD00}Grove {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
                       return 
1;
                }
            }
            else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 16)
            {
                
acceptwar 1;
                   new 
x_nr[256];
                
x_nr strtok(cmdtextidx);
                if(!
strlen(x_nr))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /startwar list , /startwar [locul]");
                    return 
1;
                 }
                 if(
strcmp(x_nr,"list",true) == 0)
                  {
                    
SendClientMessage(playeridCOLOR_YELLOW"_________Locuri_List_________");
                    
SendClientMessage(playeridCOLOR_GRAD1"1: GS/LS 2: BS/LS 3: Madd Dog House");
                      return 
1;
                }
                  else if(
strcmp(x_nr,"1",true) == 0)
                 {
                       
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {EE2C2C}Mafia{D3D3D3}-{97FFFF}VLA{D3D3D3}-{CD3278}Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
                      return 
1;
                }
                else if(
strcmp(x_nr,"2",true) == 0)
                   {
                      
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {EE2C2C}Mafia{D3D3D3}-{97FFFF}VLA{D3D3D3}-{CD3278}Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
                     return 
1;
                }
                else if(
strcmp(x_nr,"3",true) == 0)
                {
                       
SendClientMessageToAll(COLOR_GREEN"{00FA9A}[WAR]: {EE2C2C}Mafia{D3D3D3}-{97FFFF}VLA{D3D3D3}-{CD3278}Ballas {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
                       return 
1;
                }
            }
            else
            {
                  
SendClientMessage(playeridCOLOR_GRAD2"You are not a gang / mafia leader!");
                  return 
1;
              }
            
wtimer[playerid] = 3000000;
        }
        return 
1;
    }
    if(
strcmp(cmd"/acceptwar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
acceptwar == 1)
            {
                if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 16)
                {
                    
acceptwar 0;
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Started________|");
                    
SendClientMessageToAll(COLOR_BLUE,"{EE2C2C}Mafia{D3D3D3}-{97FFFF}VLA{D3D3D3}-{CD3278}Ballas {00FA9A}au acceptat WARUL!");
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}Va rugam , evitati acea zona!");
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|_____WAR Started_____|");
                    
SetTimer("WarEnded"13000000);
                    for(new 
i;MAX_TEAMS;i++)
                    {
                        
Killing[i] = 0;
                    }
                    
IsWar true;
                }
                else if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 18)
                {
                    
acceptwar 0;
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Started________|");
                    
SendClientMessageToAll(COLOR_BLUE,"{D3D3D3}Triads-{DBDB70}LSV{D3D3D3}-{66CD00}Grove {00FA9A}au acceptat WARUL!");
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}Va rugam , evitati acea zona!");
                    
SendClientMessageToAll(COLOR_BLUE,"{00FA9A}|________WAR Started________|");
                    
SetTimer("WarEnded"13000000);
                    for(new 
i;MAX_TEAMS;i++)
                    {
                        
Killing[i] = 0;
                    }
                    
IsWar true;
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY,"    you are not authorized to use this command(LEADERS ONLY)");
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"   there wasn't any war proposed");
            }
        }
        return 
1;
    } 
how can i make that one war participant to play the war for 3 lifes
if he dies 3 times he will be kicked from war or something like this

PS: i dont know if the source cod is very good , but its all i have ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)