24.01.2015, 12:55
PHP код:
new count, Text:TD[MAX_ZONES];
stock ActiveCAPZONE(playerid)
{
if(UnderAttack[CAPZONE] == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
UnderAttack[CAPZONE] = 1;
timer[playerid][CAPZONE] = SetTimerEx("CAPZONETimer", 25000, false,"ii",CAPZONE, gTeam[playerid]);
Captured[playerid][CAPZONE] = 0;
SendClientMessage(playerid, 0xFFFFFFFF,"| Stay in this checkpoint for 25 seconds to capture it! |");
SetTimerEx("Countdown", 1000, true, "i", CAPZONE);
count=25;
TD[CAPZONE]=TextDrawCreate(//*
make textdraw
*//
if(gTeam[playerid] ==TEAM1)
{
GangZoneFlashForAll(Zone[CAPZONE], C_GZ_COLOR);
}
else if(gTeam[playerid] == TEAM2)
{
GangZoneFlashForAll(Zone[CAPZONE], T_GZ_COLOR);
}
else if(gTeam[playerid] == TEAM3)
{
GangZoneFlashForAll(Zone[CAPZONE], COLOR_KRED);
}
//------Message-----
if(tCP[CAPZONE] == TEAM1)
{
SendClientMessage(playerid, C_COLOR,"This flag is controlled by TEAM");
SendClientMessageToAll(STEALTH_BLUE,"*Base is under attack!");
}
else if(tCP[CAPZONE] == TEAM2)
{
//msgcapture
}
else if(tCP[CAPZONE] == TEAM3)
{
//msgcapture
}
else if(tCP[CAPZONE] == NONE)
{
SendClientMessage(playerid, COLOR_WHITE,"This flag is not controlled by any team!");
}
//---------loop-------//
for(new i = 0; i < MAX_PLAYERS; i ++)
{
IsPlayerCapturing[i][CAPZONE] = 1;
}
}
else return CaptureZoneMessage(playerid, 1);
}
else {
CaptureZoneMessage(playerid, 2);
}
return 1;
}
PHP код:
forward Countdown(CAPZONE, TEAM);
public Countdown(CAPZONE, TEAM)
{
count--;
TextDrawUpdateString(TD[CAPZONE], count);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(gTeam[i]==TEAM)
{
ShowPlayerTextdraw(playerid, TD[CAPZONE]);
}
}
}