29.07.2012, 08:42
pawn Код:
new capturing[MAX_PLAYERS];//Global
//In the function OnPLayerEnterCp
{
new pZone;
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;
}
capturing[playerid] = SetTimerEx("capturezone",30000,false,"ii",playerid,pZone);
}
forward capturezone(playerid,zone);
public capturezone(playerid,zone)
{
switch (zone)
{
case BigEarArea :
case SnakeArea :
case TeeMotelArea :
case OilArea :
}
//Capture Gangzone
}
OnPlayerLeaveDynamicCP(playerid,CPID)//or whatever this is called
{
KillTimer(capturing[playerid]);
}