function WarTimer()
{
new string[100], string2[150];
for(new i = 1; i < sizeof(Turfs); i++)
{
new attackers = WarInfo[i][wAttacker];
new defenders = WarInfo[i][wFaction];
if(WarInfo[i][wTime] >= 2)
{
foreach(Player,j)
{
if(WarInfo[i][wAttacker] == 5)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x00D9FAAA);
}
else if(WarInfo[i][wAttacker] == 6)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x666666AA);
}
else if(WarInfo[i][wAttacker] == 7)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x1EB500AA);
}
else if(WarInfo[i][wAttacker] == 8)
{
GangZoneFlashForPlayer(j,Turfs[i], 0xCC00B4AA);
}
}
}
if(WarInfo[i][wTime] > 0)
{
WarInfo[i][wTime] -= 1;
foreach(Player,j)
{
if(IsPlayerInTurf(j,i) == 1 || IsPlayerInTurf(j, i) == 0)
{
if(PlayerInfo[j][pMember] == attackers)
{
WarScoreF[attackers][i] += 0.002;
if(Wartimeon[j] == 1)
{
format(string,sizeof(string),"~y~TURF TIMER: ~w~%s",CalculeazaTimp2(WarInfo[i][wTime]));
PlayerTextDrawSetString(j, TurfTimer[j], string);
PlayerTextDrawShow(j, TurfTimer[j]);
format(string, sizeof(string), "~y~Deaths: ~w~%d", decese[j][i]);
PlayerTextDrawSetString(j, DeathsWar[j], string);
PlayerTextDrawShow(j, DeathsWar[j]);
format(string, sizeof(string), "~y~Kills: ~w~%d", ucideri[j][i]);
PlayerTextDrawSetString(j, KillsWar[j], string);
PlayerTextDrawShow(j, KillsWar[j]);
format(string, sizeof(string), "~y~Turf ID: ~w~%d", i);
PlayerTextDrawSetString(j, TurfWar[j], string);
PlayerTextDrawShow(j, TurfWar[j]);
}
}
if(PlayerInfo[j][pMember] == defenders)
{
WarScoreF[defenders][i] += 0.002;
if(Wartimeon[j] == 1)
{
format(string,sizeof(string),"~y~TURF TIMER: ~w~%s",CalculeazaTimp2(WarInfo[i][wTime]));
PlayerTextDrawSetString(j, TurfTimer[j], string);
PlayerTextDrawShow(j, TurfTimer[j]);
format(string, sizeof(string), "~y~Deaths: ~w~%d", decese[j][i]);
PlayerTextDrawSetString(j, DeathsWar[j], string);
PlayerTextDrawShow(j, DeathsWar[j]);
format(string, sizeof(string), "~y~Kills: ~w~%d", ucideri[j][i]);
PlayerTextDrawSetString(j, KillsWar[j], string);
PlayerTextDrawShow(j, KillsWar[j]);
format(string, sizeof(string), "~y~Turf ID: ~w~%d", i);
PlayerTextDrawSetString(j, TurfWar[j], string);
PlayerTextDrawShow(j, TurfWar[j]);
}
}
}
else if(Wartimeon[j] == 1)
{
PlayerTextDrawHide(j, TurfTimer[j]);
PlayerTextDrawHide(j, DeathsWar[j]);
PlayerTextDrawHide(j, KillsWar[j]);
PlayerTextDrawHide(j, TurfWar[j]);
}
}
if(WarInfo[i][wTime] == 1)
{
new Float: atscore = 0.0;
new Float: defscore = 0.0;
atscore = WarScoreF[attackers][i];
defscore = WarScoreF[defenders][i];
new winner;
if(atscore > defscore)
{
winner = 1;
}
else
{
winner = 2;
}
new winbest;
new winbestj = -1, losebestj = -1;
new bestname1[25],bestname2[25],bestname[25],worstname[25];
foreach(Player,j)
{
if(winner == 1)
{
if(PlayerInfo[j][pMember] == attackers)
{
winbest = bestscoreat[i];
if(bestmemberat[i] != 999)
{
if(PlayerInfo[bestmemberat[i]][pMember] == attackers)
{
winbestj = bestmemberat[i];
GetPlayerName(winbestj,bestname1,sizeof(bestname1));
strmid(bestname, bestname1, 0, strlen(bestname1), 255);
}
}
else
{
format(bestname,sizeof(bestname),"-");
strmid(bestname, bestname, 0, strlen(bestname), 255);
}
}
if(PlayerInfo[j][pMember] == defenders)
{
//losebest = worstscoredf[i];
if(worstmemberdf[i] != 999)
{
if(PlayerInfo[worstmemberdf[i]][pMember] == defenders)
{
losebestj = worstmemberdf[i];
GetPlayerName(losebestj,bestname2,sizeof(bestname2));
strmid(worstname, bestname2, 0, strlen(bestname2), 255);
}
}
else
{
format(worstname,sizeof(worstname),"-");
strmid(worstname, worstname, 0, strlen(worstname), 255);
}
}
}
if(winner == 2)
{
if(PlayerInfo[j][pMember] == defenders)
{
winbest = bestscoredf[i];
if(bestmemberdf[i] != 999)
{
if(PlayerInfo[bestmemberdf[i]][pMember] == defenders)
{
winbestj = bestmemberdf[i];
GetPlayerName(winbestj,bestname1,sizeof(bestname1));
strmid(bestname, bestname1, 0, strlen(bestname1), 255);
}
}
else
{
format(bestname,sizeof(bestname),"-");
strmid(bestname, bestname, 0, strlen(bestname), 255);
}
}
if(PlayerInfo[j][pMember] == attackers)
{
if(worstmemberat[i] != 999)
{
if(PlayerInfo[worstmemberat[i]][pMember] == attackers)
{
losebestj = worstmemberat[i];
GetPlayerName(losebestj,bestname2,sizeof(bestname2));
strmid(worstname, bestname2, 0, strlen(bestname2), 255);
}
}
else
{
format(worstname,sizeof(worstname),"-");
strmid(worstname, worstname, 0, strlen(worstname), 255);
}
}
}
}
foreach(Player,j)
{
if((PlayerInfo[j][pMember] == attackers) || (PlayerInfo[j][pMember] == defenders))
{
if(winner == 1)
{
TurfInfo[i][zOwned] = WarInfo[i][wAttacker];
Wartimeon[j] = 0;
PlayerTextDrawHide(j, TurfTimer[j]);
PlayerTextDrawHide(j, DeathsWar[j]);
PlayerTextDrawHide(j, KillsWar[j]);
PlayerTextDrawHide(j, TurfWar[j]);
format(string2,sizeof(string2),"{008BC7}Razboi: {ffffff}%s a castigat zona %d. Scor final: %s %.1f - %.1f %s",NumeFactiune(WarInfo[i][wAttacker]), i, NumeFactiune(WarInfo[i][wAttacker]), atscore, defscore, NumeFactiune(WarInfo[i][wFaction]));
OOCNews(-1, string2);
format(string2,sizeof(string2),"{008BC7}Razboi: {ffffff}Cel mai bun gangster: %s ( %d Ucideri ) || Cel mai slab gangster: %s ( %d Decese )", bestname, winbest, worstname, worstscoreat[i]);
OOCNews(-1, string2);
format(string2,sizeof(string2),"{008BC7}Scorul tau: {ffffff}%d ( %d ucideri, %d decese )",ucideri[j][i] - decese[j][i], ucideri[j][i], decese[j][i]);
SendClientMessage(j, -1,string2);
}
if(winner == 2)
{
Wartimeon[j] = 0;
PlayerTextDrawHide(j, TurfTimer[j]);
PlayerTextDrawHide(j, DeathsWar[j]);
PlayerTextDrawHide(j, KillsWar[j]);
PlayerTextDrawHide(j, TurfWar[j]);
format(string2,sizeof(string2),"{008BC7}Razboi: {ffffff}%s a castigat zona %d. Scor final: %s %.1f - %.1f %s",NumeFactiune(WarInfo[i][wFaction]), i, NumeFactiune(WarInfo[i][wFaction]), defscore, atscore, NumeFactiune(WarInfo[i][wAttacker]));
OOCNews(-1, string2);
format(string2,sizeof(string2),"{008BC7}Razboi: {ffffff}Cel mai bun gangster: %s ( %d Ucideri ) || Cel mai slab gangster: %s ( %d Decese )", bestname, winbest, worstname, worstscoreat[i]);
OOCNews(-1, string2);
format(string2,sizeof(string2),"{008BC7}Scorul tau: {ffffff}%d ( %d ucideri, %d decese )",ucideri[j][i] - decese[j][i], ucideri[j][i], decese[j][i]);
SendClientMessage(j, -1,string2);
}
WarScoreF[defenders][i] = 0.0;
WarScoreF[attackers][i] = 0.0;
InWar[attackers] = 0;
InWar[defenders] = 0;
}
if(winner == 1)
{
GangZoneHideForPlayer(j,Turfs[i]);
if(attackers == 5)
{
GangZoneShowForPlayer(j, Turfs[i], 0x00D9FAAA, 0x000000BB); // Aztecas
}
if(attackers == 6)
{
GangZoneShowForPlayer(j, Turfs[i], 0x666666AA, 0x000000BB); // Corleone
}
if(attackers == 7)
{
GangZoneShowForPlayer(j, Turfs[i], 0x1EB500AA, 0x000000BB); // Grove
}
if(attackers == 8)
{
GangZoneShowForPlayer(j, Turfs[i], 0xCC00B4AA, 0x000000BB); // Patterno
}
}
}
if(winner == 1)
{
new str[128];
format(str,128,"UPDATE `turfs` SET `Owned`='%d' WHERE `ID`='%d'",TurfInfo[i][zOwned],i);
mysql_query(handle, str);
}
WarInfo[i][wTime] = 0;
WarInfo[i][wFaction] = 0;
WarInfo[i][wAttacker] = 0;
worstscoreat[i] = 0;
worstmemberat[i] = 999;
bestscoreat[i] = 0;
bestmemberat[i] = 999;
worstscoredf[i] = 0;
worstmemberdf[i] = 999;
bestscoredf[i] = 0;
bestmemberdf[i] = 999;
}
}
}
return 1;
}
function OOCNews(color,const string[])
{
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i, color, string);
}
}
}
function WarTimer()
{
new string[100], stringg[150];
for(new i = 1; i < sizeof(Turfs); i++)
{
new attackers = WarInfo[i][wAttacker];
new defenders = WarInfo[i][wFaction];
if(WarInfo[i][wTime] >= 2)
{
foreach(Player,j)
{
if(WarInfo[i][wAttacker] == 5)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x00D9FAAA);
}
else if(WarInfo[i][wAttacker] == 6)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x666666AA);
}
else if(WarInfo[i][wAttacker] == 7)
{
GangZoneFlashForPlayer(j,Turfs[i], 0x1EB500AA);
}
else if(WarInfo[i][wAttacker] == 8)
{
GangZoneFlashForPlayer(j,Turfs[i], 0xCC00B4AA);
}
}
}
if(WarInfo[i][wTime] > 0)
{
WarInfo[i][wTime] -= 1;
foreach(Player,j)
{
if(IsPlayerInTurf(j,i) == 1 || IsPlayerInTurf(j, i) == 0)
{
if(PlayerInfo[j][pMember] == attackers)
{
WarScoreF[attackers][i] += 0.002;
}
if(PlayerInfo[j][pMember] == defenders)
{
WarScoreF[defenders][i] += 0.002;
}
}
if(Wartimeon[j] == 1)
{
if(Wartimeon[j] == 1)
{
format(string,sizeof(string),"~y~TURF TIMER: ~w~%s",CalculeazaTimp2(WarInfo[i][wTime]));
PlayerTextDrawSetString(j, TurfTimer[j], string);
PlayerTextDrawShow(j, TurfTimer[j]);
format(string, sizeof(string), "~y~Deaths: ~w~%d", decese[j][i]);
PlayerTextDrawSetString(j, DeathsWar[j], string);
PlayerTextDrawShow(j, DeathsWar[j]);
format(string, sizeof(string), "~y~Kills: ~w~%d", ucideri[j][i]);
PlayerTextDrawSetString(j, KillsWar[j], string);
PlayerTextDrawShow(j, KillsWar[j]);
format(string, sizeof(string), "~y~Turf ID: ~w~%d", i);
PlayerTextDrawSetString(j, TurfWar[j], string);
PlayerTextDrawShow(j, TurfWar[j]);
}
}
}
if(WarInfo[i][wTime] == 1)
{
new Float: atscore = 0.0;
new Float: defscore = 0.0;
atscore = WarScoreF[attackers][i];
defscore = WarScoreF[defenders][i];
new winner;
foreach(Player,j)
{
if(PlayerInfo[j][pMember] == attackers)
{
GangZoneStopFlashForPlayer(j,Turfs[i]);
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}Razboiul dintre %s si %s pentru teritoriul %d a luat sfarsit!",NumeFactiune(attackers),NumeFactiune(defenders),i);
SendClientMessage(j, -1,stringg);
}
if(PlayerInfo[j][pMember] == defenders)
{
GangZoneStopFlashForPlayer(j,Turfs[i]);
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}Razboiul dintre %s si %s pentru teritoriul %d a luat sfarsit!",NumeFactiune(attackers),NumeFactiune(defenders),i);
SendClientMessage(j, -1,stringg);
}
}
if(atscore > defscore)
{
winner = 1;
}
else
{
winner = 2;
}
new winbest, losebest;
new winbestj = -1, losebestj = -1;
new bestname1[25],bestname2[25],bestname[25],worstname[25];
foreach(Player,j)
{
if(winner == 1)
{
if(PlayerInfo[j][pMember] == attackers)
{
winbest = bestscoreat[i];
if(bestmemberat[i] != 999)
{
if(PlayerInfo[bestmemberat[i]][pMember] == attackers)
{
winbestj = bestmemberat[i];
GetPlayerName(winbestj,bestname1,sizeof(bestname1));
strmid(bestname, bestname1, 0, strlen(bestname1), 255);
}
}
else
{
format(bestname,sizeof(bestname)," - ");
strmid(bestname, bestname, 0, strlen(bestname), 255);
}
}
if(PlayerInfo[j][pMember] == defenders)
{
losebest = worstscoredf[i];
if(worstmemberdf[i] != 999)
{
if(PlayerInfo[worstmemberdf[i]][pMember] == defenders)
{
losebestj = worstmemberdf[i];
GetPlayerName(losebestj,bestname2,sizeof(bestname2));
strmid(worstname, bestname2, 0, strlen(bestname2), 255);
}
}
else
{
format(worstname,sizeof(worstname)," - ");
strmid(worstname, worstname, 0, strlen(worstname), 255);
}
}
}
if(winner == 2)
{
if(PlayerInfo[j][pMember] == defenders)
{
winbest = bestscoredf[i];
if(bestmemberdf[i] != 999)
{
if(PlayerInfo[bestmemberdf[i]][pMember] == defenders)
{
winbestj = bestmemberdf[i];
GetPlayerName(winbestj,bestname1,sizeof(bestname1));
strmid(bestname, bestname1, 0, strlen(bestname1), 255);
}
}
else
{
format(bestname,sizeof(bestname)," - ");
strmid(bestname, bestname, 0, strlen(bestname), 255);
}
}
if(PlayerInfo[j][pMember] == attackers)
{
losebest = worstscoreat[i];
if(worstmemberat[i] != 999)
{
if(PlayerInfo[worstmemberat[i]][pMember] == attackers)
{
losebestj = worstmemberat[i];
GetPlayerName(losebestj,bestname2,sizeof(bestname2));
strmid(worstname, bestname2, 0, strlen(bestname2), 255);
}
}
else
{
format(worstname,sizeof(worstname)," - ");
strmid(worstname, worstname, 0, strlen(worstname), 255);
}
}
}
}
foreach(Player,j)
{
new uciderii = 0;
uciderii += ucideri[j][i];
new decesee = 0;
decesee += decese[j][i];
ucideri[j][i] = 0;
decese[j][i] = 0;
if((PlayerInfo[j][pMember] == attackers) || (PlayerInfo[j][pMember] == defenders))
{
if(winner == 1)
{
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}%s a castigat teritoriul %d. Scor final: %s %.1f - %.1f %s",NumeFactiune(WarInfo[i][wAttacker]), i, NumeFactiune(WarInfo[i][wAttacker]), atscore, defscore, NumeFactiune(WarInfo[i][wFaction]));
OOCNews(-1, stringg);
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}Cel mai bun gangster: %s ( %d Ucideri ) || Cel mai slab gangster: %s ( %d Decese )", bestname, winbest, worstname, losebest);
OOCNews(-1, stringg);
format(stringg,sizeof(stringg),"{008BC7}Scorul tau: {ffffff}%d ( %d ucideri, %d decese )",uciderii-decesee, uciderii, decesee);
SendClientMessage(j, -1,stringg);
TurfInfo[i][zOwned] = WarInfo[i][wAttacker];
Wartimeon[j] = 0;
PlayerTextDrawHide(j, TurfTimer[j]);
PlayerTextDrawHide(j, DeathsWar[j]);
PlayerTextDrawHide(j, KillsWar[j]);
PlayerTextDrawHide(j, TurfWar[j]);
}
if(winner == 2)
{
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}%s a castigat zona %d. Scor final: %s %.1f - %.1f %s",NumeFactiune(WarInfo[i][wFaction]), i, NumeFactiune(WarInfo[i][wFaction]), defscore, atscore, NumeFactiune(WarInfo[i][wAttacker]));
OOCNews(-1, stringg);
format(stringg,sizeof(stringg),"{008BC7}Razboi: {ffffff}Cel mai bun gangster: %s ( %d Ucideri ) || Cel mai slab gangster: %s ( %d Decese )", bestname, winbest, worstname, worstscoreat[i]);
OOCNews(-1, stringg);
format(stringg,sizeof(stringg),"{008BC7}Scorul tau: {ffffff}%d ( %d ucideri, %d decese )",ucideri[j][i] - decese[j][i], ucideri[j][i], decese[j][i]);
SendClientMessage(j, -1,stringg);
Wartimeon[j] = 0;
PlayerTextDrawHide(j, TurfTimer[j]);
PlayerTextDrawHide(j, DeathsWar[j]);
PlayerTextDrawHide(j, KillsWar[j]);
PlayerTextDrawHide(j, TurfWar[j]);
}
WarScoreF[defenders][i] = 0.0;
WarScoreF[attackers][i] = 0.0;
InWar[attackers] = 0;
InWar[defenders] = 0;
}
if(winner == 1)
{
GangZoneHideForPlayer(j,Turfs[i]);
if(attackers == 5)
{
GangZoneShowForPlayer(j, Turfs[i], 0x00D9FAAA, 0x000000BB); // Aztecas
}
if(attackers == 6)
{
GangZoneShowForPlayer(j, Turfs[i], 0x666666AA, 0x000000BB); // Corleone
}
if(attackers == 7)
{
GangZoneShowForPlayer(j, Turfs[i], 0x1EB500AA, 0x000000BB); // Grove
}
if(attackers == 8)
{
GangZoneShowForPlayer(j, Turfs[i], 0xCC00B4AA, 0x000000BB); // Patterno
}
}
}
if(winner == 1)
{
new str[128];
format(str,128,"UPDATE `turfs` SET `Owned`='%d' WHERE `ID`='%d'",TurfInfo[i][zOwned],i);
mysql_query(handle,str);
}
WarInfo[i][wTime] = 0;
WarInfo[i][wFaction] = 0;
WarInfo[i][wAttacker] = 0;
worstscoreat[i] = 0;
worstmemberat[i] = 999;
bestscoreat[i] = 0;
bestmemberat[i] = 999;
worstscoredf[i] = 0;
worstmemberdf[i] = 999;
bestscoredf[i] = 0;
bestmemberdf[i] = 999;
}
}
}
return 1;
}
I did a system of war and when the war was over we put send you some messages. The problem is that they sent several times, and do not understand why you may know.
pawn Код:
![]() |
[13:32:31] [debug] Run time error 4: "Array index out of bounds"
[13:32:31] [debug] Accessing element at negative index -1
[13:32:31] [debug] AMX backtrace:
[13:32:31] [debug] #0 0001abb8 in ?? (0, 0, 0, 0, -1, 1060320051, 96, 85, 1060320051) from Gamemode.amx
[13:32:31] [debug] #1 00024c14 in public GZ_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #2 00011b20 in public AC_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #3 0000eb8c in public Hook_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #4 native CallLocalFunction () from samp03svr
[13:32:31] [debug] #5 0000e844 in public PZone_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #6 native CallLocalFunction () from samp03svr
[13:32:31] [debug] #7 0000c4a0 in public ppb_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #8 0000c228 in public SSCANF_OnGameModeInit () from unnic.amx
[13:32:31] [debug] #9 000037a8 in public zcmd_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #10 native CallLocalFunction () from samp03svr
[13:32:31] [debug] #11 00003264 in public Itter_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #12 native CallLocalFunction () from samp03svr
[13:32:31] [debug] #13 0000261c in public ScriptInit_OnGameModeInit () from Gamemode.amx
[13:32:31] [debug] #14 00001e28 in public OnGameModeInit () from Gamemode.amx
Ok, I'll do what you said, whether they will go.
I put Crashdetect and the OnGameModeInit gives me some error has nothing? PHP код:
|
[13:32:31] [debug] Run time error 4: "Array index out of bounds" [13:32:31] [debug] Accessing element at negative index -1 <- You index
new index; // before index 0 index--; // after index -1 var = array[index]; <- Error "Array index out of bounds"
#include <streamer>
#define MAX_ZONES 1024//maximum gangzones your server can have, the limit is upto 1024 and minimum 5
#define NUMDIS 40.0
#define MAX_GANGZONES 68
//Note: Creating one interactive gangzone makes total 5 zones, 4 for borders and 1 for the main zone!
enum GangzoneInfo
{
bool:E_exist,
E_border[4],
Float:E_minx,
Float:E_miny,
Float:E_maxx,
Float:E_maxy,
npart[5],
npart2[5]
}
static gGangzone[MAX_ZONES][GangzoneInfo];
static bool:gPlayerShown[MAX_PLAYERS][MAX_ZONES];
static gPlayerColor[MAX_PLAYERS][MAX_ZONES];
static gPlayerBorderColor[MAX_PLAYERS][MAX_ZONES];
//Note: if you use this in a filterscript, please define "FILTERSCRIPT" in your script
public OnGameModeInit()
{
DestroyAllGangZones();//destory all gangzones
#if defined GZ_OnGameModeInit
GZ_OnGameModeInit();
#endif
return 1;
}
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnGameModeInit GZ_OnGameModeInit
#if defined GZ_OnGameModeInit
forward GZ_OnGameModeInit();
#endif
public OnGameModeExit()
{
DestroyAllGangZones();//destory all gangzones
#if defined GZ_OnGameModeExit
GZ_OnGameModeExit();
#endif
return 1;
}
#if defined _ALS_OnGameModeExit
#undef OnGameModeExit
#else
#define _ALS_OnGameModeExit
#endif
#define OnGameModeExit GZ_OnGameModeExit
#if defined GZ_OnGameModeExit
forward GZ_OnGameModeExit();
#endif
stock GangZoneCreateNumber( gzid , gznum , Float:centposx , Float:centposy , Float:numsize )
{
switch(gznum)
{
case 0:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisx = 15.0*numsize;
new Float:gsdisy = 20.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Down of 0
gGangzone[gzid][npart][1] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy+gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Up of 0
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy+gztk,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left of 0
gGangzone[gzid][npart][3] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gsdisy+gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Right of 0
}
case 1:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gztk,centposy-gsdisy-gztk,centposx+gztk,centposy+gsdisy+gztk);
}
case 2:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][1] = GangZoneCreate(centposx+gsdisx-gztk-gztk,centposy+gztk,centposx+gsdisx,centposy+gsdisy-gztk); // Right Stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy+gztk,centposx-gsdisx+gztk+gztk,centposy-gztk); // Left Stick
gGangzone[gzid][npart][4] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
case 3:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][1] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy-gztk,centposx+gsdisx+gztk+gztk,centposy+gsdisy+gztk); // Stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
case 4:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy,centposx-gsdisx+gztk+gztk,centposy+gztk); // Left
gGangzone[gzid][npart][1] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk);// Middle
gGangzone[gzid][npart][2] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy,centposx+gsdisx+gztk+gztk,centposy+gsdisy); // Stick
}
case 5:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][1] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gztk,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left Stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gztk,centposx+gsdisx+gztk,centposy+gztk); // Middle
gGangzone[gzid][npart][3] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Right Stick
gGangzone[gzid][npart][4] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Down
}
case 6:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][1] = GangZoneCreate(centposx-gsdisx-gztk-gztk,centposy+gsdisy+gztk,centposx-gsdisx,centposy-gsdisy-gztk); // Main Left Stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
gGangzone[gzid][npart][4] = GangZoneCreate(centposx+gsdisx-gztk-gztk,centposy-gsdisy+gztk,centposx+gsdisx,centposy-gztk); // Right small stick
}
case 7:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 15.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Stick of 1
gGangzone[gzid][npart][1] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy+gztk); // Up of 1
}
case 8:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy+gztk,centposx-gsdisx+gztk,centposy-gsdisy-gztk); // Left stick
gGangzone[gzid][npart][1] = GangZoneCreate(centposx+gsdisx-gztk,centposy+gsdisy+gztk,centposx+gsdisx+gztk,centposy-gsdisy-gztk); // Right stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx+gztk,centposy+gsdisy-gztk,centposx+gsdisx-gztk,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][3] = GangZoneCreate(centposx-gsdisx+gztk,centposy-gztk,centposx+gsdisx-gztk,centposy+gztk); // Center
gGangzone[gzid][npart][4] = GangZoneCreate(centposx-gsdisx+gztk,centposy-gsdisy-gztk,centposx+gsdisx-gztk,centposy-gsdisy+gztk); // Down
}
case 9:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left Stick
gGangzone[gzid][npart][1] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy-gztk,centposx+gsdisx+gztk+gztk,centposy+gsdisy+gztk); // Right Stick
gGangzone[gzid][npart][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart][3] = GangZoneCreate(centposx-gsdisx+gztk,centposy,centposx+gsdisx,centposy+gztk+gztk); // Middle
gGangzone[gzid][npart][4] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
}
}
stock GangZoneCreateNumber2( gzid , gznum , Float:centposx , Float:centposy , Float:numsize)
{
switch(gznum)
{
case 0:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisx = 15.0*numsize;
new Float:gsdisy = 20.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Down of 0
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy+gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Up of 0
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy+gztk,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left of 0
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gsdisy+gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Right of 0
}
case 1:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gztk,centposy-gsdisy-gztk,centposx+gztk,centposy+gsdisy+gztk);
}
case 2:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx+gsdisx-gztk-gztk,centposy+gztk,centposx+gsdisx,centposy+gsdisy-gztk); // Right Stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy+gztk,centposx-gsdisx+gztk+gztk,centposy-gztk); // Left Stick
gGangzone[gzid][npart2][4] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
case 3:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy-gztk,centposx+gsdisx+gztk+gztk,centposy+gsdisy+gztk); // Stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
case 4:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy,centposx-gsdisx+gztk+gztk,centposy+gztk); // Left
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk);// Middle
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy,centposx+gsdisx+gztk+gztk,centposy+gsdisy); // Stick
}
case 5:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gztk,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left Stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gztk,centposx+gsdisx+gztk,centposy+gztk); // Middle
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Right Stick
gGangzone[gzid][npart2][4] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy-gsdisy+gztk); // Down
}
case 6:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx-gsdisx-gztk-gztk,centposy+gsdisy+gztk,centposx-gsdisx,centposy-gsdisy-gztk); // Main Left Stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx,centposy-gztk,centposx+gsdisx,centposy+gztk); // Middle
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx-gsdisx,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
gGangzone[gzid][npart2][4] = GangZoneCreate(centposx+gsdisx-gztk-gztk,centposy-gsdisy+gztk,centposx+gsdisx,centposy-gztk); // Right small stick
}
case 7:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 15.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx+gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy-gztk); // Stick of 1
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx-gsdisx,centposy+gsdisy-gztk,centposx+gsdisx+gztk,centposy+gsdisy+gztk); // Up of 1
}
case 8:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy+gztk,centposx-gsdisx+gztk,centposy-gsdisy-gztk); // Left stick
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx+gsdisx-gztk,centposy+gsdisy+gztk,centposx+gsdisx+gztk,centposy-gsdisy-gztk); // Right stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx+gztk,centposy+gsdisy-gztk,centposx+gsdisx-gztk,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx-gsdisx+gztk,centposy-gztk,centposx+gsdisx-gztk,centposy+gztk); // Center
gGangzone[gzid][npart2][4] = GangZoneCreate(centposx-gsdisx+gztk,centposy-gsdisy-gztk,centposx+gsdisx-gztk,centposy-gsdisy+gztk); // Down
}
case 9:
{
new Float:gztk = 4.0*numsize;
new Float:gsdisy = 20.0*numsize;
new Float:gsdisx = 25.0*numsize;
gGangzone[gzid][npart2][0] = GangZoneCreate(centposx-gsdisx-gztk,centposy,centposx-gsdisx+gztk,centposy+gsdisy-gztk); // Left Stick
gGangzone[gzid][npart2][1] = GangZoneCreate(centposx+gsdisx,centposy-gsdisy-gztk,centposx+gsdisx+gztk+gztk,centposy+gsdisy+gztk); // Right Stick
gGangzone[gzid][npart2][2] = GangZoneCreate(centposx-gsdisx-gztk,centposy+gsdisy-gztk,centposx+gsdisx,centposy+gsdisy+gztk); // Up
gGangzone[gzid][npart2][3] = GangZoneCreate(centposx-gsdisx+gztk,centposy,centposx+gsdisx,centposy+gztk+gztk); // Middle
gGangzone[gzid][npart2][4] = GangZoneCreate(centposx-gsdisx-gztk,centposy-gsdisy-gztk,centposx+gsdisx,centposy-gsdisy+gztk); // Down
}
}
}
stock GangZoneCreate_(Float:minx, Float:miny, Float:maxx, Float:maxy, color = -1, Float:bordersize = 1.0, bordercolor = 0x00000060, gznumber, Float:numsize)
{
new E_zone = GangZoneCreate(minx, miny, maxx, maxy);//the main zone
gGangzone[E_zone][E_minx] = minx;
gGangzone[E_zone][E_miny] = miny;
gGangzone[E_zone][E_maxx] = maxx;
gGangzone[E_zone][E_maxy] = maxy;
for(new players = 0; players < MAX_PLAYERS; players++)//setting player data
{
gPlayerShown[players][E_zone] = false;
gPlayerColor[players][E_zone] = color;
gPlayerBorderColor[players][E_zone] = bordercolor;
}
#define SEPERATION (2.0*bordersize)//the seperation value to differenciate borders from gangzone, set accordingly! (Default: 2.0)
gGangzone[E_zone][E_border][0] = GangZoneCreate(minx - SEPERATION, miny, minx + SEPERATION, maxy);//border 1
gGangzone[E_zone][E_border][1] = GangZoneCreate(minx - SEPERATION, maxy - SEPERATION, maxx, maxy + SEPERATION);//border 2
gGangzone[E_zone][E_border][2] = GangZoneCreate(maxx - SEPERATION, miny, maxx + SEPERATION, maxy);//border 3
gGangzone[E_zone][E_border][3] = GangZoneCreate(minx - SEPERATION, miny - SEPERATION, maxx, miny + SEPERATION);//border 4
// Numbers
new Float:centposx, Float:centposy;
centposx = (minx + maxx) / 2;
centposy = (miny + maxy) / 2;
if(gznumber >= 0 && gznumber <= 9)
{
GangZoneCreateNumber(E_zone, gznumber, centposx, centposy, numsize);
}
else if(gznumber > 9 && gznumber <= MAX_ZONES)
{
new temp123[3], gznum1[2], gznum2[2];
format(temp123, sizeof temp123, "%d", gznumber);
strmid(gznum1, temp123, 0, 1);
strmid(gznum2, temp123, 1, 2);
GangZoneCreateNumber(E_zone, strval(gznum1), centposx-(NUMDIS*numsize), centposy, numsize);
GangZoneCreateNumber2(E_zone, strval(gznum2), centposx+(NUMDIS*numsize), centposy, numsize);
}
gGangzone[E_zone][E_exist] = true;//finally, zone exists!
return E_zone;
}
#if defined _ALS_GangZoneCreate
#undef GangZoneCreate
#else
#define _ALS_GangZoneCreate
#endif
#define GangZoneCreate GangZoneCreate_
stock GangZoneDestroy_(zone)
{
if(! gGangzone[zone][E_exist]) return false;//check if exists
for(new players = 0; players < MAX_PLAYERS; players++)//remove player data
{
gPlayerColor[players][zone] = -1;
gPlayerShown[players][zone] = false;
gPlayerBorderColor[players][zone] = -1;
}
gGangzone[zone][E_minx] = 0.0;
gGangzone[zone][E_miny] = 0.0;
gGangzone[zone][E_maxx] = 0.0;
gGangzone[zone][E_maxy] = 0.0;
GangZoneDestroy(zone);//destroy main zone
for(new border = 0; border < 4; border++)//destroy all 4 borders
{
GangZoneDestroy(gGangzone[zone][E_border][border]);
for(new nump=0; nump < 5; nump++)
{
GangZoneDestroy(gGangzone[zone][npart][nump]);
GangZoneDestroy(gGangzone[zone][npart2][nump]);
}
}
gGangzone[zone][E_exist] = false;//finally, zone doesn't exists
return true;
}
#if defined _ALS_GangZoneDestroy
#undef GangZoneDestroy
#else
#define _ALS_GangZoneDestroy
#endif
#define GangZoneDestroy GangZoneDestroy_
stock GangZoneExist(zone)
{
if(zone < 0 || zone >= MAX_ZONES)
{
printf("Error::GangZoneExist()::Out Of Bounds::%i", zone);//by pottus
return false;//if invalid zone id
}
return gGangzone[zone][E_exist];//check if zone exists!
}
stock GangZoneShowForPlayer_(playerid, zone, color = -1, bordercolor = -1)
{
if(! GangZoneExist(zone)) return false;
if(color != -1) gPlayerColor[playerid][zone] = color;
if(bordercolor != -1) gPlayerBorderColor[playerid][zone] = bordercolor;
GangZoneShowForPlayer(playerid, zone, gPlayerColor[playerid][zone]);
for(new border = 0; border < 4; border++) GangZoneShowForPlayer(playerid, gGangzone[zone][E_border][border], gPlayerBorderColor[playerid][zone]);
for(new nump; nump < 5; nump++)
{
if(gGangzone[zone][npart][nump] != -1)
{
GangZoneShowForPlayer(playerid, gGangzone[zone][npart][nump], 0x000000BB);
}
if(gGangzone[zone][npart2][nump] != -1)
{
GangZoneShowForPlayer(playerid, gGangzone[zone][npart2][nump], 0x000000BB);
}
}
gPlayerShown[playerid][zone] = true;
return true;
}
#if defined _ALS_GangZoneShowForPlayer
#undef GangZoneShowForPlayer
#else
#define _ALS_GangZoneShowForPlayer
#endif
#define GangZoneShowForPlayer GangZoneShowForPlayer_
stock GangZoneShowForAll_(zone, color = -1, bordercolor = -1)
{
if(! GangZoneExist(zone)) return false;
for(new players = 0; players < MAX_PLAYERS; players++)
{
GangZoneShowForPlayer(players, zone, color);
for(new border = 0; border < 4; border++) GangZoneShowForPlayer(players, gGangzone[zone][E_border][border], bordercolor);
for(new nump; nump < 5; nump++)
{
if(gGangzone[zone][npart][nump] != -1)
{
GangZoneShowForPlayer(playerid, gGangzone[zone][npart][nump], 0x000000BB);
}
if(gGangzone[zone][npart2][nump] != -1)
{
GangZoneShowForPlayer(playerid, gGangzone[zone][npart2][nump], 0x000000BB);
}
}
}
return true;
}
#if defined _ALS_GangZoneShowForAll
#undef GangZoneShowForAll
#else
#define _ALS_GangZoneShowForAll
#endif
#define GangZoneShowForAll GangZoneShowForAll_
stock GangZoneHideForPlayer_(playerid, zone)
{
if(! GangZoneExist(zone)) return false;
GangZoneHideForPlayer(playerid, zone);
for(new border = 0; border < 4; border++) GangZoneHideForPlayer(playerid, gGangzone[zone][E_border][border]);
for(new nump=0; nump < 5; nump++)
{
GangZoneHideForPlayer(playerid, gGangzone[zone][npart][nump]);
GangZoneHideForPlayer(playerid, gGangzone[zone][npart2][nump]);
}
gPlayerShown[playerid][zone] = false;
return true;
}
#if defined _ALS_GangZoneHideForPlayer
#undef GangZoneHideForPlayer
#else
#define _ALS_GangZoneHideForPlayer
#endif
#define GangZoneHideForPlayer GangZoneHideForPlayer_
stock GangZoneHideForAll_(zone)
{
if(! GangZoneExist(zone)) return false;
GangZoneHideForAll(zone);
for(new border = 0; border < 4; border++) GangZoneHideForAll(gGangzone[zone][E_border][border]);
for(new players = 0; players < MAX_PLAYERS; players++) gPlayerShown[players][zone] = false;
return true;
}
#if defined _ALS_GangZoneHideForAll
#undef GangZoneHideForAll
#else
#define _ALS_GangZoneHideForAll
#endif
#define GangZoneHideForAll GangZoneHideForAll_
stock GangZoneSetColorForPlayer(playerid, zone, color, bordercolor = -1)
{
if(! GangZoneExist(zone)) return false;
if(gPlayerShown[playerid][zone]) GangZoneShowForPlayer(playerid, zone, color, bordercolor);
return true;
}
stock GangZoneSetColorForAll(zone, color, bordercolor = -1)
{
if(! GangZoneExist(zone)) return false;
for(new players = 0; players < MAX_PLAYERS; players++)
{
if(gPlayerShown[players][zone])
{
GangZoneShowForPlayer(players, zone, color, bordercolor);
}
}
return true;
}
//the flashing functions are same as that of samp!
// GangZoneFlashForPlayer(playerid, zone, flashcolor);
// GangZoneFlashForAll(zone, flashcolor);
// GangZoneStopFlashForPlayer(playerid, zone);
// GangZoneStopFlashForAll(zone);
stock DestroyAllGangZones()
{
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(GangZoneExist(zone))
{
GangZoneDestroy(zone);
}
}
return true;
}
stock ShowAllGangZonesForPlayer(playerid, color = -1, bordercolor = -1)
{
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(GangZoneExist(zone))
{
GangZoneShowForPlayer(playerid, zone, color, bordercolor);
}
}
return true;
}
stock ShowAllGangZonesForAll(color = -1, bordercolor = -1)
{
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(GangZoneExist(zone))
{
GangZoneShowForAll(zone color, bordercolor);
}
}
return true;
}
stock HideAllGangZonesForPlayer(playerid)
{
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(GangZoneExist(zone))
{
GangZoneHideForPlayer(playerid, zone);
}
}
return true;
}
stock HideAllGangZonesForAll()
{
for(new zone = 0; zone < MAX_ZONES; zone++)
{
if(GangZoneExist(zone))
{
GangZoneHideForAll(zone);
}
}
return true;
}
I found the problem, it is to include the gZone2. Maybe you can help me to fix it: D.
PHP код:
|