Where to add code :/
#6

Is that correct?

pawn Код:
stock NoFuel(playerid)
{
    new V = GetPlayerVehicleID(playerid);
    if(V != 481 || V != 509 || V != 510 || V != 441 || V != 464 || V != 465 || V != 501 || V != 564 || V != 594)
    {
        return 1;
    }
    return 0;
}
and

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 he entered in vehicle and if he is driver
    {
        if(GetPlayerVehicleID(playerid) != NoFuel(vehicleid))
        {
            SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
            return 1;
        }
        if(oldstate-1 && newstate)
        {
            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)
        {
            SendClientMessage(playerid, COLOR_RED,"{FF6A22}INFO: {FFFFFF}Write {FF6A22}/engine {FFFFFF}to turn on engine.");
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
Where to add code :/ - by Lajko1 - 08.12.2013, 22:38
Re: Where to add code :/ - by EmilLykke - 08.12.2013, 23:02
Re: Where to add code :/ - by Padevex - 08.12.2013, 23:54
Re: Where to add code :/ - by Lajko1 - 09.12.2013, 10:30
Re: Where to add code :/ - by newbie scripter - 09.12.2013, 10:51
Re: Where to add code :/ - by Lajko1 - 09.12.2013, 13:14
Re: Where to add code :/ - by newbie scripter - 09.12.2013, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)