Version Posted March 23, 2025 Posted March 23, 2025 GUIEditor = { checkbox = {}, label = {}, timer = nil } local f1State = false local guiVisible = false addEventHandler("onClientResourceStart", resourceRoot, function() -- Create GUI elements but hide them initially GUIEditor.label[1] = guiCreateLabel(341, 118, 130, 14, "Disable deathmatch", false) GUIEditor.checkbox[1] = guiCreateCheckBox(325, 117, 17, 17, "", false, false) addEventHandler("onClientGUIClick", GUIEditor.checkbox[1], checkBox, false) -- Hide GUI initially guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.checkbox[1], false) I would like to know if someone could help me to make when I activate Disable deathmatch this disabled hydra hunter rhino Rustler so that it cannot shoot when Disable deathmatch is activated I've been trying to make it work but I didn't succeed someone could create it and so it took a weight off my shoulders and thank you very much
Version Posted March 23, 2025 Author Posted March 23, 2025 Someone who can help me make that possible
P[ow]er Posted March 24, 2025 Posted March 24, 2025 GUIEditor = { checkbox = {}, label = {}, timer = nil } local f1State = false local guiVisible = false local deathmatchDisabled = false addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(341, 118, 130, 14, "Disable deathmatch", false) GUIEditor.checkbox[1] = guiCreateCheckBox(325, 117, 17, 17, "", false, false) guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.checkbox[1], false) addEventHandler("onClientGUIClick", GUIEditor.checkbox[1], checkBox, false) end ) function checkBox() deathmatchDisabled = guiCheckBoxGetSelected(GUIEditor.checkbox[1]) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getVehicleController(vehicle) == localPlayer then local model = getElementModel(vehicle) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end addEventHandler("onClientVehicleEnter", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then local model = getElementModel(source) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end) addEventHandler("onClientVehicleExit", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then toggleControl("vehicle_fire", true) end end)
Version Posted June 16, 2025 Author Posted June 16, 2025 On 3/24/2025 at 1:01 AM, P[ow]er said: GUIEditor = { checkbox = {}, label = {}, timer = nil } local f1State = false local guiVisible = false local deathmatchDisabled = false addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(341, 118, 130, 14, "Disable deathmatch", false) GUIEditor.checkbox[1] = guiCreateCheckBox(325, 117, 17, 17, "", false, false) guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.checkbox[1], false) addEventHandler("onClientGUIClick", GUIEditor.checkbox[1], checkBox, false) end ) function checkBox() deathmatchDisabled = guiCheckBoxGetSelected(GUIEditor.checkbox[1]) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getVehicleController(vehicle) == localPlayer then local model = getElementModel(vehicle) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end addEventHandler("onClientVehicleEnter", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then local model = getElementModel(source) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end) addEventHandler("onClientVehicleExit", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then toggleControl("vehicle_fire", true) end end) hello I have been slow to solve it but thanks and sorry for the inconvenience anyway but I wonder this is something very confusing for me it is solved but I don't know if you can solve it because even I can't understand it I can't find a way how to make it work or serve I've tried to feel sometimes and I can't get anything, well what i want to do is that the vehicle_secondary_fire or the vehicle_fire remain locked at and in tons with mouse1 can accelerate as you would with the letter w but players normally but with "mouse1" everyone has it configured like this in nonsense I would like to use mouse1 but taking out that when uploading a plane like hunter rhino hydra is completely disabled all that can only be accelerated freely if you can solve it I am already very confused I am about to stop trying it even if you get to solve it I will try maybe mistakes but I hope not addEventHandler("onClientKey", root, function(button, press) if not getElementData(localPlayer, "invincible") then return end -- Lista de botones que queremos bloquear para evitar disparos local blockedButtons = { ["mouse1"] = true, ["lctrl"] = true, ["rctrl"] = true, ["vehicle_fire"] = true, ["vehicle_secondary_fire"] = true } -- Si el botón está en la lista de bloqueo, cancelamos el evento if blockedButtons[button] then cancelEvent() end end) thanks for everything
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now