[Problem] Dynamic GangZone System -
Sc0tt - 09.05.2014
Hello guys,
I tried to create a dynamic GangZone system but it doesn't work ...
That is why today i ask you to resolve my problem. I specify that i use the plugin mysql R-5 of BlueG.
First, i created this enum :
PHP код:
new cZone, nbZones;
enum zinfo
{
idZone,
Float:minx,
Float:miny,
Float:maxx,
Float:maxy,
zCouleur[32],
};
new zoneInfo[1024][zinfo];
Then, during "
OnGameModeInit() ", i call this function :
PHP код:
forward LoadZones();
public LoadZones()
{
new string[1028];
F(string, sizeof(string), "SELECT * FROM zones");
mysql_query(string);
mysql_store_result();
new row = mysql_num_rows();
if(!row)
{
print("Impossible de rйcuperer les informations de la table \"zones\", raison: Erreur requкte ou table vide...");
mysql_free_result();
return 0;
}
new data[1024], field[6][128];
while(mysql_fetch_row(data))
{
split(data, field, '|');
zoneInfo[cZone][minx] = floatstr(field[1]);
zoneInfo[cZone][miny] = floatstr(field[2]);
zoneInfo[cZone][maxx] = floatstr(field[3]);
zoneInfo[cZone][maxy] = floatstr(field[4]);
F(zoneInfo[cZone][zCouleur], 32, "%s", field[5]);
zoneInfo[cZone][idZone] = GangZoneCreate(zoneInfo[cZone][minx], zoneInfo[cZone][miny], zoneInfo[cZone][maxx], zoneInfo[cZone][maxy]);
printf("Zone ID %i chargйe - Min X : %f - Min Y : %f - Max X : %f - Max Y : %f", zoneInfo[cZone][idZone], zoneInfo[cZone][minx], zoneInfo[cZone][miny], zoneInfo[cZone][maxx], zoneInfo[cZone][maxy]);
cZone++;
}
mysql_free_result();
nbZones = cZone;
printf("Nombre de zones : %i", nbZones);
return 1;
}
Finally, during the "
OnPlayerSpawn() ", i call this function :
PHP код:
forward showGangZone(playerid);
public showGangZone(playerid)
{
for(new i=0; i<nbZones; i++)
{
GangZoneShowForPlayer(playerid, zoneInfo[i][idZone], zoneInfo[i][zCouleur]);
printf("Joueur %i - Zone montrйe ID %i - Couleur : %s", playerid, zoneInfo[i][idZone], zoneInfo[i][zCouleur]);
F(prvMsg, sizeof(prvMsg), "Zone ID %i montrйe.", zoneInfo[i][idZone]);
SCM(playerid, ORANGE, prvMsg);
}
return 1;
}
With the all printf, i note there are no problems, but the gangzones don't displayed in game ...
Would you suggest me solutions to solve this problem ? I can of course give you any logs if you want or any other information.
PS : Sorry for my bad english, and sorry for the french messages.
Re : [Problem] Dynamic GangZone System -
Sc0tt - 09.05.2014
Bump please, i really need your help

I don't find any problems
Re: [Problem] Dynamic GangZone System -
rockhopper - 09.05.2014
Just try all like this EDIT IT IN YOUR WAY WITH THIS FORMAT
Код:
new GZ_ZONE1;
GZ_ZONE1 = GangZoneCreate(YOUR CORDINATES);
GangZoneShowForAll(GZ_ZONE1, 0xFFFFFF96);
MAKE MORE LIKE THIS
PLACE IT UNDER OnPlayerSpawn
Re : [Problem] Dynamic GangZone System -
Sc0tt - 09.05.2014
It's a
dynamic system, so the zones are stocked in a database man' ... I can't make that you say, sorry.