Need Small Help with Zones
#1

I made a small Capture Zone system. The Script:-
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
   if(checkpointid == CP)
    {
      SendClientMessage(playerid, COLOR_RED,"You're capturing this zone! You Need to wait 30 Seconds");
      GangZoneFlashForAll(GangZone, COLOR_PINK);
      Capture = SetTimer("Check",30000,1);
    }
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
   if(checkpointid == CP)
    {
      SendClientMessage(playerid, COLOR_RED,"You have Failed to Take over the Zone!");
      GangZoneStopFlashForAll(GangZone);
      KillTimer(Capture);
    }
    else
    {
    KillTimer(Capture);
    }

forward Check(playerid);
public Check(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)+5 );
GivePlayerMoney(playerid, 500);
SendClientMessage(playerid, COLOR_BLUE,"You've capture the zone and receive 500 $ and 5 score");
GangZoneStopFlashForAll(GangZone);
if(gTeam[playerid] == TEAM_IRAQ)
{
GangZoneShowForAll(GangZone, COLOR_IRAQ);
}
else if(gTeam[playerid] == TEAM_INDIA)
{
GangZoneShowForAll(GangZone, COLOR_INDIA);
}
else if(gTeam[playerid] == TEAM_BANGLADESH)
{
GangZoneShowForAll(GangZone, COLOR_BANGLADESH);
}
else if(gTeam[playerid] == TEAM_PAKISTAN)
{
GangZoneShowForAll(GangZone, COLOR_PAKISTAN);
}
else if(gTeam[playerid] == TEAM_GERMANY)
{
GangZoneShowForAll(GangZone, COLOR_GERMANY);
}
else if(gTeam[playerid] == TEAM_HOLLAND)
{
GangZoneShowForAll(GangZone, COLOR_HOLLAND);
}
else if(gTeam[playerid] == TEAM_USA)
{
GangZoneShowForAll(GangZone, COLOR_USA);
}
else if(gTeam[playerid] == TEAM_UK)
{
GangZoneShowForAll(GangZone, COLOR_UK);
}
else if(gTeam[playerid] == TEAM_INDONESIA)
{
GangZoneShowForAll(GangZone, COLOR_INDONESIA);
}
else if(gTeam[playerid] == TEAM_CHINA)
{
GangZoneShowForAll(GangZone, COLOR_CHINA);
}
return 1;
}
Now i want to Prevent player to re-capture the zone .. and will give error that its already captured by his team.. how to do that? and how to add more capture zones in it?
Reply
#2

pawn Код:
new cZone[20]=-1;
Now, when a team captures a zone.
pawn Код:
cZone[GangZone] = TEAM_PAKISTAN;
Now when a player of team enter checkpoint
pawn Код:
if(gTeam[playerid] == cZone[GangZone]) return SendClientMessage(playerid,0xFFFFFF,"This zone is of your team.");
Search before posting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)