16.07.2014, 18:24
I can't understand why , the number of houses and garages is after number of vehicles , but in gamemode is before that , please can you give me the reason ? or a way to fix it ?


Код:
public OnGameModeInit()
{
ClearConsole();
ClearConsole();
ClearConsole();
SQL = mysql_connect( SQL_Adress, SQL_User, SQL_DB, SQL_Pass );
if( SQL == 1 )
{
printf( "(Informatie importanta) Conectiunea la baza de date a reusit! ");
}
else
{
printf( "(Informatie importanta) Conectiunea la baza de date a esuat! ");
GameModeExit();
}
loginstate = 0;
mysql_tquery( SQL, "SELECT * FROM `Houses`", "LOAD_HOUSE", "" );
mysql_tquery( SQL, "SELECT * FROM `garages`", "LoadGarages", "" );
print("- Asteapta un moment , se incarca sistemele dinamice..");
IncarcaBancomatele();
IncarcaTelefoanele();
print("- Toate sistemele dinamice au fost incarcate cu succes");
}
Function LoadGarages( )
{
new
Get[ 2 ] ,
GarageID ;
cache_get_data( Get[ 0 ] , Get[ 1 ] , SQL );
if( !Get[ 0 ] )
return print( "[ > Garages < ]: Nu ai garaje in DB !" );
for( new xRoW; xRoW < Get[ 0 ] ; xRoW++ )
{
TotalGarages++;
GarageID = cache_get_field_content_int( xRoW , "ID" , SQL );
G_DATA[ GarageID ][ gPickSpawn ][ 0 ] = cache_get_field_content_float( xRoW , "X" , SQL );
G_DATA[ GarageID ][ gPickSpawn ][ 1 ] = cache_get_field_content_float( xRoW , "Y" , SQL );
G_DATA[ GarageID ][ gPickSpawn ][ 2 ] = cache_get_field_content_float( xRoW , "Z" , SQL );
G_DATA[ GarageID ][ GarageVW ] = cache_get_field_content_int( xRoW , "GarageVirtual" , SQL );
G_DATA[ GarageID ][ GarageLabel ] = CreateDynamic3DTextLabel( "Garage" , 0xFFFFFFFF , G_DATA[ GarageID ][ gPickSpawn ][ 0 ] , G_DATA[ GarageID ][ gPickSpawn ][ 1 ] , G_DATA[ GarageID ][ gPickSpawn ][ 2 ] , 30.0 , INVALID_PLAYER_ID , INVALID_VEHICLE_ID , 0 , 0 , -1 , -1 , 30.0 );
G_DATA[ GarageID ][ GaragePick ] = CreateDynamicPickup( 1074 , 1 , G_DATA[ GarageID ][ gPickSpawn ][ 0 ] , G_DATA[ GarageID ][ gPickSpawn ][ 1 ] , G_DATA[ GarageID ][ gPickSpawn ][ 2 ], 0, 0, INVALID_PLAYER_ID , 100.0);
G_DATA[ GarageID ][ GarageType ] = cache_get_field_content_int( xRoW , "gType" , SQL );
G_DATA[ GarageID ][ GarageCars ][ 0 ] = cache_get_field_content_int( xRoW , "Car1" , SQL );
G_DATA[ GarageID ][ GarageCars ][ 1 ] = cache_get_field_content_int( xRoW , "Car2" , SQL );
G_DATA[ GarageID ][ GarageCars ][ 2 ] = cache_get_field_content_int( xRoW , "Car3" , SQL );
G_DATA[ GarageID ][ GarageCars ][ 3 ] = cache_get_field_content_int( xRoW , "Car4" , SQL );
cache_get_field_content( xRoW , "GarageOwner" , G_DATA[ GarageID ][ GarageOwner ] , SQL , 24 );
}
return printf( "[*] Garage incarcate - %d" , TotalGarages );
}
Function LOAD_HOUSE( )
{
new
Get[ 2 ] ,
HouseID ;
cache_get_data( Get[ 0 ] , Get[ 1 ] , SQL );
if( !Get[ 0 ] )
return print( "[ > House < ]: Nu ai case in DB !" );
for( new xRoW; xRoW < Get[ 0 ] ; xRoW++ )
{
HouseID = cache_get_field_content_int( xRoW , "ID" , SQL );
H_DATA[ HouseID ][ xHouseSpawn ][ 0 ] = cache_get_field_content_float( xRoW , "HouseSpawnX" , SQL );
H_DATA[ HouseID ][ xHouseSpawn ][ 1 ] = cache_get_field_content_float( xRoW , "HouseSpawnY" , SQL );
H_DATA[ HouseID ][ xHouseSpawn ][ 2 ] = cache_get_field_content_float( xRoW , "HouseSpawnZ" , SQL );
H_DATA[ HouseID ][ xHouseLevel ] = cache_get_field_content_int( xRoW , "HouseLevel" , SQL );
H_DATA[ HouseID ][ xHouseInterior ] = cache_get_field_content_int( xRoW , "HouseIntLevel" , SQL );
H_DATA[ HouseID ][ xHouseOwned ] = cache_get_field_content_int( xRoW , "HouseOwned" , SQL );
H_DATA[ HouseID ][ xHousePrice ] = cache_get_field_content_int( xRoW , "HousePrice" , SQL );
H_DATA[ HouseID ][ Rent ] = cache_get_field_content_int( xRoW , "ForRent" , SQL );
H_DATA[ HouseID ][ xHouseStats ] = cache_get_field_content_int( xRoW , "HouseStats" , SQL );
H_DATA[ HouseID ][ xRentPRICE ] = cache_get_field_content_int( xRoW , "RentPrice" , SQL );
H_DATA[ HouseID ][ xHouseGarageID ] = cache_get_field_content_int( xRoW , "GarageID" , SQL );
H_DATA[ HouseID ][ xHouseHaveGarage ] = cache_get_field_content_int( xRoW , "hGarage" , SQL );
cache_get_field_content( xRoW , "HouseOwner" , H_DATA[ HouseID ][ xHouseOwner ] , SQL , 24 );
HouseLabel( 1 , HouseID );
xTotalHouses ++;
}
return printf( "[*] Case incarcate - %d" , xTotalHouses );
}

