29.07.2012, 08:50
Okay, I have this:
And:
But the zone won't stop flashing, what's the problem?
pawn Код:
forward OnPlayerEnterDynamicCP(playerid, checkpointid);
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == A51CP || checkpointid == AIRCP || checkpointid == DESCP || checkpointid == FOCCP)
{
ShowPlayerDialog(playerid, D_SHOP, DIALOG_STYLE_LIST, " .:: Reality shop ::.", "Health ($2500)\nArmor ($3000)\nKnife ($500)\nChainsaw ($1000)\nDeagle ($1500)\nCombat Shotgun ($3500)\nMP5 ($2000)\nM4 ($3500)\nKatana ($1000)", "Buy", "Cancel");
}
else if(checkpointid == BigEarCP || checkpointid == SnakeCP || checkpointid == TeeMotelCP || checkpointid == OilCP)
{
new string[128], pZone;
if(GangInfo[checkpointid][gAttacked] == 1) return SendClientMessage(playerid, C_RED, "The zone is being captured!");
if(GangInfo[checkpointid][gOwner] == gTeam[playerid]) return SendClientMessage(playerid, C_LBLUE, "Your team owns this zone.");
GangInfo[checkpointid][gAttacked] = 1;
if(IsPlayerInDynamicArea(playerid, BigEarArea))
{
GangZoneFlashForAll(BigEarZone, GetPlayerGangColor(playerid));
pZone = BigEarArea;
}
else if(IsPlayerInDynamicArea(playerid, SnakeArea))
{
GangZoneFlashForAll(SnakeZone, GetPlayerGangColor(playerid));
pZone = SnakeArea;
}
else if(IsPlayerInDynamicArea(playerid, TeeMotelArea))
{
GangZoneFlashForAll(TeeMotelZone, GetPlayerGangColor(playerid));
pZone = TeeMotelArea;
}
else if(IsPlayerInDynamicArea(playerid, OilArea))
{
GangZoneFlashForAll(OilZone, GetPlayerGangColor(playerid));
pZone = OilArea;
}
PlayerCount[playerid] = 30;
PlayerCountTimer[playerid] = SetTimerEx("GangCount", 1000, true, "iii", playerid, checkpointid, pZone);
format(string, sizeof(string), "[ZONE] %s is being taken over!", GetZoneName(checkpointid));
SendClientMessageToAll(C_LGREEN, string);
}
return 1;
}
pawn Код:
forward GangCount(playerid, checkpointid, zonename);
public GangCount(playerid, checkpointid, zonename)
{
new time[16];
format(time, sizeof(time), "~g~%i..", PlayerCount[playerid]);
GameTextForPlayer(playerid, time, 1000, 3);
PlayerCount[playerid] --;
if(PlayerCount[playerid] == 0)
{
SendClientMessageToAll(C_GREY, "debug");// this is being sent ingame
GangInfo[checkpointid][gAttacked] = 0;
GangInfo[checkpointid][gOwner] = gTeam[playerid];
GangZoneStopFlashForAll(zonename);
GangZoneShowForAll(zonename, GetPlayerGangColor(playerid));
KillTimer(PlayerCountTimer[playerid]);
}
return 1;
}