Jump to content

Sirene


Recommended Posts

Opa Gostartia De Mudar O Button De Mode para ativar e desativar sirene como posso tar efetuando essa ação tentei por meio dos conhecimento basico que tenho mais consigui não

gui_visible = false
mouse_visible = false

local screenW, screenH = guiGetScreenSize()
giroflexWindow = guiCreateWindow((screenW - 418) / 2, (screenH - 134), 418, 128, "Giroflex", false)

guiWindowSetSizable(giroflexWindow, false)

normalButton = guiCreateButton(16, 28, 122, 38, "Normal", false, giroflexWindow)
setElementData(normalButton, "type", "normal")
stroboButton = guiCreateButton(16, 76, 122, 38, "Strobo", false, giroflexWindow)
setElementData(stroboButton, "type", "strobo")
alternatedButton = guiCreateButton(148, 28, 122, 38, "Alternated", false, giroflexWindow)
setElementData(alternatedButton, "type", "alternated")
otherButton = guiCreateButton(148, 76, 122, 38, "Alternated Strobo", false, giroflexWindow)
setElementData(otherButton, "type", "alternated strobo")
offButton = guiCreateButton(280, 76, 122, 38, "OFF", false, giroflexWindow)
setElementData(offButton, "type", "off")
modeButton = guiCreateButton(280, 28, 122, 38, "MODE: LAMP", false, giroflexWindow)
setElementData(modeButton, "mode", "lamp")

function mode_click(button, state)
	if button == "left" then
		mode = getElementData(source, "mode")
		if mode == "lamp" then
			setElementData(source, "mode", "led")
			guiSetText(modeButton, "MODE: LED")
		else
			setElementData(source, "mode", "lamp")
			guiSetText(modeButton, "MODE: LAMP")
		end
	end
end
addEventHandler("onClientGUIClick", modeButton, mode_click)

 

Observação ele esta sem função nenhuma apenas troca o texto

function bt_click(button, state)
	if button == "left" then
		type = getElementData(source, "type")
		if not type or type == nil then return end
		requestEmerlights(getElementData(modeButton, "mode"), type)
	end
end
addEventHandler("onClientGUIClick", getRootElement(), bt_click)

Logo heim baixo tem essa função mais não entendi direito pra que serve

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...