Code:
{$CLEO .cs}
0000:
while not SAMP.Available()
wait 50
end
while true
wait 0
if
0B4C: samp is_dialog_active 250
then
alloc 0@ 4096
0BD7: samp get_dialog_text 0@
if
0AD4: $NOT_NEEDED = scan_string 0@ format "Enter %d" 5@
then
alloc 2@ 8
format 2@ "%d" 5@
0B4B: samp set_current_dialog_editbox_text 2@
wait 2000
free 2@
free 5@
0B47: samp close_current_dialog_with_button 0
end
end
end
This is the code. but it doesn`t work!
If we consider that we read this dialog text:
http://ugbase.eu/index.php?attachments/1545651083381-png.5840/
then probably (I don't know if it's for sure, you have to read the text, try to make the mod step by step) when we read the text (Chatmsg %s) it will looks like:
Code:
Are you sure you want to buy Bike (model:509)\nIf yes please type in the box below 'a921z'
Where "\n" means new line.
So now we have to scan the whole text using 0AD4
Code:
0AD4: 4@ = scan_string 0@ format "Are you sure you want to buy %*s (model:%*d)\nIf yes please type in the box below '%s'" 1@v
%*s - dynamic string where it does not need to be copied into a var
%*d - dynamic decimal where it does not need to be copied into a var
1@v - long string (16 chars) (you can't use normal variables where you allocated by your self memory, you will get crash and I have no idea why)