CLEO Help Message Box Help

CLEO related
Status
Not open for further replies.

KillerZ

Active member
Joined
Apr 6, 2014
Messages
73
Reaction score
0
Can someone tell me what's wrong with my code and how to fix it? The real code doesn't say "stoop", but it's the exact length.

I think it's the string but I really need all that, is there a better way?

This is how it appears:
oOvAviw.png



[shcode=cpp]
{$CLEO}

0000:

:Load
wait 200
if SAMP.Available
else_jump @Load

0B34: samp register_client_command "stoop" to_label @blah

While true
wait 0
0AF0: 25@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "1"
0AF0: 26@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "2"
0AF0: 27@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "3"
0AF0: 28@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "4"
0AF0: 29@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "5"
0AF0: 30@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "6"
0AF0: 31@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "7"
end

:blah
wait 0
0AC8: 24@ = allocate_memory_size 260
0AD3: 24@ = "{FFFFFF}Stoop stoop: {98B0CD}%d %c{FFFFFF}Stoop stoop: {98B0CD}%d %c{FFFFFF}stoop stoop: {98B0CD}.%d %c{FFFFFF}stop stoop: {98B0CD}$%d %c{FFFFFF}stoop stoooop stooop: {98B0CD}%d %c{FFFFFF}stoop stooop: {98B0CD}%d %c{FFFFFF}stp stoop: {98B0CD}%d" 25@ 0xA 26@ 0xA 27@ 0xA 28@ 0xA 29@ 0xA 30@ 0xA 31@
0B3B: samp show_dialog id 10005 caption "stooop stooooooop" text 24@ button_1 "Ok" button_2 "Close" style 0
0AC9: free_allocated_memory 24@
0B43: samp cmd_ret
[/shcode]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I think the text might be too long in the line below
Code:
0AD3: 24@ = "{FFFFFF}Stoop stoop: {98B0CD}%d %c{FFFFFF}Stoop stoop: {98B0CD}%d %c{FFFFFF}stoop stoop: {98B0CD}.%d %c{FFFFFF}stop stoop: {98B0CD}$%d %c{FFFFFF}stoop stoooop stooop: {98B0CD}%d %c{FFFFFF}stoop stooop: {98B0CD}%d %c{FFFFFF}stp stoop: {98B0CD}%d" 25@ 0xA 26@ 0xA 27@ 0xA 28@ 0xA 29@ 0xA 30@ 0xA 31@
I made a simple test with "aa bb cc dd" which worked well and then tried the same with: "aaaaaaaaaaaaaaaa bbbbbbbbbbb cccccccccccccccccccccccccccccccccccccccccccccccccc dddddddddddddddddddddddddddddddddddddddddddddddd eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" and it gave the same result as your text (no text displayed)

btw reading ini in a constant loop may not be the best for the performance (in case if it lags)
 

KillerZ

Active member
Joined
Apr 6, 2014
Messages
73
Reaction score
0
I managed to show the text, I just separated it into many formats. (I'm bad at explaining, sorry :p) Anyways, below is the fixed example code.

[shcode=cpp]
{$CLEO}
 
0000:
 
:Load
wait 200 
if SAMP.Available
else_jump @Load
 
0B34: samp register_client_command "stoop" to_label @blah
 
While true
wait 0
0AF0: 26@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "1"
0AF0: 27@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "2"
0AF0: 28@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "3"
0AF0: 29@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "4"
0AF0: 30@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "5"
0AF0: 31@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "6"
0AF0: 32@ = get_int_from_ini_file "cleo\stoop.ini" section "stoop" key "7"
end
 
:blah
wait 0
0AC8: 9@ = allocate_memory_size 260
0AC8: 10@ = allocate_memory_size 260
0AC8: 25@ = allocate_memory_size 260
0AC8: 24@ = allocate_memory_size 260
0AD3: 9@ = format "{FFFFFF}stoop stoop: {98B0CD}%d%c{FFFFFF}stoop stoop: {98B0CD}%d%c{FFFFFF}stoop stoop: {98B0CD}$%d%c" 26@ 0xA 27@ 0xA 28@ 0xA
0AD3: 10@ = format "{FFFFFF}stop stoop: {98B0CD}$%d%c{FFFFFF}stoop stoooop stooop: {98B0CD}%d%c" 29@ 0xA 30@ 0xA
0AD3: 25@ = format "{FFFFFF}stoop stooop: {98B0CD}%d%c{FFFFFF}stp stoop: {98B0CD}%d" 31@ 0xA 32@ 
0AD3: 24@ = format "%s%s%s" 9@ 10@ 25@
0AC9: free_allocated_memory 9@
0AC9: free_allocated_memory 10@
0AC9: free_allocated_memory 25@
0AC9: free_allocated_memory 24@
0B3B: samp show_dialog id 10002 caption "stooop stooooooop" text 24@ button_1 "OK" button_2 "Close" style 0   
0B43: samp cmd_ret
[/shcode]
 
Status
Not open for further replies.
Top