Gang Zones
#1

Hi all, maybe somebody knows why my gang zone doesn't showing? Zone coordinates is correct 100%.

Код:
stock CreateGangZone(zoneID, zoneOwner, Float: MinX, Float: MinY, Float: MaxX, Float: MaxY)
{
	HowMuchGangZonesIs ++;

	GangZonesSystem[zoneID][gZoneID] = GangZoneCreate(MinX, MinY, MaxX, MaxY);

	switch(zoneOwner)
	{
		case 1:
		{
			GangZoneShowForAll(GangZonesSystem[zoneID][gZoneID], GANG_ZONE_COLOR_ID_1);
		}

		case 2:
		{
			GangZoneShowForAll(GangZonesSystem[zoneID][gZoneID], GANG_ZONE_COLOR_ID_2);
		}

		case 3:
		{
			GangZoneShowForAll(GangZonesSystem[zoneID][gZoneID], GANG_ZONE_COLOR_ID_3);
		}

		default:
		{
			GangZoneShowForAll(GangZonesSystem[zoneID][gZoneID], 0xFC3A3A96);
		}
	}

	return HowMuchGangZonesIs - 1;
}
Код:
stock LoadAllGangZones()
{
	mysql_query("SELECT * FROM `gaujuzonos`");

	mysql_store_result();

	if(mysql_num_rows())
 	{
 	    new Query[120], GangZoneStr[300], GangZoneID;

 	    while(mysql_fetch_row(Query))
 	    {
 	        mysql_fetch_field_row(GangZoneStr, "gZoneID");		GangZoneID 									= strval(GangZoneStr);
			mysql_fetch_field_row(GangZoneStr, "gZoneOwner"); 	GangZonesSystem[GangZoneID][gZoneOwner] 	= strval(GangZoneStr);
 	        mysql_fetch_field_row(GangZoneStr, "gZoneYield"); 	GangZonesSystem[GangZoneID][gZoneYield] 	= strval(GangZoneStr);
			mysql_fetch_field_row(GangZoneStr, "MinX");  		GangZonesSystem[GangZoneID][gMin_X] 		= floatstr(GangZoneStr);
			mysql_fetch_field_row(GangZoneStr, "MinY"); 		GangZonesSystem[GangZoneID][gMin_Y] 		= floatstr(GangZoneStr);
			mysql_fetch_field_row(GangZoneStr, "MaxX"); 		GangZonesSystem[GangZoneID][gMax_X] 		= floatstr(GangZoneStr);
			mysql_fetch_field_row(GangZoneStr, "MaxY"); 		GangZonesSystem[GangZoneID][gMax_Y] 		= floatstr(GangZoneStr);

			CreateGangZone(GangZoneID, GangZonesSystem[GangZoneID][gZoneOwner], GangZonesSystem[GangZoneID][gMin_X], GangZonesSystem[GangZoneID][gMin_Y], GangZonesSystem[GangZoneID][gMax_X], GangZonesSystem[GangZoneID][gMax_Y]);
 	    }
	}

	return 1;
}
Sor for my bad english.
Reply
#2

bump
Reply
#3

I don't know if that CreateGangZone will work.
How can the zones be created if the zones are not loaded..
IDK i don't know. I just try to help u. Use this and let me know.

Put this in your
PHP код:
public OnGameModeInit( ){
mysql_tqueryyour DB"SELECT * FROM `gaujuzonos`""LoadAllGangZones" );return 1;} 
PHP код:
stock LoadAllGangZones( )
{
    new 
RowsFieldsGang_ID_X;
    
cache_get_dataRowsFieldsyour DB );
    for( new 
0Rows++ )
    {
        
Gang_ID_X cache_get_field_content_inti"gZoneID"your DB );
        
GangZonesSystemGangZoneID ][ gZoneOwner ] = cache_get_field_content_inti"gZoneOwner"your DB );
        
GangZonesSystemGangZoneID ][ gZoneYield ] = cache_get_field_content_inti"gZoneYield"your DB );
        
GangZonesSystemGangZoneID ][ gMin_X ] = cache_get_field_content_inti"MinX"your DB );
        
GangZonesSystemGangZoneID ][ gMin_Y ] = cache_get_field_content_inti"MinY"your DB );
        
GangZonesSystemGangZoneID ][ gMax_X ] = cache_get_field_content_inti"MaxX"your DB );
        
GangZonesSystemGangZoneID ][ gMax_Y ] = cache_get_field_content_inti"MaxY"your DB );
        
        
//GangZonesSystem[ GangZoneID ][ gZoneID ] : i think u have this xD
        
GangZonesSystemGang_ID_X ][ gZoneID ]= GangZoneCreateGangZonesSystemGangZoneID ][ gMin_X ], GangZonesSystemGangZoneID ][ gMin_Y ], GangZonesSystemGangZoneID ][ gMax_X ], GangZonesSystemGangZoneID ][ gMax_Y ] );
        
CreateDynamicRectangleGangZonesSystemGangZoneID ][ gMin_X ], GangZonesSystemGangZoneID ][ gMin_Y ], GangZonesSystemGangZoneID ][ gMax_X ], GangZonesSystemGangZoneID ][ gMax_Y ] );
    }
    
printf"Loaded %d Gang Zones."Rows );
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)