21.11.2012, 19:59
Nice Work !
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; }
#define Zone 1 #define Zone2 2 #define Zone3 3
#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);
new UnderAttack [MAX_PLAYERS][30]
if(checkpointid == CP[Zone1] && UnderAttack[playerid][Zone1] == 1)
{
UnderAttack[playerid][Zone1] = 0;
GangZoneStopFlashForAll(Zone[Zone1]);
KillTimer(timer[playerid][Zone1]);
}
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:
So I suggest the use of this under OnPlayerLeaveDynamicCP. pawn Code:
|