War system
#1

I made this war system but i get those warning:

pawn Код:
C:\Users\Fiore\Desktop\PCRP\Palomino Creek Roleplay V1\zGaming RP\gamemodes\pcrp.pwn(26860) : warning 204: symbol is assigned a value that is never used: "IsWar"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
This is the war system:

pawn Код:
new wtimer[MAX_PLAYERS];
new acceptwar = 0;
new Killing[MAX_FAMILIES],
    bool:IsWar;

CMD:startwar(playerid, params[])
{
    new family;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pFamRank] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not a family leader.");
    if(sscanf(params, "i", family)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /startwar [familyid]");
    if(family < 1 || family > 10) return SendClientMessage(playerid, COLOR_GREY, "Families are between 1 and 10.");
    if(wtimer[playerid] < 1) return SendClientMessage(playerid, COLOR_GREY, "You must wait 12 hours for every war");
    if(acceptwar == 1)
    {
        SendPlayerFamMessage(playerid, COLOR_LIGHTBLUE, "[WAR-INFO] A war has started!");
    }
    wtimer[playerid] = 3000000;
    return 1;
}

CMD:acceptwar(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pFamRank] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not a family leader.");
    if(acceptwar == 1)
    {
        acceptwar = 0;
        SendClientMessageToAll(COLOR_LIGHTBLUE,"|________WAR STARTED________|");
        //SendClientMessageToAll(COLOR_LIGHTBLUE,"%s VS %s"); //fix this
        SendClientMessageToAll(COLOR_LIGHTBLUE,"|___________________________|");
        for(new fam=1; fam< MAX_FAMILIES; fam++)
        {
            Killing[fam] = 0;
        }
        IsWar = true;
    }
    return 1;
}

forward WarEnded();
public WarEnded()
{
    new str[128];
    IsWar = false;
    format(str, 128,"{FFFFFF}[WAR OVER]:Cuneo: %d points || {CD3278}Tattaglia: %d points,",Killing[1], Killing[2]);
    SendClientMessageToAll(COLOR_WHITE,str);
    if(Killing[1] > Killing[2])
    {
        for(new a; a<MAX_PLAYERS;a++)
        {
            if(PlayerInfo[a][pFam] == 1)
            {
                SendClientMessageToAll(COLOR_WHITE,"Cuneo-VS-Tattaglia - [Cuneo]Win the war");
            }
        }
    }
    else
    {
        for(new k; k<MAX_PLAYERS;k++)
        {
            if(PlayerInfo[k][pFam] == 2)
            {
                SendClientMessageToAll(COLOR_WHITE,"Tattaglia-VS-Cuneo - [Tattaglia]Win the war");
            }
        }
    }
    for(new fam=1; fam< MAX_FAMILIES; fam++)
    {
        Killing[fam] = 0;
    }
    return 1;
}
Reply


Messages In This Thread
War system - by Fiore - 20.01.2013, 16:15
Re: War system - by LarzI - 20.01.2013, 16:17
Re: War system - by [XST]O_x - 20.01.2013, 16:17
Re: War system - by Fiore - 20.01.2013, 16:20
Re: War system - by [XST]O_x - 20.01.2013, 16:22
Re: War system - by Fiore - 20.01.2013, 16:30
Re: War system - by [XST]O_x - 20.01.2013, 16:33

Forum Jump:


Users browsing this thread: 1 Guest(s)