CLEO Help Help me to learning CLEO

CLEO related
Status
Not open for further replies.

Monstercat

Well-known member
Joined
Feb 26, 2013
Messages
281
Reaction score
5
Hey, I'm a real beginner in CLEO^^
But I am really interested to learn it.
Sometimes i look at a Script an try to configure out how it works...
Now i try to make a "1 - DIALOG_STYLE_INPUT"
Then I want the get value in a function

I know that i need:

Code:
:NONAME_?? 
else_jump @NONAME_?? 
SAMP.ShowDialog(2, "Test", "Testing", "OK", "", 1)
jump @NONAME_??

I hope that someone can explain that :D :D:D
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Well first make the dialog with text input.

Code:
:DIALOG
wait 0 ms 
if and
056D: actor $PLAYER_ACTOR defined
0AB0: 49 // activation key
jf @DIALOG 
0B3B: samp show_dialog id 2 caption "DIALOG" text "Ammo" button_1 "Ok" button_2 "" style 1
0AC8: 3@ = allocate_memory_size 128
jump @Ammo

Then the code and the condition to see if you pressed OK or CANCELED.

Code:
:Ammo
wait 0 ms 
if 
0B3C: samp dialog_respond 0@ button 1@ list_item 2@ input_text 3@ 
jf @Repeat 
if 
0@ == 2 
jf @Repeat 
if 
1@ == 1 
jf @END
0AD4: 1@ 3@ format "%d" 4@  // %d = numbers, %s = text. Change it if you want to display a text or something.
// your code here i made one to give you desert eagle with ammo entered in dialog.

0247: load_model #DESERT_EAGLE 
01B2: give_actor $PLAYER_ACTOR weapon 24 ammo 4@ // 4@ = text input from dialog. 
0249: release_model #DESERT_EAGLE 

// 
0AC9: free_allocated_memory 3@
jump @DIALOG 

:END
if 
1@ == 2 
jf @Repeat 
jump @DIALOG 

:Repeat
jump @Ammo
 
Status
Not open for further replies.
Top