30.04.2017, 19:49
Hello there i made some HQ's for Gangs but i want that checkpoints position in the front of the building where will be the HQ enter to load from database. I made already everything and
in the console says: Loaded x headquarters (15 at me).
Here is the photo:
I'll paste here the function that loads from database the HQ's:
Database `headquarters` table:
Also in the past i made the same operation but not with MySQL i just made a variable, ex: new gHq[ 16 ];
Than i created the Dynamic CP on the "OnGameModeInit" public just like this:
and it worked. I wanted to change from this to MySQL because i like more to use
with MySQL almost for everything can u help me with that problem ? Thx.
in the console says: Loaded x headquarters (15 at me).
Here is the photo:
I'll paste here the function that loads from database the HQ's:
PHP код:
function LoadGangHq( )
{
new x_rows, x;
cache_get_row_count( x_rows );
for( new i = 0; i < x_rows; i ++ )
{
cache_get_value_int( i, "ID", x );
cache_get_value_float( i, "hqX", gTeamHq[ x ][ hqX ] );
cache_get_value_float( i, "hqY", gTeamHq[ x ][ hqY ] );
cache_get_value_float( i, "hqZ", gTeamHq[ x ][ hqZ ] );
gHQ[ x ] = CreateDynamicCP( gTeamHq[ x ][ hqX ], gTeamHq[ x ][ hqY ], gTeamHq[ x ][ hqZ ], 1.0, 0, 0 );
}
printf( "Loaded %d headquarters.", x_rows );
return 1;
}
Also in the past i made the same operation but not with MySQL i just made a variable, ex: new gHq[ 16 ];
Than i created the Dynamic CP on the "OnGameModeInit" public just like this:
PHP код:
gHq[ 0 ] = CreateDynamiCP( x, y, z, size, world, interior, .... );
gHq[ 1 ] = CreateDynamiCP( x, y, z, size, world, interior, .... );
gHq[ 2 ] = CreateDynamiCP( x, y, z, size, world, interior, .... );
.
.
.
gHq[ 14 ] = CreateDynamiCP( x, y, z, size, world, interior, .... );
with MySQL almost for everything can u help me with that problem ? Thx.