What is wrong here?

Status
Not open for further replies.
Joined
Feb 12, 2017
Messages
19
Likes
0
Points
1
#1
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 [email protected] pop_event_to [email protected] control_id_to [email protected] [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if [email protected] == 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 [email protected] == 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 [email protected] == 3[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp [email protected] = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "My SA-MP player ID: %d" [email protected][/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if [email protected] == 4[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp [email protected] = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B36: samp [email protected] = get_player_nickname [email protected][/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "hi %s" [email protected][/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 [email protected] pop_event_to [email protected] control_id_to [email protected] [/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if [email protected] == 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 [email protected] == 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 [email protected] == 3[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp [email protected] = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "My SA-MP player ID: %d" [email protected][/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]if [email protected] == 4[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]then[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B2B: samp [email protected] = get_player_id_by_actor_handle $PLAYER_ACTOR[/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]0B36: samp [email protected] = get_player_nickname [email protected][/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]say "hi %s" [email protected][/SIZE][/size][/color]
[color=#2c2c2c][SIZE=3][size=small]end[/SIZE][/size][/color]
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
221
Likes
0
Points
16
Location
Romania
#3
every dialog has is own control id's

try put your code next time in [ shcode=cpp ]code[/shcode] and make it more readable
 
OP
OP
S
Joined
Feb 12, 2017
Messages
19
Likes
0
Points
1
#4
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 [email protected] [email protected]
[email protected] /= 2
[email protected] /= 2
// now in [email protected] and [email protected] screen centure, but need to consider dialog size


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

0B80: dialog [email protected] = create "1"
0B80: dialog [email protected] = create "2"


0B84: dialog [email protected] set_pos_XY 43 235 size 222 141
0B84: dialog [email protected] set_pos_XY 43 380 size 222 141

//ARGB rscos
0B82: dialog [email protected] 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 [email protected] 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 [email protected] add_button id 3 text "Id" pos_XY 0 30 size 100 20
0B82: dialog [email protected] add_button id 4 text "Nick" pos_XY 120 30 size 100 20
0B82: dialog [email protected] add_button id 5 text " 5" pos_XY 0 55 size 100 20
0B82: dialog [email protected] add_button id 6 text "6" pos_XY 120 55 size 100 20
0B82: dialog [email protected] add_button id 7 text "1" pos_XY 0 80 size 220 20
0B91: dialog [email protected] add_static id 8 text "--" pos_XY 20 105 size 220 20

//ARGB rscos
0B82: dialog [email protected] 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 [email protected] 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 [email protected] add_button id 3 text "Id" pos_XY 0 30 size 100 20
0B82: dialog [email protected] add_button id 4 text "Nick" pos_XY 120 30 size 100 20
0B82: dialog [email protected] add_button id 5 text " 5" pos_XY 0 55 size 100 20
0B82: dialog [email protected] add_button id 6 text " 6" pos_XY 120 55 size 100 20
0B82: dialog [email protected] add_button id 7 text "d2" pos_XY 0 80 size 220 20
0B91: dialog [email protected] add_static id 8 text "--" pos_XY 20 105 size 220 20

0B86: dialog [email protected] set_visible 0
0B86: dialog [email protected] set_visible 0



0B34: samp register_client_command "sc" to_label @sc


{
Opcodes to implement:

0B85: dialog [email protected] get_position_to [email protected] [email protected] size_to [email protected] [email protected]

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

0B5E: get_cursor_pos [email protected] [email protected]

0A9F: [email protected] = current_thread_pointer
0C6D: [email protected] = get_thread [email protected] 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 [email protected] to [email protected] and from [email protected] to [email protected] 
end

if key_down 17 
then
gosub @DifferentActivations 
end


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

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