How i can make engine on/off commands
#1

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

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;
}
Reply
#3

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)