Re: Creating captureable GangZones. [Best for TDM] -
DiReCt hIt - 21.11.2012
Nice Work !
Re: Creating captureable GangZones. [Best for TDM] -
DaRk_RaiN - 24.11.2012
I made something similar for my server then i found a bug.
Try to capture a zone then disconnect from the server, then connect again..and the zone doesn't show for the player
But when you try to enter the capture Check Point it says already take by your team.
So you should add something like this to the tuto
HTML Code:
public OnPlayerSpawn(playerid)
{
if(tCheck[Zone] == TEAM_RUSSIA)return GangZoneShowForPlayer(Zone, COLOR_RUSSIA);
if(tCheck[Zone] == TEAM_USA)return GangZoneShowForPlayer(Zone, COLOR_USA);
return 1;
}
And that will be a lot of coding if you have many zones
Re: Creating captureable GangZones. [Best for TDM] -
[DOG]irinel1996 - 24.11.2012
Make the zone captureable when someone kills about 2-3 players from X team in that zone. And start a war, as in Single Player.
Nice tutorial, and code.
Re: Creating captureable GangZones. [Best for TDM] -
x96664 - 26.11.2012
Good job!
Respuesta: Creating captureable GangZones. [Best for TDM] -
Strier - 26.12.2012
Great, this is simply great and helped me a lot.
Re: Creating captureable GangZones. [Best for TDM] -
Dark Killer - 12.01.2013
Good Job Dude
The only thing that i didn't got is zDefine thing and #define Zone 1 i didn't got its use btw :P
I have to define like
Code:
#define Zone 1
#define Zone2 2
#define Zone3 3
?? or like what??
Re: Creating captureable GangZones. [Best for TDM] - Jarnu - 12.01.2013
Yes, you doing correct darkKiller, you've to define like that only.
Re: Creating captureable GangZones. [Best for TDM] -
Inverse - 21.06.2013
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.
Re: Creating captureable GangZones. [Best for TDM] -
DaRk_RaiN - 21.06.2013
Quote:
Originally Posted by Inverse
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.
|
Right. I did however report a bug on my previous post.
Hopefully I'll have time to make a new and proper tutorial about this.
Re: Creating captureable GangZones. [Best for TDM] -
Inverse - 21.06.2013
Quote:
Originally Posted by DaRk_RaiN
Right. I did however report a bug on my previous post.
Hopefully I'll have time to make a new and proper tutorial about this.
|
Oh, didn't see that. Yeah it would be good if you make one since I can see only 2 capture zone tutorials here and both of them are inaccurate plus not properly explained.