09.01.2013, 12:47
How to create for cars a FUEL Like this
Infernius: deasel
Sultan: gas tank
etc.
Infernius: deasel
Sultan: gas tank
etc.
#define DIESEL 1
#define GAS_TANK 2
new FuelType[MAX_VEHICLES];
stock SetFuelTypes()
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(i == 411) return FuelType[i] = DIESEL; // Infernus
if(i == 560) return FuelType[i] = GAS_TANK; // Sultan
}
return 1;
}
public OnGameModeInit()
{
// Rest of your code
SetFuelTypes();
return 1;
}
new carid = GetPlayerVehicleID(playerid);
if(FuelType[carid] == DIESEL) // This is for a Diesel station
{
// Do things
}
else
{
SendClientMessage(playerid, 0xFF0000C8, "This station is only for Diesel cars!");
return 1;
}