CLEO Help What is wrong here?

CLEO related
Status
Not open for further replies.

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
functions on dialog buttons 1 @ go, even if they make another dialog like dialog 2 @ the functions of the first structure go, but the second does not, so to mention, the first structure goes perfectly with any dialogue but the second does not work at all.
Code:
[color=#2c2c2c][SIZE=3][size=small]0B81: dialog 1@ pop_event_to 12@ control_id_to 13@ [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 1 // if control id is 1[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then say "d1"[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 2 // just add this construction with new button id[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then say "2d"[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 3[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "My SA-MP player ID: %d" 12@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 4[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B36: samp 14@ = get_player_nickname 12@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "hi %s" 14@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]

[color=#2c2c2c][SIZE=3][size=small]0B81: dialog 2@ pop_event_to 12@ control_id_to 13@ [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 1 // if control id is 1[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then say "d2"[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 2 // just add this construction with new button id[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then say "2d"[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 3[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "My SA-MP player ID: %d" 12@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if 13@ == 4[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B36: samp 14@ = get_player_nickname 12@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "hi %s" 14@[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
every dialog has is own control id's

try put your code next time in [ shcode=cpp ]code[/shcode] and make it more readable
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
springfield said:
I don't understand anything, and i think nobody else either, else you would have gotten a response until now.


[shcode=cpp]
{$CLEO}
0000:

repeat
wait 100
until SAMP.Available()


0B5A: get_screen_resolution 1@ 2@
1@ /= 2
2@ /= 2
// now in 1@ and 2@ screen centure, but need to consider dialog size


alloc 15@ 100 // array which holds activation keys used in combination with ctrl that toggles each dialog
0C0F: array 15@ element 0 = 49 //used for dialog 1@
0C0F: array 15@ element 1 = 50 // dialog 2@ etc.
0C0F: array 15@ element 2 = 51

0B80: dialog 1@ = create "1"
0B80: dialog 2@ = create "2"


0B84: dialog 1@ set_pos_XY 43 235 size 222 141
0B84: dialog 2@ set_pos_XY 43 380 size 222 141

//ARGB rscos
0B82: dialog 1@ add_button id 1 text "1" pos_XY 0 5 size 100 20 // pos 0 0 - the top left corner of the dialog.
0B82: dialog 1@ add_button id 2 text "2" pos_XY 120 5 size 100 20 // pos 0 0 - the top left corner of the dialog.
0B82: dialog 1@ add_button id 3 text "Id" pos_XY 0 30 size 100 20
0B82: dialog 1@ add_button id 4 text "Nick" pos_XY 120 30 size 100 20
0B82: dialog 1@ add_button id 5 text " 5" pos_XY 0 55 size 100 20
0B82: dialog 1@ add_button id 6 text "6" pos_XY 120 55 size 100 20
0B82: dialog 1@ add_button id 7 text "1" pos_XY 0 80 size 220 20
0B91: dialog 1@ add_static id 8 text "--" pos_XY 20 105 size 220 20

//ARGB rscos
0B82: dialog 2@ add_button id 1 text " 1" pos_XY 0 5 size 100 20 // pos 0 0 - the top left corner of the dialog.
0B82: dialog 2@ add_button id 2 text " 2" pos_XY 120 5 size 100 20 // pos 0 0 - the top left corner of the dialog.
0B82: dialog 2@ add_button id 3 text "Id" pos_XY 0 30 size 100 20
0B82: dialog 2@ add_button id 4 text "Nick" pos_XY 120 30 size 100 20
0B82: dialog 2@ add_button id 5 text " 5" pos_XY 0 55 size 100 20
0B82: dialog 2@ add_button id 6 text " 6" pos_XY 120 55 size 100 20
0B82: dialog 2@ add_button id 7 text "d2" pos_XY 0 80 size 220 20
0B91: dialog 2@ add_static id 8 text "--" pos_XY 20 105 size 220 20

0B86: dialog 1@ set_visible 0
0B86: dialog 2@ set_visible 0



0B34: samp register_client_command "sc" to_label @sc


{
Opcodes to implement:

0B85: dialog 1@ get_position_to 2@ 3@ size_to 4@ 5@

0B8C: samp is_cursor_active
0B8D: samp set_cursor_mode 3
0B8D: samp set_cursor_mode 0

0B5E: get_cursor_pos 1@ 2@

0A9F: 0@ = current_thread_pointer
0C6D: 8@ = get_thread 0@ local_var 1
}


while true
wait 0

if key_down 109 // numpad -
then
if 0B8C: samp is_cursor_active
then
0B5D: samp toggle_cursor 0
else
0B5D: samp toggle_cursor 1
end
wait 700
end

if key_down 1
then 
gosub @MoveDialogUnderCursor // uses variables from 20@ to 31@ and from 0@ to 6@ 
end

if key_down 17 
then
gosub @DifferentActivations 
end


0B81: dialog 1@ pop_event_to 2@ control_id_to 3@ 
if 3@ == 1 // if control id is 1
then say "d1"
end 
if 3@ == 2 // just add this construction with new button id
then say "2d"
end
if 3@ == 3
then
0B2B: samp 2@ = get_player_id_by_actor_handle $PLAYER_ACTOR
say "My SA-MP player ID: %d" 2@
end
if 3@ == 4
then
0B2B: samp 2@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 4@ = get_player_nickname 2@
say "hi %s" 4@
end
end

0B81: dialog 2@ pop_event_to 12@ control_id_to 13@ 
if 13@ == 1 // if control id is 1
then say "d1"
end 
if 13@ == 2 // just add this construction with new button id
then say "2d"
end
if 13@ == 3
then
0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR
say "My SA-MP player ID: %d" 12@
end
if 13@ == 4
then
0B2B: samp 12@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0B36: samp 14@ = get_player_nickname 12@
say "hi %s" 14@
end
[/shcode]
 
Status
Not open for further replies.
Top