29.04.2012, 00:32
how do I make all my vehicles off when i enter a vehicle
here is my /engine code:
but when i enter vehicle it is already automatically on. i want it automatically off. how?
here is my /engine code:
pawn Код:
cmd(engine, playerid, params[]) // Engine on/off
{
new engine, lights, alarm, doors, bonnet, boot, objective;
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_CYAN, "[VEHICLE] You have turned off your vehicle");
return 1;
}
SetVehicleParamsEx(vid, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid, COLOR_CYAN, "[VEHICLE] You have turned on your vehicle");
return 1;
}
return SendClientMessage(playerid, COLOR_ERROR, "You must be in a vehicle to use this command.");
}