Guest User

Untitled

a guest
Apr 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. function PlayerVehicleStartUp ( Player )
  2.     if (Player.nextStartUp && Player.nextStartUp > CurTime()) then return; end
  3.     if (Player:GetVehicle().IsPassengerSeat) then return; end
  4.    
  5.     local currentVehicle = Player:GetVehicle()
  6.     local vehicleCheck = Player:GetVehicle().vehicleTable;
  7.    
  8.     if currentVehicle:GetTable().Disabled then
  9.         Player:Notify('This vehicle has been disabled in an accident.');
  10.         return;
  11.     end
  12.  
  13.     if (vehicleCheck && vehicleCheck.Script == "veyron") then
  14.         if (!VehicleIgnitionOn) then
  15.             VehicleIgnitionOn = true;
  16.             currentVehicle:EmitSound("perp3.0/vehicle/engine/veyron_ignitionstart.wav", 100, 100);
  17.             currentVehicle:Fire('turnon', '', 3);
  18.             Player.nextStartUp = CurTime() + 4;
  19.         else
  20.             VehicleIgnitionOn = nil;
  21.             currentVehicle:EmitSound("Vehicles/golf/v8_stop1.wav", 100, 100);
  22.             currentVehicle:Fire('turnoff', '', 0);
  23.             Player.nextStartUp = CurTime() + 2;
  24.         end;
  25.     elseif (vehicleCheck && vehicleCheck.Script != "veyron") then
  26.         if (!VehicleIgnitionOn) then
  27.             VehicleIgnitionOn = true;
  28.             currentVehicle:EmitSound("Vehicles/Lambo/Start.wav", 100, 100);
  29.             currentVehicle:Fire('turnon', '', 6);
  30.             Player.nextStartUp = CurTime() + 7;
  31.         else
  32.             VehicleIgnitionOn = nil;
  33.             currentVehicle:EmitSound("Vehicles/golf/v8_stop1.wav", 100, 100);
  34.             currentVehicle:Fire('turnoff', '', 0);
  35.             Player.nextStartUp = CurTime() + 2;
  36.         end;
  37.     end;
  38.    
  39. end;
  40. concommand.Add("perp_v_su", PlayerVehicleStartUp);
Add Comment
Please, Sign In to add comment