script_name("dialog")
script_version("1")
script_authors("proba")
require "lib.moonloader"
require "lib.sampfuncs"
EVENT_BUTTON_CLICKED = 257
EVENT_COMBOBOX_SELECTION_CHANGED = 513
EVENT_RADIOBUTTON_CHANGED = 769
EVENT_CHECKBOX_CHANGED = 1025
EVENT_SLIDER_VALUE_CHANGED = 1281
EVENT_EDITBOX_STRING = 1537
EVENT_EDITBOX_CHANGE = 1538
EVENT_LISTBOX_ITEM_DBLCLK = 1793
EVENT_LISTBOX_SELECTION = 1794
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
dialog = dxutCreateDialog("test")
dxutSetDialogPos(dialog, 500, 500, 500, 500)
dxutAddStatic(dialog, 1, "test", 0, 0, 170, 30)
dxutAddCheckbox(dialog, 2, "test", 0, 30, 180, 20)
dxutAddCheckbox(dialog, 3, "test", 0, 60, 180, 20)
dxutAddCheckbox(dialog, 4, "test", 0, 90, 180, 20)
dxutAddCheckbox(dialog, 5, "test", 0, 120, 180, 20)
while true do
wait(0)
result, event, id = dxutPopEvent(dialog)
if event == EVENT_CHECKBOX_CHANGED then
if id == 2 then
if dxutIsCheckboxChecked(dialog, 2) then
sampAddChatMessage("Брррр", 0x00DD00)
end
end
end
end
end