Capture zones :D
#1

Hey all know about call of duty capture zone maybe..

I want help to modifie one feature

I want to change something that donors can capture zone fast than other class....i mean donor class.

Please reply
Reply
#2

Somewhere in the script it should be a percentage which is increasing if a player is on the zone. Insert another "if" in there to check whether the player who is capturing is a VIP, donor or whatever, and if it is, increase the capturing percentage again.
Reply
#3

Can you explain more about this!!?
Reply
#4

There's got to be something like "FLAG_CAPTURE_TIME" or "CAPTURE_TIME" and a value next to it.

Simply define a DONOR_CAPTURE_TIME and set an if statement as soon as the player gets in a zone
Reply
#5

here is example of my capture zone

plz can you add for me i am real newbie

pawn Код:
stock ActiveBay(playerid)
{
    if(Spectating[playerid] == 0 || PlayerInfo[playerid][OnDuty] == 0 || gTeam[playerid] != TEAM_MERC)
    {
        if(UnderAttack[BAY] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                UnderAttack[BAY] = 1;
                timer[playerid][BAY] = SetTimerEx("Bay", 30000, false,"i",playerid);
                Captured[playerid][BAY] = 0;
                SendClientMessage(playerid, 0xFFFFFFFF,"| - Stay in this checkpoint for 30 seconds to capture! - |");
                if(gTeam[playerid] == TEAM_TALIBAN)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_TALIBAN_COLOR);
                }
                else if(gTeam[playerid] == TEAM_EURASIA)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_EURASIA_COLOR);
                }
                else if(gTeam[playerid] == TEAM_ARAB)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_ARAB_COLOR);
                }
                else if(gTeam[playerid] == TEAM_SOVIET)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_SOVIET_COLOR);
                }
                else if(gTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_USA_COLOR);
                }
                else if(gTeam[playerid] == TEAM_AUS)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_AUS_COLOR);
                }
                //------Message-----
                if(tCP[BAY] == TEAM_TALIBAN)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<TALIBAN>");
                  SendTeamMessage(TEAM_TALIBAN, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_EURASIA)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<EURASIA>");
                  SendTeamMessage(TEAM_EURASIA, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_ARAB)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<ARAB>");
                  SendTeamMessage(TEAM_ARAB, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_SOVIET)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<SOVIET>");
                  SendTeamMessage(TEAM_SOVIET, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_USA)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<USA>");
                  SendTeamMessage(TEAM_USA, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_AUS)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<AUSTRALIA>");
                  SendTeamMessage(TEAM_AUS, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_NONE)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team");
                }
                //---------loop-------//
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                   IsPlayerCapturing[i][BAY] = 1;
                }
            }
            else return CaptureZoneMessage(playerid, 1);
        }
        else return CaptureZoneMessage(playerid, 2);
    }
    else return CaptureZoneMessage(playerid, 3);
    return 1;
}
stock BayCaptured(playerid)
{
    Captured[playerid][BAY] = 1;
    UnderAttack[BAY] = 0;
    KillTimer(timer[playerid][BAY]);
    TextDrawHideForPlayer(playerid, CountText[playerid]);
    CountVar[playerid][BAY] = 30;
    GivePlayerScore(playerid, 3);
    GivePlayerMoney(playerid, 5000);
    TextDrawShowForPlayer(playerid, Rank1[playerid]);
    new str[200];
    format(str, sizeof(str),"~W~SCR: ~y~%d~n~~b~K: ~y~%d ~r~D: ~y~%d", GetPlayerScore(playerid),PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths]);
    TextDrawSetString(Rank1[playerid], str);
    SendClientMessage(playerid, COLOR_WHITE,"You have earned +3 Score and +$5000 for Captureing This Area.");
    //==========================================================================
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][BAY] = 0;
       if(gTeam[i] == gTeam[playerid] && i != playerid && PlayerInfo[i][OnDuty] == 0)
       {
           SendClientMessage(i, 0xFFFFFFFF,"*Your team has captured "cred"Bay"cwhite"! You received +1 score for it!");
           GivePlayerScore(i, 1);
       }
    }
    //==========================================================================
    tCP[BAY] = gTeam[playerid];
    GangZoneStopFlashForAll(Zone[BAY]);
    //==========================================================================
    if(gTeam[playerid] == TEAM_TALIBAN)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_TALIBAN_COLOR);
    }
    else if(gTeam[playerid] == TEAM_EURASIA)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_EURASIA_COLOR);
    }
    else if(gTeam[playerid] == TEAM_ARAB)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_ARAB_COLOR);
    }
    else if(gTeam[playerid] == TEAM_SOVIET)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_SOVIET_COLOR);
    }
    else if(gTeam[playerid] == TEAM_USA)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_USA_COLOR);
    }
    else if(gTeam[playerid] == TEAM_AUS)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_AUS_COLOR);
    }
    //==========================================================================
    format(str, sizeof(str),"%s has captured Beach Shack for team %s", pName(playerid), GetTeamName(playerid));
    SendBoxMessage(str);
    return 1;
}
stock LeavingBay(playerid)
{
    Captured[playerid][BAY] = 1;
    UnderAttack[BAY] = 0;
    KillTimer(timer[playerid][BAY]);
    TextDrawHideForPlayer(playerid, CountText[playerid]);
    CountVar[playerid][BAY] = 30;
    GangZoneStopFlashForAll(Zone[BAY]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][BAY] = 0;
    }
    SendClientMessage(playerid, red,"*You have been failed to capture this zone!");
    return 1;
}
forward Bay(playerid);
public Bay(playerid)
{
    BayCaptured(playerid);
    return 1;
}
Reply
#6

pawn Код:
stock ActiveBay(playerid)
{
    if(Spectating[playerid] == 0 || PlayerInfo[playerid][OnDuty] == 0 || gTeam[playerid] != TEAM_MERC)
    {
        if(UnderAttack[BAY] == 0)
        {
            if(!IsPlayerInAnyVehicle(playerid))
            {
                if(PlayerInfo[playerid][pDonator] == 1) // if is a donator, change this to your variable for donator
                {
                    UnderAttack[BAY] = 1;
                    timer[playerid][BAY] = SetTimerEx("Bay", 15000, false,"i",playerid); // 15 instead of 30
                    Captured[playerid][BAY] = 0;
                    SendClientMessage(playerid, 0xFFFFFFFF,"| - Stay in this checkpoint for 15 seconds to capture! - |");
                }
                else // if he isnt a donator
                {
                    UnderAttack[BAY] = 1;
                    timer[playerid][BAY] = SetTimerEx("Bay", 30000, false,"i",playerid); // 30 regular time
                    Captured[playerid][BAY] = 0;
                    SendClientMessage(playerid, 0xFFFFFFFF,"| - Stay in this checkpoint for 30 seconds to capture! - |");
                }
                if(gTeam[playerid] == TEAM_TALIBAN)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_TALIBAN_COLOR);
                }
                else if(gTeam[playerid] == TEAM_EURASIA)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_EURASIA_COLOR);
                }
                else if(gTeam[playerid] == TEAM_ARAB)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_ARAB_COLOR);
                }
                else if(gTeam[playerid] == TEAM_SOVIET)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_SOVIET_COLOR);
                }
                else if(gTeam[playerid] == TEAM_USA)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_USA_COLOR);
                }
                else if(gTeam[playerid] == TEAM_AUS)
                {
                  GangZoneFlashForAll(Zone[BAY], TEAM_ZONE_AUS_COLOR);
                }
                //------Message-----
                if(tCP[BAY] == TEAM_TALIBAN)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<TALIBAN>");
                  SendTeamMessage(TEAM_TALIBAN, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_EURASIA)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<EURASIA>");
                  SendTeamMessage(TEAM_EURASIA, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_ARAB)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<ARAB>");
                  SendTeamMessage(TEAM_ARAB, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_SOVIET)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<SOVIET>");
                  SendTeamMessage(TEAM_SOVIET, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_USA)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<USA>");
                  SendTeamMessage(TEAM_USA, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_AUS)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is controlled by team "COL_RED"<AUSTRALIA>");
                  SendTeamMessage(TEAM_AUS, green,"*Bay is under attack!");
                }
                else if(tCP[BAY] == TEAM_NONE)
                {
                  SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team");
                }
                //---------loop-------//
                for(new i = 0; i < MAX_PLAYERS; i ++)
                {
                   IsPlayerCapturing[i][BAY] = 1;
                }
            }
            else return CaptureZoneMessage(playerid, 1);
        }
        else return CaptureZoneMessage(playerid, 2);
    }
    else return CaptureZoneMessage(playerid, 3);
    return 1;
}
stock BayCaptured(playerid)
{
    Captured[playerid][BAY] = 1;
    UnderAttack[BAY] = 0;
    KillTimer(timer[playerid][BAY]);
    TextDrawHideForPlayer(playerid, CountText[playerid]);
    CountVar[playerid][BAY] = 30;
    GivePlayerScore(playerid, 3);
    GivePlayerMoney(playerid, 5000);
    TextDrawShowForPlayer(playerid, Rank1[playerid]);
    new str[200];
    format(str, sizeof(str),"~W~SCR: ~y~%d~n~~b~K: ~y~%d ~r~D: ~y~%d", GetPlayerScore(playerid),PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths]);
    TextDrawSetString(Rank1[playerid], str);
    SendClientMessage(playerid, COLOR_WHITE,"You have earned +3 Score and +$5000 for Captureing This Area.");
    //==========================================================================
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][BAY] = 0;
       if(gTeam[i] == gTeam[playerid] && i != playerid && PlayerInfo[i][OnDuty] == 0)
       {
           SendClientMessage(i, 0xFFFFFFFF,"*Your team has captured "cred"Bay"cwhite"! You received +1 score for it!");
           GivePlayerScore(i, 1);
       }
    }
    //==========================================================================
    tCP[BAY] = gTeam[playerid];
    GangZoneStopFlashForAll(Zone[BAY]);
    //==========================================================================
    if(gTeam[playerid] == TEAM_TALIBAN)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_TALIBAN_COLOR);
    }
    else if(gTeam[playerid] == TEAM_EURASIA)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_EURASIA_COLOR);
    }
    else if(gTeam[playerid] == TEAM_ARAB)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_ARAB_COLOR);
    }
    else if(gTeam[playerid] == TEAM_SOVIET)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_SOVIET_COLOR);
    }
    else if(gTeam[playerid] == TEAM_USA)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_USA_COLOR);
    }
    else if(gTeam[playerid] == TEAM_AUS)
    {
       GangZoneShowForAll(Zone[BAY], TEAM_ZONE_AUS_COLOR);
    }
    //==========================================================================
    format(str, sizeof(str),"%s has captured Beach Shack for team %s", pName(playerid), GetTeamName(playerid));
    SendBoxMessage(str);
    return 1;
}
stock LeavingBay(playerid)
{
    Captured[playerid][BAY] = 1;
    UnderAttack[BAY] = 0;
    KillTimer(timer[playerid][BAY]);
    TextDrawHideForPlayer(playerid, CountText[playerid]);
    CountVar[playerid][BAY] = 30;
    GangZoneStopFlashForAll(Zone[BAY]);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
       IsPlayerCapturing[i][BAY] = 0;
    }
    SendClientMessage(playerid, red,"*You have been failed to capture this zone!");
    return 1;
}
forward Bay(playerid);
public Bay(playerid)
{
    BayCaptured(playerid);
    return 1;
}
Try it and read the comments I've placed in the first lines of code.


Cheers!
Reply
#7

Can you plz also tell what to define? i am getting to much errors
Reply
#8

Quote:
Originally Posted by Ryz
Посмотреть сообщение
Can you plz also tell what to define? i am getting to much errors
I'm guessing you followed this tutorial;
http://forum.sa-mp.com/showthread.ph...hlight=Capture

Just define the things he has, but instead of using "CAPZONE", use your zone name( I guess it's "BAY"? )
Reply
#9

All defined are already defined like that tutorial
Reply
#10

Perfectly working Thanks for help guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)