I had my house over 200 in my database and its taking like 5-15 sec to start the server
And when I remove all of my house its look good but they are still slow to run the server
pawn Code:
public LoadProperty()
{
new count_house = 0;
new Cache: rHouse = mysql_query( db_connect, "SELECT * FROM `houses`" );
if( !cache_num_rows() ) return cache_delete( rHouse ), print( "MySQL: No house in database." );
for( new i = 0; i < cache_num_rows(); i++ )
{
cache_get_value_float( i, "EntX", HouseInfo[i][hEntrancex] );
cache_get_value_float( i, "EntY", HouseInfo[i][hEntrancey] );
cache_get_value_float( i, "EntZ", HouseInfo[i][hEntrancez] );
cache_get_value_float( i, "ExtX", HouseInfo[i][hExitx] );
cache_get_value_float( i, "ExtY", HouseInfo[i][hExity] );
cache_get_value_float( i, "ExtZ", HouseInfo[i][hExitz] );
cache_get_value_int( i, "HealX", HouseInfo[i][hHealthx] );
cache_get_value_int( i, "HealY", HouseInfo[i][hHealthy] );
cache_get_value_int( i, "HealZ", HouseInfo[i][hHealthz] );
cache_get_value_int( i, "ArmourX", HouseInfo[i][hArmourx] );
cache_get_value_int( i, "ArmourY", HouseInfo[i][hArmoury] );
cache_get_value_int( i, "ArmourZ", HouseInfo[i][hArmourz] );
cache_get_value( i, "Owner", HouseInfo[i][hOwner], MAX_PLAYER_NAME );
cache_get_value( i, "Desc", HouseInfo[i][hDiscription], MAX_PLAYER_NAME );
cache_get_value_int( i, "Price", HouseInfo[i][hValue] );
cache_get_value_int( i, "Health", HouseInfo[i][hHel] );
cache_get_value_int( i, "Armour", HouseInfo[i][hArm] );
cache_get_value_int( i, "Interior", HouseInfo[i][hInt] );
cache_get_value_int( i, "Locked", HouseInfo[i][hLock] );
cache_get_value_int( i, "Owned", HouseInfo[i][hOwned] );
cache_get_value_int( i, "Rooms", HouseInfo[i][hRooms] );
cache_get_value_int( i, "Rent", HouseInfo[i][hRent] );
cache_get_value_int( i, "Rentable", HouseInfo[i][hRentabil] );
cache_get_value_int( i, "Takings", HouseInfo[i][hTakings] );
cache_get_value_int( i, "Vec", HouseInfo[i][hVec] );
if( HouseInfo[ i ][ hVec ] == 457 ){ HouseInfo[ i ][ hVec ] = 411; }
cache_get_value_int( i, "vCol1", HouseInfo[i][hVcol1] );
cache_get_value_int( i, "vCol2", HouseInfo[i][hVcol2] );
cache_get_value_int( i, "Date", HouseInfo[i][hDate] );
cache_get_value_int( i, "Level", HouseInfo[i][hLevel] );
cache_get_value_int( i, "World", HouseInfo[i][hWorld] );
count_house++;
}
printf( "MySQL: (%d) `houses` succesfuly loaded.", count_house );
cache_delete( rHouse );
return 1;
}
public LoadBizz()
{
new count_bizz = 0;
new Cache: rBizz = mysql_query( db_connect, "SELECT * FROM `bizz`" );
if( !cache_num_rows() ) return cache_delete( rBizz ), print( "MySQL: No business in database." );
for( new i = 0; i < cache_num_rows(); i++ )
{
cache_get_value_float( i, "EntX", BizzInfo[i][bEntranceX] );
cache_get_value_float( i, "EntY", BizzInfo[i][bEntranceY] );
cache_get_value_float( i, "EntZ", BizzInfo[i][bEntranceZ] );
cache_get_value_float( i, "ExtX", BizzInfo[i][bExitX] );
cache_get_value_float( i, "ExtY", BizzInfo[i][bExitY] );
cache_get_value_float( i, "ExtZ", BizzInfo[i][bExitZ] );
cache_get_value_int( i, "Owned", BizzInfo[i][bOwned] );
cache_get_value( i, "Owner", BizzInfo[i][bOwner], MAX_PLAYER_NAME );
cache_get_value( i, "Message", BizzInfo[i][bMessage], MAX_PLAYER_NAME );
cache_get_value( i, "Extortion", BizzInfo[i][bExtortion], MAX_PLAYER_NAME );
cache_get_value_int( i, "Level", BizzInfo[i][bLevelNeeded] );
cache_get_value_int( i, "Price", BizzInfo[i][bBuyPrice] );
cache_get_value_int( i, "EPrice", BizzInfo[i][bEntranceCost] );
cache_get_value_int( i, "Till", BizzInfo[i][bTill] );
cache_get_value_int( i, "Locked", BizzInfo[i][bLocked] );
cache_get_value_int( i, "Interior", BizzInfo[i][bInterior] );
cache_get_value_int( i, "Products", BizzInfo[i][bProducts] );
cache_get_value_int( i, "MaxProducts", BizzInfo[i][bMaxProducts] );
cache_get_value_int( i, "ProductPrice", BizzInfo[i][bPriceProd] );
count_bizz++;
}
printf( "MySQL: (%d) `bizz` succesfuly loaded.", count_bizz );
cache_delete( rBizz );
return 1;
}
public LoadSBizz()
{
new count_sbizz = 0;
new Cache: rSBizz = mysql_query( db_connect, "SELECT * FROM `sbizz`" );
if( !cache_num_rows() ) return cache_delete( rSBizz ), print( "MySQL: No secondary business in database." );
for( new i = 0; i < cache_num_rows(); i++ )
{
cache_get_value_float( i, "EntX", SBizzInfo[i][sbEntranceX] );
cache_get_value_float( i, "EntY", SBizzInfo[i][sbEntranceY] );
cache_get_value_float( i, "EntZ", SBizzInfo[i][sbEntranceZ] );
cache_get_value_int( i, "Owned", SBizzInfo[i][sbOwned] );
cache_get_value( i, "Owner", SBizzInfo[i][sbOwner], MAX_PLAYER_NAME );
cache_get_value( i, "Message", SBizzInfo[i][sbMessage], MAX_PLAYER_NAME );
cache_get_value( i, "Extortion", SBizzInfo[i][sbExtortion], MAX_PLAYER_NAME );
cache_get_value_int( i, "Level", SBizzInfo[i][sbLevelNeeded] );
cache_get_value_int( i, "Price", SBizzInfo[i][sbBuyPrice] );
cache_get_value_int( i, "EPrice", SBizzInfo[i][sbEntranceCost] );
cache_get_value_int( i, "Till", SBizzInfo[i][sbTill] );
cache_get_value_int( i, "Locked", SBizzInfo[i][sbLocked] );
cache_get_value_int( i, "Interior", SBizzInfo[i][sbInterior] );
cache_get_value_int( i, "Products", SBizzInfo[i][sbProducts] );
cache_get_value_int( i, "MaxProducts", SBizzInfo[i][sbMaxProducts] );
cache_get_value_int( i, "ProductPrice", SBizzInfo[i][sbPriceProd] );
count_sbizz++;
}
printf( "MySQL: (%d) `sbizz` succesfuly loaded.", count_sbizz );
cache_delete( rSBizz );
return 1;
}