mysql_function_query( dbHandle,"SELECT * FROM db_interiors", true, "CheckInterior", "" );
function CheckInterior() {
new
rows,
fields;
cache_get_data( rows, fields );
if( !rows )
{
print( "[WARNING][MySQL] Nije moguce pronaci podatke za Interiore!( no interiors )" );
}
else
{
InteriorInfo[ rows ][ iVirtualWorld ] = cache_get_field_content_int( 0, "iVirtualWorld" );
InteriorInfo[ rows ][ iType ] = cache_get_field_content_int( 0, "iType" );
InteriorInfo[ rows ][ iX ] = cache_get_field_content_float( 0, "iX" );
InteriorInfo[ rows ][ iY ] = cache_get_field_content_float( 0, "iY" );
InteriorInfo[ rows ][ iZ ] = cache_get_field_content_float( 0, "iZ" );
AddStaticPickup( INTERIOR_PICKUP, INTERIOR_PICKUP_TYPE, InteriorInfo[ rows ][ iX ], InteriorInfo[ rows ][ iY ], InteriorInfo[ rows ][ iZ ], INTERIOR_PICKUP_VIRTUAL_WORLD );
}
return true;
}
Mh, you should specifiy an individual ID for every interior and then load it through a loop, something like CheckInterior(interiorid).
The mysql query has to be "SELECT * FROM db_interiors WHERE id = %d" in a for-loop, where the %d is replaced by i from the loop (the unique interior ID) |
if( !rows )
{
print( "[WARNING][MySQL] Nije moguce pronaci podatke za Interiore!( no interiors )" );
}
else
{
for(new i; i < rows; i++)
{
InteriorInfo[ i ][ iVirtualWorld ] = cache_get_field_content_int( i, "iVirtualWorld" );
InteriorInfo[ i ][ iType ] = cache_get_field_content_int( i, "iType" );
InteriorInfo[ i ][ iX ] = cache_get_field_content_float( i, "iX" );
InteriorInfo[ i ][ iY ] = cache_get_field_content_float( i, "iY" );
InteriorInfo[ i ][ iZ ] = cache_get_field_content_float( i, "iZ" );
AddStaticPickup( INTERIOR_PICKUP, INTERIOR_PICKUP_TYPE, InteriorInfo[ i ][ iX ], InteriorInfo[ i ][ iY ], InteriorInfo[ i ][ iZ ], INTERIOR_PICKUP_VIRTUAL_WORLD );
}
}