Checking if engine is on or off
#5

This is what i needed to have

pawn Код:
CMD:engine(playerid,params[])
{
    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid, engine,lights,alarm,doors,bonnet,boot,objective);
        SendClientMessage(playerid, -1, "checking if(engine");
        if(engine == 0)
        {
            SetVehicleParamsEx(vehicleid, 1,lights,alarm,doors,bonnet,boot,objective);
            SendClientMessage(playerid, -1, "You turned the key and the engine started.");
        }
        else if(engine == 1)
        {
            SetVehicleParamsEx(vehicleid, 0, lights,alarm,doors,bonnet,boot,objective);
            SendClientMessage(playerid, -1, "You turned the key and turned the engine off.");
        }
         else
        {
             SetVehicleParamsEx(vehicleid, 0, lights,alarm,doors,bonnet,boot,objective);
             SendClientMessage(playerid, -1, "You turned the key and the engine failed to start.");
         }
    }
    else
    {
        SendClientMessage(playerid, -1, "You have to be the driver to start the engine.");
    }
    return 1;
}
Reply


Messages In This Thread
Checking if engine is on or off - by Tom1412 - 16.09.2013, 12:49
Re: Checking if engine is on or off - by Isolated - 16.09.2013, 12:52
Re: Checking if engine is on or off - by Tom1412 - 16.09.2013, 12:57
Re: Checking if engine is on or off - by Isolated - 16.09.2013, 13:08
Re: Checking if engine is on or off - by Tom1412 - 16.09.2013, 14:33
Re: Checking if engine is on or off - by xganyx - 16.09.2013, 14:58

Forum Jump:


Users browsing this thread: 3 Guest(s)