[Tutorial] Creating captureable GangZones. [Best for TDM]
#28

This is an incomplete tutorial with a lot of faults at some stages.

1) I don't understand the use of zDefine variable. The script should work fine without that.

2) This script has no mechanism to set the gangzone colour to the captured team colour after the player respawns on reconnects. I suggest the use of following code.

Under OnPlayerConnect or OnPlayerSpawn callback.
pawn Code:
#define INVALID_TEAM_ID 0

if(tCheck[Zone1] != INVALID_TEAM_ID) GangZoneShowForAll(Zone[Zone1], GetPlayerColor(playerid));
else GangZoneShowForAll(Zone[Zone1], COLOR_GREY);
   
if(tCheck[Zone2] != INVALID_TEAM_ID) GangZoneShowForAll(Zone[Zone2], GetPlayerColor(playerid));
else GangZoneShowForAll(Zone[Zone2], COLOR_GREY);

if(tCheck[Zone3] != INVALID_TEAM_ID) GangZoneShowForAll(Zone[Zone3], GetPlayerColor(playerid));
else GangZoneShowForAll(Zone[Zone3], COLOR_GREY);
3) Your code under OnPlayerLeaveDynamicCP is also incomplete. Suppose if a player enters a capture-zone and starts capturing it. Meanwhile, another player gets into the checkpoint. The server will respond "This zone is already being fought over" to the second player. But when the second player gets out of the checkpoint. It will mess up everything for the first player i.e; it will stop the gangzone flash for all.

So I suggest the use of this under OnPlayerLeaveDynamicCP.

pawn Code:
new UnderAttack [MAX_PLAYERS][30]

if(checkpointid == CP[Zone1] && UnderAttack[playerid][Zone1] == 1)
{
    UnderAttack[playerid][Zone1] = 0;
    GangZoneStopFlashForAll(Zone[Zone1]);
    KillTimer(timer[playerid][Zone1]);
}
In a nutshell, this tutorial requires a lot of modifications. I'm surprised on how no one pointed out these mistakes before.
Reply


Messages In This Thread
Creating captureable GangZones. [Best for TDM] - by Jarnu - 20.08.2012, 15:16
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 28.08.2012, 09:03
Re: Creating captureable GangZones. [Best for TDM] - by Jeth - 28.08.2012, 11:01
Re: Creating captureable GangZones. [Best for TDM] - by Inverse9 - 28.08.2012, 14:33
Re: Creating captureable GangZones. [Best for TDM] - by DeadLy™ - 28.08.2012, 15:21
Re: Creating captureable GangZones. [Best for TDM] - by Lordzy - 28.08.2012, 15:43
Re: Creating captureable GangZones. [Best for TDM] - by Nirzor - 28.08.2012, 15:46
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 29.08.2012, 09:18
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 04.09.2012, 11:38
Re: Creating captureable GangZones. [Best for TDM] - by Devilxz97 - 04.09.2012, 13:01
Re: Creating captureable GangZones. [Best for TDM] - by Cassy_ - 04.09.2012, 13:10
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 04.09.2012, 14:49
Re: Creating captureable GangZones. [Best for TDM] - by JustinAn - 05.09.2012, 01:32
Re: Creating captureable GangZones. [Best for TDM] - by davve95 - 05.09.2012, 05:36
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 05.09.2012, 06:01
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 16.09.2012, 10:56
Re: Creating captureable GangZones. [Best for TDM] - by DaRk_RaiN - 15.11.2012, 08:38
Re: Creating captureable GangZones. [Best for TDM] - by Coder_ - 20.11.2012, 17:24
Re: Creating captureable GangZones. [Best for TDM] - by Joshman543 - 20.11.2012, 19:37
Re: Creating captureable GangZones. [Best for TDM] - by ikkentim - 21.11.2012, 19:59
Re: Creating captureable GangZones. [Best for TDM] - by DiReCt hIt - 21.11.2012, 19:59
Re: Creating captureable GangZones. [Best for TDM] - by DaRk_RaiN - 24.11.2012, 09:01
Re: Creating captureable GangZones. [Best for TDM] - by [DOG]irinel1996 - 24.11.2012, 21:03
Re: Creating captureable GangZones. [Best for TDM] - by x96664 - 26.11.2012, 18:32
Respuesta: Creating captureable GangZones. [Best for TDM] - by Strier - 26.12.2012, 07:06
Re: Creating captureable GangZones. [Best for TDM] - by Dark Killer - 12.01.2013, 05:29
Re: Creating captureable GangZones. [Best for TDM] - by Jarnu - 12.01.2013, 05:42
Re: Creating captureable GangZones. [Best for TDM] - by Inverse - 21.06.2013, 07:27
Re: Creating captureable GangZones. [Best for TDM] - by DaRk_RaiN - 21.06.2013, 10:39
Re: Creating captureable GangZones. [Best for TDM] - by Inverse - 21.06.2013, 11:18

Forum Jump:


Users browsing this thread: 2 Guest(s)