Only the first GangZone gets shown
#1

I'm having problems showing up all of my gangzones, this is my complete code.

Ontop:
pawn Код:
#define MAX_ZONES 14

enum zInfo
{
    zID,
    zOwner[MAX_PLAYER_NAME],
    zColor,
    Float:zMinX,
    Float:zMinY,
    Float:zMaxX,
    Float:zMaxY
};
new TurfInfo[MAX_ZONES][zInfo];
Under OnGameModeInit():
pawn Код:
LoadZones();
    for(new i = 0; i < MAX_ZONES; i++)
    {
        TurfInfo[i][zID] = GangZoneCreate(TurfInfo[i][zMinX], TurfInfo[i][zMinY], TurfInfo[i][zMaxX], TurfInfo[i][zMaxY]);
    }
Under OnPlayerSpawn:
pawn Код:
for(new i = 0; i < sizeof(TurfInfo); i++)
    {
        //GangZoneShowForPlayer(playerid, TurfInfo[i][zID], TurfInfo[i][zColor]);
        GangZoneShowForAll(TurfInfo[i][zID], TurfInfo[i][zColor]);
        return 1;
    }
zones.cfg file:
Код:
0|Max_Pegaz|-16777046|1570.448|-1875.704|1690.448|-1739.704
1|Anthony_Dinozo|-16777046|1825.708|-1750.933|1937.708|-1622.934
2|Max_Pegaz|-16777046|2213.031|-1732.393|2621.031|-1580.393
As the topic says, when I go ingame, only the first gangzone shows up.
I've debugged the onplayerspawn thingie, and this showed up in server console:
Код:
[DEBUG]OnPlayerSpawn: turf id 0 shown. color -16777046
Seems the problem is in the loop, it only loops through the first zone id.
Help is appreciated.
Reply
#2

you're stopping the loop after it's only shown 1 zone
Код:
for(new i = 0; i < sizeof(TurfInfo); i++)
	{
		//GangZoneShowForPlayer(playerid, TurfInfo[i][zID], TurfInfo[i][zColor]);
		GangZoneShowForAll(TurfInfo[i][zID], TurfInfo[i][zColor]);
		return 1;
	}
just remove the return 1; and put it underneath

Код:
for(new i = 0; i < sizeof(TurfInfo); i++)
	{
		//GangZoneShowForPlayer(playerid, TurfInfo[i][zID], TurfInfo[i][zColor]);
		GangZoneShowForAll(TurfInfo[i][zID], TurfInfo[i][zColor]);
		
	}
return 1;
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)