////// MAIN TIMER SET ONGAMEMODEINIT FOR EVERY 30 MINS
forward ZoneTimer();
public ZoneTimer()
{
if(CaptureOk == 0)
{
new randomzone = random(4);
if(randomzone == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneFlashForPlayer(i,drugzonesf,COLOR_RED);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Zone] - This Zone is now available to capture!");
CaptureOk = drugpointsf;
}
}
}
}
if(randomzone == 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneFlashForPlayer(i,drugzonels,COLOR_RED);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Zone] - This Zone is now available to capture!");
CaptureOk = drugpointls;
}
}
}
}
if(randomzone == 3)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneFlashForPlayer(i,matzonesf,COLOR_RED);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Zone] - This Zone is now available to capture!");
CaptureOk = matrunsf;
}
}
}
}
if(randomzone == 4)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneFlashForPlayer(i,matzonels,COLOR_RED);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Zone] - This Zone is now available to capture!");
CaptureOk = matrunls;
}
}
}
}
}
}
//////// GANG MEMBER INSIDE THE CHECKPOINT CAPTURING THE ZONE (TIMER)
forward CaptureTimer(playerid);
public CaptureTimer(playerid)
{
if(CapturingZone[playerid] == 0)
{
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
}
if(CapturingZone[playerid] == drugpointsf && CaptureAmount[playerid] > 0)
{
CaptureAmount[playerid] -= 1;
}
if(CapturingZone[playerid] == drugpointsf && CaptureAmount[playerid] <= 0)
{
if(PlayerInfo[playerid][pFaction] == 10)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - Grove has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 11)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - Ballas has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 12)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - Aztecas has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 13)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - Rifa has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 14)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - Triads has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 15)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - NangBoys has captured the zone!");
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] != 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointsf && PlayerInfo[i][pFaction] == 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
}
if(CapturingZone[playerid] == drugpointls && CaptureAmount[playerid] > 0)
{
CaptureAmount[playerid] -= 1;
}
if(CapturingZone[playerid] == drugpointls && CaptureAmount[playerid] <= 0)
{
if(PlayerInfo[playerid][pFaction] == 10)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - Grove has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 11)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - Ballas has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 12)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - Aztecas has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 13)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - Rifa has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 14)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - Triads has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 15)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, drugzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - NangBoys has captured the zone!");
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] != 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == drugpointls && PlayerInfo[i][pFaction] == 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Drug Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
}
if(CapturingZone[playerid] == matrunsf && CaptureAmount[playerid] > 0)
{
CaptureAmount[playerid] -= 1;
}
if(CapturingZone[playerid] == matrunsf && CaptureAmount[playerid] <= 0)
{
if(PlayerInfo[playerid][pFaction] == 10)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - Grove has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 11)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - Ballas has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 12)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - Aztecas has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 13)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - Rifa has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 14)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - Triads has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 15)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonesf);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - NangBoys has captured the zone!");
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] != 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunsf && PlayerInfo[i][pFaction] == 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[San Fierro Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
}
if(CapturingZone[playerid] == matrunls && CaptureAmount[playerid] > 0)
{
CaptureAmount[playerid] -= 1;
}
if(CapturingZone[playerid] == matrunls && CaptureAmount[playerid] <= 0)
{
if(PlayerInfo[playerid][pFaction] == 10)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - Grove has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 10)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 11)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - Ballas has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 11)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 12)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - Aztecas has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 12)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 13)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - Rifa has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 13)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 14)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - Triads has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 14)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
if(PlayerInfo[playerid][pFaction] == 15)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(FactionInfo[PlayerInfo[i][pFaction]][fType] == 20)
{
GangZoneStopFlashForPlayer(i, matzonels);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - NangBoys has captured the zone!");
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] != 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
}
if(InCaptureZone[i] == matrunls && PlayerInfo[i][pFaction] == 15)
{
InCaptureZone[i] = 0;
DisablePlayerCheckpoint(i);
SendClientMessage(i, COLOR_ORANGE, "[Los Santos Weapon Point] - You received $50,000 for capturing the zone!");
GivePlayerCash(i, 50000);
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
CaptureOk = 0;
}
}
}
}
}
}
new string[128];
format(string, sizeof(string), "~g~Seconds Left: ~w~ %d", CaptureAmount[playerid]);
GameTextForPlayer(playerid, string, 3000, 4);
}
////// ENTERING DYNAMIC AREA (ZONES)
if(IsPlayerInDynamicArea(playerid, drugpointsf))
{
if(CaptureOk == drugpointsf)
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
InCaptureZone[playerid] = drugpointsf;
SendClientMessage(playerid, COLOR_ORANGE, "[San Fierro Drug Zone] - This Zone is currently available to capture!");
SendClientMessage(playerid, COLOR_GREY, "One of your gang members must be in the checkpoint for 30 seconds to capture the zone!");
SetPlayerCheckpoint(playerid,-2462.3196,-114.8511,25.8209, 5.0); // SAN FIERRO DRUG CHECKPOINT
return 1;
}
}
}
if(IsPlayerInDynamicArea(playerid, drugpointls))
{
if(CaptureOk == drugpointls)
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
InCaptureZone[playerid] = drugpointls;
SendClientMessage(playerid, COLOR_ORANGE, "[Los Santos Drug Zone] - This Zone is currently available to capture!");
SendClientMessage(playerid, COLOR_GREY, "One of your gang members must be in the checkpoint for 30 seconds to capture the zone!");
SetPlayerCheckpoint(playerid,773.0373,-1014.1686,26.3594, 5.0); // LOS SANTOS DRUG CHECKPOINT
return 1;
}
}
}
if(IsPlayerInDynamicArea(playerid, matrunsf))
{
if(CaptureOk == matrunsf)
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
InCaptureZone[playerid] = matrunsf;
SendClientMessage(playerid, COLOR_ORANGE, "[San Fierro Weapon Zone] - This Zone is currently available to capture!");
SendClientMessage(playerid, COLOR_GREY, "One of your gang members must be in the checkpoint for 30 seconds to capture the zone!");
SetPlayerCheckpoint(playerid,-1733.2275,170.5280,3.5547, 5.0); // SAN FIERRO MAT CHECKPOINT
return 1;
}
}
}
if(IsPlayerInDynamicArea(playerid, matrunls))
{
if(CaptureOk == matrunls)
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
InCaptureZone[playerid] = matrunls;
SendClientMessage(playerid, COLOR_ORANGE, "[Los Santos Weapon Zone] - This Zone is currently available to capture!");
SendClientMessage(playerid, COLOR_GREY, "One of your gang members must be in the checkpoint for 30 seconds to capture the zone!");
SetPlayerCheckpoint(playerid,2175.9983,-2307.9177,13.5469, 5.0); // LOS SANTOS MAT CHECKPOINT
return 1;
}
}
}
////// LEAVING THE DYNAMIC AREA (ZONES)
if(IsPlayerInDynamicArea(playerid, drugpointsf))
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20)
{
InCaptureZone[playerid] = 0;
DisablePlayerCheckpoint(playerid);
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, drugpointls))
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20)
{
InCaptureZone[playerid] = 0;
DisablePlayerCheckpoint(playerid);
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, matrunsf))
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20)
{
InCaptureZone[playerid] = 0;
DisablePlayerCheckpoint(playerid);
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, matrunls))
{
if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == 20)
{
InCaptureZone[playerid] = 0;
DisablePlayerCheckpoint(playerid);
return 1;
}
}
/////// ENTERING THE CHECKPOINT INSIDE THE DYNAMIC AREA (ZONES)
if(IsPlayerInDynamicArea(playerid, drugpointsf))
{
if(InCaptureZone[playerid] == drugpointsf && ZoneBeingCaptured == 0 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
CaptureAmount[playerid] = 30;
ZoneBeingCaptured = 1;
CapturingZone[playerid] = drugpointsf;
SendClientMessage(playerid, COLOR_ORANGE, "[San Fierro Drug Zone] - You're capturing the zone!");
SendClientMessage(playerid, COLOR_GREY, "You must remain in the checkpoint for 30 seconds!");
PRCapture[playerid] = SetTimerEx("CaptureTimer", 1000, true, "i", playerid);
return 1;
}
if(InCaptureZone[playerid] == drugpointsf && ZoneBeingCaptured == 1 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[San Fierro Drug Zone] - This zone is already being captured!");
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, drugpointls))
{
if(InCaptureZone[playerid] == drugpointls && ZoneBeingCaptured == 0 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
CaptureAmount[playerid] = 30;
ZoneBeingCaptured = 1;
CapturingZone[playerid] = drugpointls;
SendClientMessage(playerid, COLOR_ORANGE, "[Los Santos Drug Zone] - You're capturing the zone!");
SendClientMessage(playerid, COLOR_GREY, "You must remain in the checkpoint for 30 seconds!");
PRCapture[playerid] = SetTimerEx("CaptureTimer", 1000, true, "i", playerid);
return 1;
}
if(InCaptureZone[playerid] == drugpointls && ZoneBeingCaptured == 1 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[Los Santos Drug Zone] - This zone is already being captured!");
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, matrunsf))
{
if(InCaptureZone[playerid] == matrunsf && ZoneBeingCaptured == 0 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
CaptureAmount[playerid] = 30;
ZoneBeingCaptured = 1;
CapturingZone[playerid] = matrunsf;
SendClientMessage(playerid, COLOR_ORANGE, "[San Fierro Weapon Zone] - You're capturing the zone!");
SendClientMessage(playerid, COLOR_GREY, "You must remain in the checkpoint for 30 seconds!");
PRCapture[playerid] = SetTimerEx("CaptureTimer", 1000, true, "i", playerid);
return 1;
}
if(InCaptureZone[playerid] == matrunsf && ZoneBeingCaptured == 1 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[San Fierro Weapon Zone] - This zone is already being captured!");
return 1;
}
}
if(IsPlayerInDynamicArea(playerid, matrunls))
{
if(InCaptureZone[playerid] == matrunls && ZoneBeingCaptured == 0 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
CaptureAmount[playerid] = 30;
ZoneBeingCaptured = 1;
CapturingZone[playerid] = matrunls;
SendClientMessage(playerid, COLOR_ORANGE, "[Los Santos Weapon Zone] - You're capturing the zone!");
SendClientMessage(playerid, COLOR_GREY, "You must remain in the checkpoint for 30 seconds!");
PRCapture[playerid] = SetTimerEx("CaptureTimer", 1000, true, "i", playerid);
return 1;
}
if(InCaptureZone[playerid] == matrunls && ZoneBeingCaptured == 1 && PlayerInfo[playerid][pDead] == 0 && JustDied[playerid] == 0 && PlayerInfo[playerid][pDeadAlready] == 0)
{
SendClientMessage(playerid, COLOR_RED, "[Los Santos Weapon Zone] - This zone is already being captured!");
return 1;
}
}
/////// LEAVING THE CHECKPOINT INSIDE THE DYNAMIC AREA (ZONES)
if(CapturingZone[playerid] == drugpointsf)
{
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "[San Fierro Drug Zone] - You have left the checkpoint!");
return 1;
}
if(CapturingZone[playerid] == drugpointls)
{
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "[Los Santos Drug Zone] - You have left the checkpoint!");
return 1;
}
if(CapturingZone[playerid] == matrunsf)
{
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "[San Fierro Weapon Zone] - You have left the checkpoint!");
return 1;
}
if(CapturingZone[playerid] == matrunls)
{
KillTimer(PRCapture[playerid]);
ZoneBeingCaptured = 0;
CapturingZone[playerid] = 0;
SendClientMessage(playerid, COLOR_RED, "[Los Santos Weapon Zone] - You have left the checkpoint!");
return 1;
}
For the "SOMETIMES WORKS"
new randomzone = random(4); That generates a random number between 0 and 3, not 1 and 4, whilist you're checking for 1-4. Either do random(4)+1 (that way you'll get 0,1,2,3 + 1 = 1,2,3,4) or change the function variables. https://sampwiki.blast.hk/wiki/Random The general formula is random(n)+min |
For the "SOMETIMES WORKS"
new randomzone = random(4); That generates a random number between 0 and 3, not 1 and 4, whilist you're checking for 1-4. Either do random(4)+1 (that way you'll get 0,1,2,3 + 1 = 1,2,3,4) or change the function variables. https://sampwiki.blast.hk/wiki/Random The general formula is random(n)+min |