20.02.2019, 05:10
hi, how do I do it, I want to make a static vehicle with the contents of the variable as I wish.
I found some logic, but in my opinion it was lacking, so I asked here.
a little example of the script that I made
well I want to ask, can 99 on the vehstaticspawn variable be changed according to the row in the database?
and at MAX_VEHICLE can I change it according to the row in the database?
just a thought, the usefulness of changing variable content might make my gamemode more efficient
I'm sorry, I use g00gle Translate, if there is a wrong word sorry, thank you
I found some logic, but in my opinion it was lacking, so I asked here.
a little example of the script that I made
PHP код:
new vehstaticspawn[99];
enum E_VEHICLE_STATIC
{
vehstid,
vehstmodel,
vehstposx,
vehstposy,
vehstposz
}
new Vehstatic[MAX_VEHICLE][E_VEHICLE_STATIC];
public LoadVehicleStatic()
{
if(cache_num_rows())
{
for(new a = 1, a < cache_num_rows(); a++)
{
cache_get_index_int(a,0,Vehstatic[a][vehstid]);
cache_get_index_int(a,1,Vehstatic[a][vehstmodel]);
cache_get_index_float(a,2,Vehstatic[a][vehstposx]);
cache_get_index_float(a,3,Vehstatic[a][vehstposy]);
cache_get_index_float(a,4,Vehstatic[a][vehstposz]);
cache_get_index_float(a,5,Vehstatic[a][vehstposa]);
vehstaticspawn[a] = AddStaticVehicle(Vehstatic[a][vehstmodel], Vehstatic[a][vehstposx], Vehstatic[a][vehstposy], Vehstatic[a][vehstposa], 0, 1);
}
}
}
and at MAX_VEHICLE can I change it according to the row in the database?
just a thought, the usefulness of changing variable content might make my gamemode more efficient
I'm sorry, I use g00gle Translate, if there is a wrong word sorry, thank you