Jump to content

3 Checkboxes, select only 1


DexoTronic

Recommended Posts

Hi,

i have 3 checkboxes, but i want to make it possible to select only 1 checkbox of the 3.

these are the checkboxes:

CbSteine = guiCreateCheckBox(9,166,120,35,"Steine 0.10$/KG",false,false,TruckAufladefenster)

CbRohre = guiCreateCheckBox(9,196,120,35,"Rohre 0.15$/KG",false,false,TruckAufladefenster)

CbWerkzeug = guiCreateCheckBox(9,227,138,35,"Werkzeug 0.20$/KG",false,false,TruckAufladefenster)

now i tried this one(only for the first checkbox, as a test):

function onClickBtn ( button, state )
if (button == "left" and state == "up") then
	if (source == CbSteine ) then
		if (guiCheckBoxGetSelected ( CbSteine ) == true) then
			CheckBoxSetSelected ( CbRohre, false )
			CheckBoxSetSelected ( CbWerkzeug, false )
		end
	end
end
end
 
 
addEventHandler ( "onClientGUIClick", CbSteine , onClickBtn, false )

but it doesnt work :(

anyone knows why?

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...