22.06.2012, 03:38
I made a small Capture Zone system. The Script:-
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?
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;
}