Two things I need help with
#4

This should cover your /engineon and /engineoff commands;

pawn Код:
new IsEngineOn[MAX_VEHICLES];

CMD:engine(playerid, params[])
{
    new vehicle, string[128], engine, lights, alarm, doors, bonnent, boot, objective;
    vehicle = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnent, boot, objective);
    if(!IsPlayerInAnyVehicle(playerid))
        {
        SendClientMessage(playerid, COLOR_RED, "You are not in any vehicle!");
        return 1;
        }
    if(IsEngineOn[vehicle] == 0)
        {
        SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnent, boot, objective);
        IsEngineOn[vehicle] = 1;
        format(string, sizeof(string), "%s puts their keys in the ignition and starts the car.", GetName(playerid));
        }
    else if(IsEngineOn[vehicle] == 1)
        {
        SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnent, boot, objective);
        IsEngineOn[vehicle] = 0;
        format(string, sizeof(string), "%s takes their keys out of the ignition and shuts off the car.", GetName(playerid));
        }
    ProxDetector(30, playerid, string, COLOR_PURPLE);
    return 1;
}
Best regards,
Jesse
Reply


Messages In This Thread
Two things I need help with - by Chenko - 24.05.2012, 23:57
Re: Two things I need help with - by miokie - 25.05.2012, 00:00
Re: Two things I need help with - by Chenko - 25.05.2012, 00:02
Re: Two things I need help with - by jessejanssen - 25.05.2012, 00:39
Re: Two things I need help with - by Chenko - 25.05.2012, 02:14
Re: Two things I need help with - by Connorlolz - 25.05.2012, 02:16

Forum Jump:


Users browsing this thread: 1 Guest(s)