/engine
#6

Well if you're sure about using strcmp....
pawn Код:
if(!strcmp(cmdtext,"/engine",true,7))
{
    new vehicleid = GetPlayerVehicleID(playerid);
    if(!vehicleid) return SendClientMessage(playerid,0xFF0000FF,"You must be in a vehicle!");
    // You might want to add an exception to vehicles without an engine, for example bikes.
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(engine != VEHICLE_PARAMS_ON)
    {
         SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
         SendClientMessage(playerid,0x00FF00FF,"The engine is now running");
    }
    else
    {
         SetVehicleParamsEx(vehicleid, VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
         SendClientMessage(playerid,0x00FF00FF,"The engine is stopped");
     }
}
Note that before using SetVehicleParamsEx function all values will be VEHICLE_PARAMS_UNSET(-1).
Reply


Messages In This Thread
/engine - by EgyptForLife - 08.09.2014, 17:48
Re: /engine - by dusk - 08.09.2014, 17:52
Re: /engine - by DaniceMcHarley - 08.09.2014, 17:54
Re: /engine - by EgyptForLife - 08.09.2014, 17:57
Re: /engine - by CutX - 08.09.2014, 18:09
Re: /engine - by dusk - 08.09.2014, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)