#1

How to create for cars a FUEL Like this
Infernius: deasel
Sultan: gas tank
etc.
Reply
#2

Make a variable like

pawn Код:
#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;
}
And then use it as you wish in commands, dialogs, messages...
Reply
#3

thanks for variables,and but how to make a /fill cmd like,/fill in dialog what tank and if the car isn't that tank how to make it ?
+REP for variable
Reply
#4

Well that depends on your fuel systems, I suggest you take an existing one and edit it with the code I gave to you before. To check the car fuel type is easy like:
pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)