From 08e8d15925f0181a29de7a2c70cac7d7b5331773 Mon Sep 17 00:00:00 2001 From: Bluscream Date: Tue, 15 Jun 2021 22:13:05 +0200 Subject: [PATCH 1/4] Add /roof command --- vehicle-control/client.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vehicle-control/client.lua b/vehicle-control/client.lua index 36d929a..6391f61 100644 --- a/vehicle-control/client.lua +++ b/vehicle-control/client.lua @@ -7,6 +7,23 @@ engineoff = false saved = false controlsave_bool = false +-- R O O F -- +RegisterNetEvent('roof') +AddEventHandler('roof',function() + local player = GetPlayerPed(-1) + if (IsPedSittingInAnyVehicle(player)) then + local vehicle = GetVehiclePedIsIn(player,false) + local roofstate = GetConvertibleRoofState(vehicle) + if (roofState == 0) then + LowerConvertibleRoof(vehicle, false) + else if (roofState == 2) + RaiseConvertibleRoof(vehicle, false) + else + ShowNotification("~r~Wait for your roof to be fully extended/retracted") + end + end +end) + -- E N G I N E -- IsEngineOn = true RegisterNetEvent('engine') From d42f4c9baab9c77714e44e043485d864a049fc0f Mon Sep 17 00:00:00 2001 From: Bluscream Date: Tue, 15 Jun 2021 22:14:17 +0200 Subject: [PATCH 2/4] Add /roof command --- vehicle-control/server.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vehicle-control/server.lua b/vehicle-control/server.lua index 7c9dee9..f8c767e 100644 --- a/vehicle-control/server.lua +++ b/vehicle-control/server.lua @@ -1,3 +1,12 @@ +-- R O O F -- +AddEventHandler('chatMessage', function(s, n, m) + local message = string.lower(m) + if message == "/roof" then + CancelEvent() + -------------- + TriggerClientEvent('roof', s) + end +end) -- E N G I N E -- AddEventHandler('chatMessage', function(s, n, m) local message = string.lower(m) @@ -68,4 +77,4 @@ AddEventHandler('chatMessage', function(s, n, m) -------------- TriggerClientEvent('controlsave', s) end -end) \ No newline at end of file +end) From 6719776488cf30d584981a70f899921600ad2b83 Mon Sep 17 00:00:00 2001 From: Bluscream Date: Tue, 15 Jun 2021 22:15:01 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f897334..082bca8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ A simple script which allows you to control certain aspects of your vehicle, such as doors, engine and more... **v0.3.2 Features:** +* **/roof:** Raises and lowers convertible roof. * **/trunk:** Opens and closes the trunk. * **/hood:** Opens and closes the hood. * **/rdoors:** Opens and closes the two rear doors. (Mostly for use in vans) From 703882f0ca9a5236603844d266b017300ed009bc Mon Sep 17 00:00:00 2001 From: "prettifier[bot]" <45367598+prettifier[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 20:15:05 +0000 Subject: [PATCH 4/4] Format 6719776 --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 082bca8..11b89b7 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ # Simple-Vehicle-Control-Script + A simple script which allows you to control certain aspects of your vehicle, such as doors, engine and more... **v0.3.2 Features:** -* **/roof:** Raises and lowers convertible roof. -* **/trunk:** Opens and closes the trunk. -* **/hood:** Opens and closes the hood. -* **/rdoors:** Opens and closes the two rear doors. (Mostly for use in vans) -* **/engine (on/off):** Switches the vehicle engine on and off. -* **/lock:** Locks and unlocks vehicle doors. -* **/save:** (doesn't actually save the vehicle) Selects as the active vehicle. -* **/sveh:** Toggles "control saved vehicle only" mode. (Read changelog for more info) -[Join our discord server!](https://discord.gg/K7P8d2h) --------- +- **/roof:** Raises and lowers convertible roof. +- **/trunk:** Opens and closes the trunk. +- **/hood:** Opens and closes the hood. +- **/rdoors:** Opens and closes the two rear doors. (Mostly for use in vans) +- **/engine (on/off):** Switches the vehicle engine on and off. +- **/lock:** Locks and unlocks vehicle doors. +- **/save:** (doesn't actually save the vehicle) Selects as the active vehicle. +- **/sveh:** Toggles "control saved vehicle only" mode. (Read changelog for more info) + +## [Join our discord server!](https://discord.gg/K7P8d2h) https://forum.fivem.net/t/release-simple-vehicle-control-script/63438