Vehicle with no fuel
#5

Okay but it still say "write /engine to turn on the engine" if I sit on bike.. :/ this might help you to find problem in script

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid = GetPlayerVehicleID(playerid);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) == NoFuel(vehicleid))
        {
            SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
            return 1;
        }
        if(oldstate-1 && newstate)
        {
            KillTimer(GasTimer[playerid]);
            TextDrawHideForPlayer(playerid, vName[playerid]);
            TextDrawHideForPlayer(playerid, vSpeed[playerid]);
            TextDrawHideForPlayer(playerid, vGear[playerid]);
            TextDrawHideForPlayer(playerid, vHP[playerid]);
            TextDrawHideForPlayer(playerid, vFuel[playerid]);
            TextDrawHideForPlayer(playerid, HP[playerid]);
            TextDrawHideForPlayer(playerid, Speed[playerid]);
            TextDrawHideForPlayer(playerid, Gear[playerid]);
            TextDrawHideForPlayer(playerid, Veh[playerid]);
            TextDrawHideForPlayer(playerid, Fuel[playerid]);
        }
        if(Carinfo[vehicleid][F] < 1)
        {
            TextDrawHideForPlayer(playerid, vName[playerid]);
            TextDrawHideForPlayer(playerid, vSpeed[playerid]);
            TextDrawHideForPlayer(playerid, vGear[playerid]);
            TextDrawHideForPlayer(playerid, vHP[playerid]);
            TextDrawHideForPlayer(playerid, vFuel[playerid]);
            TextDrawHideForPlayer(playerid, HP[playerid]);
            TextDrawHideForPlayer(playerid, Speed[playerid]);
            TextDrawHideForPlayer(playerid, Gear[playerid]);
            TextDrawHideForPlayer(playerid, Veh[playerid]);
            TextDrawHideForPlayer(playerid, Fuel[playerid]);
            SendClientMessage(playerid, COLOR_YELLOW,"{FF0000}INFO: {FFFFFF}This vehicle is out of fuel, buy gas can at any gas station and refuel it.");
            SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
            return 1;
        }
        else if(Carinfo[vehicleid][F] > 1 && vehicleid != NoFuel(GetPlayerVehicleID(playerid)))
        {
            SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}Write {FF6A22}/engine {FFFFFF}to turn on engine.");
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Vehicle with no fuel - by Lajko1 - 11.12.2013, 21:28
Re: Vehicle with no fuel - by Emmet_ - 11.12.2013, 21:39
Re: Vehicle with no fuel - by Lajko1 - 11.12.2013, 22:08
Re: Vehicle with no fuel - by Emmet_ - 11.12.2013, 23:17
Re: Vehicle with no fuel - by Lajko1 - 12.12.2013, 13:08
Re: Vehicle with no fuel - by Emmet_ - 12.12.2013, 16:44
Re: Vehicle with no fuel - by Lajko1 - 12.12.2013, 21:33
Re: Vehicle with no fuel - by Emmet_ - 12.12.2013, 21:37
Re: Vehicle with no fuel - by Lajko1 - 12.12.2013, 22:25

Forum Jump:


Users browsing this thread: 1 Guest(s)