SA-MP Forums Archive
How i can make engine on/off commands - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How i can make engine on/off commands (/showthread.php?tid=394642)



How i can make engine on/off commands - Hugoca - 23.11.2012

Hi.I need command engine on/off and lights on/off.Thanks


Re: How i can make engine on/off commands - Mr.Anonymous - 23.11.2012

Modify as you need.

Engine ON command
pawn Код:
COMMAND:engineon(playerid, params[])
{
    // Setup local variables
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;

    // Get the player's vehicle
    vehicleid = GetPlayerVehicleID(playerid);

    // Get the current status of the vehicle
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

    // Set the engine and lights ON
    SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);

    return 1;
}
Engine OFF command
pawn Код:
COMMAND:engineoff(playerid, params[])
{
    // Setup local variables
    new vehicleid, engine,lights,alarm,doors,bonnet,boot,objective;

    // Get the player's vehicle
    vehicleid = GetPlayerVehicleID(playerid);

    // Get the current status of the vehicle
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);

    // Set the engine and lights OFF
    SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);

    return 1;
}



Re: How i can make engine on/off commands - Hugoca - 23.11.2012

Thanks