CLEO Help Dialog problem

CLEO related
Status
Not open for further replies.

hahahafuccoff

Member
Joined
Jun 6, 2018
Messages
16
Reaction score
0
Hi, i am trying to make a little dialog but i am pretty bad at cleo because i am newbie and that's my second one
I don't get what am i making wrong, i need a little help
Well, first of all, afetr i type cheat "xaxa" the dialog shows but i can't see my mouse
Second, if i type xaxa more times, the menu show more times...
3. i don't know how to send a command if i am clicking on buttons, like when i click on button 1 chatmsg "shit1", when i click on button 2 chatmsg "shit2", i will modify it to not "chatmsg", but first of all i need a starting point because i tried a lot but i didn't found shit...
4. i don't know how to close dialog when i click exit......
It's my first dialog and i followed this tutorial:  http://translate.google.com/translate?depth=2&rurl=translate.google.com&sl=ru&tl=en&u=http://blast.hk/wiki/tutorials:dxut_dialogs but it's in russian as you can see, i get how to create buttons, but i don't how to use....
I'll be thankful, sorry for my bad english



{$CLEO .cs}

//-------------MAIN---------------
thread 'DIALOG' 

:DIALOG_1
wait 0 
if 
0ADC:   test_cheat "xaxa" 
else_jump @DIALOG_1

///////MENU\\\\\\\\
0B80: dialog 1@ = create "{00BCFF}text shit"
0B84: dialog 1@ set_pos_XY 570 400 size 250 180
///////SHIT 1\\\\\\\\ 
0B91: dialog 1@ add_static id 1 text "{FF9900}shit 1" pos_XY 10 4 size 100 20
0B82: dialog 1@ add_button id 1 text "{FFFFFF}Use" pos_XY 165 4 size 80 20 
///////SHIT 2\\\\\\\
0B91: dialog 1@ add_static id 2 text "{FF9900}shit 2" pos_XY 10 29 size 100 20
0B82: dialog 1@ add_button id 2 text "{FFFFFF}Use" pos_XY 165 29 size 80 20 
///////SHIT 3\\\\\\\
0B91: dialog 1@ add_static id 3 text "{FF9900}shit 3" pos_XY 10 54 size 100 20
0B82: dialog 1@ add_button id 3 text "{FFFFFF}Use" pos_XY 165 54 size 80 20 
///////SHIT 4\\\\\\\
0B91: dialog 1@ add_static id 4 text "{FF9900}shit 4" pos_XY 10 79 size 100 20
0B82: dialog 1@ add_button id 4 text "{FFFFFF}Use" pos_XY 165 79 size 80 20 
///////EXIT\\\\\\\
0B82: dialog 1@ add_button id 5 text "{FF0000}Exit" pos_XY 80 125 size 90 30 
goto @DIALOG_1
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
use opcode search tool

cursor mode 2 when dialog is on and make sure this is in a loop
cursor mode 0 when you close dialog and make sure you don t add it into a loop otherwise you will fck other dialogs(sv/clientdialogs)

use:

Dialog.Button, Dialog.CheckBox etc just type Dialog. and you l see a lot of shits

how to see when you press a checkbox? easy
Dialog.CheckBoxIsChecked

how to see when you press a button? easy
Dialog.PopEvent(Dialog ID 0@, Event Integer 1@, Control ID 2@)
don t know for sure if this is the correct syntax
1@ is always 257 when you press a button so you don t really have to use it just add -1 to not use your all vars
2@ is your button ID ( Dialog.Button(ID 0, ......) )

example

[shcode=cpp]
if Dialog.PopEvent(0@, -1, 1@)
then
   if 1@ == 0
   then
       do stuff
   end
end
[/shcode]

Use Dialog.SetVisible(dialog id, boolean)
 

hahahafuccoff

Member
Joined
Jun 6, 2018
Messages
16
Reaction score
0
shanker said:
use opcode search tool

cursor mode 2 when dialog is on and make sure this is in a loop
cursor mode 0 when you close dialog and make sure you don t add it into a loop otherwise you will fck other dialogs(sv/clientdialogs)

use:

Dialog.Button, Dialog.CheckBox etc just type Dialog. and you l see a lot of shits

how to see when you press a checkbox? easy
Dialog.CheckBoxIsChecked

how to see when you press a button? easy
Dialog.PopEvent(Dialog ID 0@, Event Integer 1@, Control ID 2@)
don t know for sure if this is the correct syntax
1@ is always 257 when you press a button so you don t really have to use it just add -1 to not use your all vars
2@ is your button ID ( Dialog.Button(ID 0, ......) )

example

[shcode=cpp]
if Dialog.PopEvent(0@, -1, 1@)
then
   if 1@ == 0
   then
       do stuff
   end
end
[/shcode]

Use Dialog.SetVisible(dialog id, boolean)

You're my fucking angel <3
 

_=Gigant=_

Well-known member
Joined
Mar 21, 2017
Messages
353
Reaction score
16
Code:
{$CLEO .cs}
0000:

repeat 
wait 0
until Samp.Available()

32@ = 570
33@ = 400

///////MENU\\\\\\\\
0B80: dialog 1@ = create "{00BCFF}text shit"
0B84: dialog 1@ set_pos_XY 32@ 33@ size 250 180
///////SHIT 1\\\\\\\\ 

Dialog.AddStatic(1@, 999, "{FFFFFF}", 180, -19, 500, 20)

0B91: dialog 1@ add_static id 1 text "{FF9900}shit 1" pos_XY 10 4 size 100 20
0B82: dialog 1@ add_button id 1 text "{FFFFFF}Use" pos_XY 165 4 size 80 20 
///////SHIT 2\\\\\\\
0B91: dialog 1@ add_static id 2 text "{FF9900}shit 2" pos_XY 10 29 size 100 20
0B82: dialog 1@ add_button id 2 text "{FFFFFF}Use" pos_XY 165 29 size 80 20 
///////SHIT 3\\\\\\\
0B91: dialog 1@ add_static id 3 text "{FF9900}shit 3" pos_XY 10 54 size 100 20
0B82: dialog 1@ add_button id 3 text "{FFFFFF}Use" pos_XY 165 54 size 80 20 
///////SHIT 4\\\\\\\
0B91: dialog 1@ add_static id 4 text "{FF9900}shit 4" pos_XY 10 79 size 100 20
0B82: dialog 1@ add_button id 4 text "{FFFFFF}Use" pos_XY 165 79 size 80 20 
///////EXIT\\\\\\\
0B82: dialog 1@ add_button id 5 text "{FF0000}Exit" pos_XY 80 125 size 90 30 

0B86: dialog 1@ set_visible 0

Dialog.AddCheckBox(1@, 1000, "", 225, 135, 130, 25)  //Dialog Movement Box
Dialog.SetCheckBoxColor(1@, 1000, -15952405)

while true
wait 0

if not Dialog.IsVisible(1@)
then
0B9E: dialog 1@ checkbox 1000 set_checked 0
end

0B81: dialog 1@ pop_event_to 2@ control_id_to 3@

if 
0B92: dialog 1@ checkbox 1000 is_checked
then
//move dialog
Dialog.GetRECT(1@, 30@, 31@, 4@, 5@)
0B5E: get_cursor_pos 32@ 33@
000C: 30@ -= 32@
000C: 31@ -= 33@
while 8B81: dialog 1@ pop_event_to $n control_id_to $n
wait 0
0B5E: get_cursor_pos 32@ 33@
000A: 32@ += 30@
000A: 33@ += 31@ 
Dialog.SetRECT(1@, 32@, 33@, 4@, 5@)
end
end

if 3@ == 1
then
chatmsg "shit 1" -1
end

if 3@ == 2
then
chatmsg "shit 2" -1
end

if 3@ == 3
then
chatmsg "shit 3" -1
end

if 3@ == 4
then
chatmsg "shit 4" -1
end

if 3@ == 5
then
0B86: dialog 1@ set_visible 0
SAMP.ToggleCursor(0)
end

alloc 20@ 32
call @GetLocalTime 0 to 29@ 28@ 27@
format 20@ "{68f442}%02d:%02d:%02d" 29@ 28@ 27@
0B94: 1@ 999 set_text 20@
free 20@   

if and
0AB0: 88 //x 
0AB0: 65 //a
then
0B12: 0@ = 0@ XOR 1
if
0@ == 1
then
wait 100
0B86: dialog 1@ set_visible 1
SAMP.ToggleCursor(1)
else
wait 100
0B86: dialog 1@ set_visible 0
SAMP.ToggleCursor(0)
end
end
END

:GetLocalTime
0AA2: 29@ = "kernel32.dll"
0AA4: 28@ = "GetLocalTime" 29@
alloc 27@ 32
0AA5: 28@ 1 0 27@
27@ += 8
0A8D: 26@ = 27@ 2 0
27@ += 2
0A8D: 25@ = 27@ 2 0
27@ += 2
0A8D: 24@ = 27@ 2 0
0AA3: 29@
free 27@
ret 3 26@ 25@ 24@
press x + a to open&close dialog


fixed cursor remove when pressed 'Exit' button
 
Status
Not open for further replies.
Top