SA-MP Forums Archive
GangZones. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GangZones. (/showthread.php?tid=157225)



GangZones. - Carlton - 06.07.2010

Ok, the functions in this code do not need to be shown, because it has nothing to do with the problem, the functions work with no problem.

The main objective of what I'm trying to accomplish is making the gang-zones appear. Apparently, that was successful, but it appears to show it 1024 times. Looping doesn't really work like the way the function is reacting. The loop is just showing the gangzones each 1024, when it's supposed to show it once.

Just a notice, that it has nothing to do with the colors, I changed the transparency of the colors, and still failed. The code is below.

pawn Код:
for(new i = 0; i < TOTAL_GANGZONES; i ++ ) {
        if(i >= TOTAL_FACTIONS) break;
        GangZoneShowForPlayer(playerid, GangZoneStructure[i], ConvertZoneColor(FactionData[GangZoneData[i][gzFID]][fAreaColor]));
}



Re: GangZones. - JaTochNietDan - 06.07.2010

What are you trying to do with "break;"? Stop the loop completely or skip the current value and continue on?


Re: GangZones. - Carlton - 06.07.2010

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
What are you trying to do with "break;"? Stop the loop completely or skip the current value and continue on?
What i'm trying to do is not make the loop override the total amount of factions, if it does it will break the loop, even trying to remove that, the problem still occurs.


Re: GangZones. - Betamaster - 06.07.2010

What are the values for TOTAL_GANGZONES and TOTAL_FACTIONS ?


Re: GangZones. - Carlton - 06.07.2010

TOTAL_GANGZONES - 1024
TOTAL_FACTIONS - 50

I only have two gangzones in my database.


Re: GangZones. - Betamaster - 06.07.2010

Quote:
Originally Posted by Carlton
Посмотреть сообщение
Looping doesn't really work like the way the function is reacting. The loop is just showing the gangzones each 1024, when it's supposed to show it once.
With the values you have provided only 50 gang zones will be shown for the player. If your seeing more then this you must be calling the loop more then once.


Re: GangZones. - Carlton - 06.07.2010

Quote:
Originally Posted by Betamaster
Посмотреть сообщение
With the values you have provided only 50 gang zones will be shown for the player. If your seeing more then this you must be calling the loop more then once.
That's the only loop I use with TOTAL_GANGZONES


Re: GangZones. - Carlton - 06.07.2010

This was fixed, the colors has to do something with it.


Re: GangZones. - JaTochNietDan - 06.07.2010

Quote:
Originally Posted by Carlton
Посмотреть сообщение
This was fixed, the colors has to do something with it.
Quote:
Originally Posted by Carlton
that it has nothing to do with the colors
God damnit

Well, glad you got it fixed anyway, sorry I couldn't have offered more help.