[Problem] Dynamic GangZone System
#1

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 cZonenbZones;
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(stringsizeof(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(datafield'|');
         
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=0i<nbZonesi++)
    {
        
GangZoneShowForPlayer(playeridzoneInfo[i][idZone], zoneInfo[i][zCouleur]);
        
printf("Joueur %i - Zone montrйe ID %i - Couleur : %s"playeridzoneInfo[i][idZone], zoneInfo[i][zCouleur]);
        
F(prvMsgsizeof(prvMsg), "Zone ID %i montrйe."zoneInfo[i][idZone]);
        
SCM(playeridORANGEprvMsg);
    }
    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.
Reply
#2

Bump please, i really need your help I don't find any problems
Reply
#3

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
Reply
#4

It's a dynamic system, so the zones are stocked in a database man' ... I can't make that you say, sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)