Fuel system - Group vehicles
#1

Well i have tried making a fuel system by following this tutorial

https://sampforum.blast.hk/showthread.php?tid=169284

It is working fine, just one problem, Group vehicles fuel does not go down it just stays at 100.

I have no idea how to fix this... This is a part of my code to do with entering group vehicles

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        new string[128];
        new PlayerVehicle = GetVehicleFileID(GetPlayerVehicleID(playerid));
        new veh = GetPlayerVehicleID(playerid);
        if(Vehicles[PlayerVehicle][CarGroup] != 0 && Vehicles[PlayerVehicle][CarGroup] != Player[playerid][Group])
        {
            format(string, sizeof(string), "This vehicle is only usable by %s.", Groups[Vehicles[PlayerVehicle][CarGroup]][GroupName]);
            SendClientMessage(playerid, WHITE, string);
            RemovePlayerFromVehicle(playerid);
        }
        if(Vehicles[PlayerVehicle][CarGroup] >= 0 && Vehicles[PlayerVehicle][CarGroup] == Player[playerid][Group])
        {
            new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
            vehicleid = GetPlayerVehicleID( playerid );
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
        }
If you need any more code just ask me

Thank You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)