cmd:killengine
#4

PHP код:
#define GREY 0xCECECEFF 
PHP код:
new Engine[MAX_VEHICLES], Lights[MAX_VEHICLES]; 
Somewhere in ur script

PHP код:
Engine[vehicleid] = 0;
Lights[vehicleid] = 0
PHP код:
command(engineoffplayeridparams[])//This bit is creating the command
{
    
#pragma unused params
    
if(GetPlayerState(playerid) == 2//This bit is checking the players seat
    
{
        new 
vehicle GetPlayerVehicleID(playerid);
        if(
Engine[vehicle] == 1)
        {
            new 
enginelightsalarmdoorsbonnetbootobjective//Same procedure, this is defining the variables
            
Engine[vehicle] = 0//This bit here, is quite vital. because if you left it at: Engine[vehicle] = 0; Then the vehicle would turn off, then not start again unless respawned.
            
GetVehicleParamsEx(vehicleenginelightsalarmdoorsbonnetbootobjective);//This bit is checking the current status of the vehicles.
            
SetVehicleParamsEx(vehicle0lightsalarmdoorsbonnetboot0);//This bit is setting the engine to be turned off.
        
}
        else return 
SendClientMessage(playeridGREY"This vehicle's engine is already off.");//This will display on the screen if the engine is already off.
    
}
    else return 
SendClientMessage(playeridGREY"You must be in the drivers seat of a vehicle.");//This message will display on the screen if the player doing the command isn't in the drivers seat of a vehicle
    
return 1;

Reply


Messages In This Thread
cmd:killengine - by matthew1211 - 26.01.2014, 15:23
Re : cmd:killengine - by MCZOFT - 26.01.2014, 15:29
Re: cmd:killengine - by matthew1211 - 26.01.2014, 15:34
Re : cmd:killengine - by MCZOFT - 26.01.2014, 15:38
Re: cmd:killengine - by Flake. - 26.01.2014, 15:40

Forum Jump:


Users browsing this thread: 1 Guest(s)