/startwar problem!
#1

Hi, I have a war sistem with commands: /startwar and /acceptwar
Detalis of war sistem: When a leader use command /startwar, he ask another ally if they want to start war. The asked ally need to use /acceptwar for the war begin. Is ok, but it doesn't end and ally don't receive award. Look command of war
pawn Код:
if(strcmp(cmd, "/startwar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(wtimer[playerid] < 1)
            { }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Trebuie sa astepti 12 ore la fiecare war!");
                return 1;
            }
            if(PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 12)
            {
                provoked = 1;
                new x_nr[256];
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
                {
                        SendClientMessage(playerid, COLOR_WHITE, "Tasteaza: /startwar list , /startwar [locul]");
                        return 1;
                }
                if(strcmp(x_nr,"list",true) == 0)
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "_________Lista Locuri_________");
                    SendClientMessage(playerid, COLOR_GRAD1, "1:GS/LS 2: BS/LS  3: Madd Dog House 4: Banca");
                    return 1;
                }
                else if(strcmp(x_nr,"1",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {8B5A2B}Corleone Family-{DBDB70}Paterno Family{D3D3D3}-{66CD00}Barzini Family {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
                    return 1;
                }
                else if(strcmp(x_nr,"2",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {8B5A2B}Corleone Family-{DBDB70}Paterno Family{D3D3D3}-{66CD00}Barzini Family {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
                    return 1;
                }
                else if(strcmp(x_nr,"3",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {8B5A2B}Corleone Family-{DBDB70}Paterno Family{D3D3D3}-{66CD00}Barzini Family {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
                    return 1;
                }
                else if(strcmp(x_nr,"4",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {8B5A2B}Corleone Family-{DBDB70}Paterno Family{D3D3D3}-{66CD00}Barzini Family {00FA9A}au declarat WAR , zona: {FFFFFF}Banca");
                    return 1;
                }
            }
            else if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pLeader] == 16)
            {
                provoked = 1;
                new x_nr[256];
                x_nr = strtok(cmdtext, idx);
                if(!strlen(x_nr))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "Tasteaza: /startwar list , /startwar [locul]");
                    return 1;
                }
                if(strcmp(x_nr,"list",true) == 0)
                {
                    SendClientMessage(playerid, COLOR_YELLOW, "_________Lista Locuri_________");
                    SendClientMessage(playerid, COLOR_GRAD1, "1: GS/LS 2: BS/LS 3: Madd Dog House 4: Banca");
                    return 1;
                }
                else if(strcmp(x_nr,"1",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {EE2C2C}Cuneo Family{D3D3D3}-{97FFFF}Stracci Family{D3D3D3}-{CD3278}Tattagalia Familty {00FA9A}au declarat WAR , zona: {FFFFFF}GS/LS");
                    return 1;
                }
                else if(strcmp(x_nr,"2",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {EE2C2C}Cuneo Family{D3D3D3}-{97FFFF}Stracci Family{D3D3D3}-{CD3278}Tattagalia Familty {00FA9A}au declarat WAR , zona: {FFFFFF}BS/LS");
                    return 1;
                }
                else if(strcmp(x_nr,"3",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {EE2C2C}Cuneo Family{D3D3D3}-{97FFFF}Stracci Family{D3D3D3}-{CD3278}Tattagalia Familty {00FA9A}au declarat WAR , zona: {FFFFFF}Madd Dog House");
                    return 1;
                }
                else if(strcmp(x_nr,"4",true) == 0)
                {
                    SendClientMessageToAll(COLOR_GREEN, "{00FA9A}[WAR]: {EE2C2C}Cuneo Family{D3D3D3}-{97FFFF}Stracci Family{D3D3D3}-{CD3278}Tattagalia Familty {00FA9A}au declarat WAR , zona: {FFFFFF}Banca");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_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 (provoked == 1)
         {
            if (PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pLeader] == 5)
         {
           new hour,minuite;
           gettime(hour,minuite);
           FixHour(hour);
           scoreteam1 = 0;
           scoreteam2 = 0;
           SetTimer("wartime", 1800000, false);
           SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Started____|");
           format(string, sizeof(string), "{006633}Barzini Family - {CC9933}Paterno Family - {663300}Corleone Family vS {660099}Tattagalia Familty - {99FFFF}Stracci Family - {990033}Cuneo Family");
           SendClientMessageToAll(COLOR_WHITE,string);
           SendClientMessageToAll(COLOR_WHITE, "Premiul: {F81414}10.000 {33AA33}$ {F81414}500 {33AA33}Mats {F81414}200 {33AA33}Drugs");
           format(string, sizeof(string), "War inceput la ora: {F81414}%d: %d", hour, minuite);
           SendClientMessageToAll(COLOR_WHITE,string);
           SendClientMessageToAll(COLOR_WHITE, "Va rugam evitati acea zona!");
           SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Started____|");
           provoked = 0;
            }
            }
            else
            {
              SendClientMessage(playerid, COLOR_GREY, "You are not a Leader or a gang/mafia Leader.");
            }
            }
      return 1;
 }
and end of war
pawn Код:
forward wartime();
public wartime()
{
    if(scoreteam1 > scoreteam2)
    {
        SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Finished____|");
        SendClientMessageToAll(COLOR_WHITE, "{F81414}Alianta {660099}The Tattagalia Family - {99FFFF}The Stracci Family - {990033}The Cuneo Family{F81414} a castigat warul");
        //SendClientMessageToAll(COLOR_WHITE, "{6EF83C}Scor war: Tattaglia Family - VLA - TM vs Grove - LSV - TT : %d - %d  ", scoreteam1 , scoreteam2);
        SendClientMessageToAll(COLOR_WHITE, "{F81414}All player on this aliances won 10,000 $, 500 Mats, 100 Drugs.");
        SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Finished____|");
        scoreteam1 = 0;
        scoreteam2 = 0;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                new leader = PlayerInfo[i][pLeader], member = PlayerInfo[i][pMember];
                if(leader == 12 || leader == 14 || leader == 6 || member == 12 || member == 14 || member == 6)
                {
                    PlayerInfo[i][pMats] += 500;
                    PlayerInfo[i][pDrugs] += 100;
                    GivePlayerMoney(i, 10000);
                }
            }
        }
    }
    else if(scoreteam1 < scoreteam2)
    {
        SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Finished____|");
        SendClientMessageToAll(COLOR_WHITE, "{F81414}Alianta {006633}The Barzini Family - {CC9933}The Paterno Family - {663300}The Corleone Family{F81414} a castigat warul");
        //SendClientMessageToAll(COLOR_WHITE, "{6EF83C}Scor war: Grove - LSV - TT vs Tattaglia Family - VLA - TM : %d - %d  ", scoreteam2 , scoreteam1);
        SendClientMessageToAll(COLOR_WHITE, "{F81414}All player on this aliances won 10,000 $, 500 Mats, 100 Drugs.");
        SendClientMessageToAll(COLOR_WHITE, "{6EF83C}|____War Finished____|");
        scoreteam1 = 0;
        scoreteam2 = 0;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                new leader = PlayerInfo[i][pLeader], member = PlayerInfo[i][pMember];
                if(leader == 15 || leader == 13 || leader == 5 || member == 15 || member == 13 || member == 5)
                {
                    PlayerInfo[i][pMats] += 500;
                    PlayerInfo[i][pDrugs] += 100;
                    GivePlayerMoney(i, 10000);
                }
            }
        }
    }
    return 1;
}
Reply
#2

Help pls, i have also the problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)