Problem with gangzone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with gangzone (
/showthread.php?tid=605667)
Problem with gangzone -
Saliim - 23.04.2016
Hi, I have a problem with GANGZONE.
when the player takes a territory, he marks on the map, but when disconnects and reconnects it does not see the GANGZONE have win on the map
when you capture a territory, it is displayed in the map, but when you relog, we see Nothing
Код:
if(PlayerStats[playerid][GangID] != -1) SetPlayerColor(playerid, GangInfo[PlayerStats[playerid][GangID]][Color]);
new ZoneFile[255];
for(new zoneid = 1; zoneid < MAX_ZONES; zoneid++)
{
format(ZoneFile,sizeof(ZoneFile),GangZoneFile, zoneid);
if(dini_Exists(ZoneFile))
{
if(ZoneInfo[zoneid][OfGangID] == -1)
{
GangZoneShowForPlayer(playerid, ZoneInfo[zoneid][GZID], GCOLOR_GRIGIO);
}
else
{
GangZoneShowForPlayer(playerid, ZoneInfo[zoneid][GZID], GangInfo[ZoneInfo[zoneid][OfGangID]][Color]);
}
}
}
Re: Problem with gangzone -
colonel-top - 23.04.2016
Just Load it Because GangZone still have value (you said relog)
if you want to save just save when take territory or some another condition
Example :
PHP код:
if(PlayerStats[playerid][GangID] != -1) SetPlayerColor(playerid, GangInfo[PlayerStats[playerid][GangID]][Color]);
for(new zoneid = 1; zoneid < MAX_ZONES; zoneid++)
{
if(ZoneInfo[zoneid][OfGangID] == -1)
{
GangZoneShowForPlayer(playerid, ZoneInfo[zoneid][GZID], GCOLOR_GRIGIO);
}
else
{
GangZoneShowForPlayer(playerid, ZoneInfo[zoneid][GZID], GangInfo[ZoneInfo[zoneid][OfGangID]][Color]);
}
}
and you load gangzone when ongamemodeinit or filterscriptinit
Maybe Color Disappear Try to write some Stock get color out
IE :
PHP код:
stock GetZoneColor(GangID)
{
switch(GangInfo[GangID][Color]
{
case 1 : return GCOLOR_BLAHBLAH; // case zoneid == 1
case 2 : return GANGZONE_COLOR_BLAHBLAH; // case zoneid ==2
}
}
and put in
pawn Код:
GangZoneShowForPlayer(playerid, ZoneInfo[zoneid][GZID], GetZoneColor(zoneid));
Good Luck
Re: Problem with gangzone -
Saliim - 23.04.2016
thanks,
my problem is already solved , but when the server restarts, the GANZONE still exists but does not appear