quick vehicel question
#1

just made few things and got a quick question
if i want for all vehicles to save their health and fuel on respawn do i need new enum and PATH for Vehicles(using Y_ini)
or what?
Reply
#2

You can do so:

Код:
#define MAX_VEHS 50 // number of vehicle you want to load from your database.
enum E_VEHICLES
{
      vID,
      vModel,
      .....
      .....
      other staffs vars
      ....
      vFuel,
      vHeal
}
new VehicleInfo[MAX_VEHS][E_VEHICLES];


forward LoadVehicle();
public LoadVehicle();
{
    //Here you load your info from your database using vars from E_VEHICLES enum. Ex: VehicleInfo[v][vHeal] = ....;
    return 1;
}

public OnGamemodeInit()
{
     //Here you made the connection of your database.

     //Here you load vehicle infos.
     LoadVehicle();
     return 1;
}
public OnVehicleSpawn(vehicleid)
{
     new Float: vHP;
     GetVehicleHealth(vehicleid, vHP)
     ....other staffs....
     VehicleInfo[vehicleid][vHeal] = vHP;
     return 1;
}
Reply
#3

Tnx bro.
Btw i know how to make enums i made 5 of those xD.
I just ask do i need to make another one bcz i didnt need it until now. Xd thanks
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)