CLEO Help [CLEO]Help please, i'm just a beginner

CLEO related
Status
Not open for further replies.

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
I tried to create a keybinder myself unfortunately it's giving me errors.
Here is the code
Code:
{$CLEO .cs}
thread 'Test'
:GET_TEXT_FROM_INI_FILE
wait 0
if and
0AF0: 0@ = get_int_from_ini_file "cleo\Keybinder.ini" section "DELAY" key "MILISECONDS"
0AF0: 1@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text1" key "Entertext1" //IF and SET
0AF0: 2@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text2" key "Entertext2" //IF and SET
0AF0: 3@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text3" key "Entertext3" //IF and SET
0AF0: 4@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text4" key "Entertext4" //IF and SET
0AF0: 5@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text5" key "Entertext5" //IF and SET
0AF0: 6@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text6" key "Entertext6" //IF and SET
0AF0: 7@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text7" key "Entertext7" //IF and SET
0AF0: 8@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text8" key "Entertext8" //IF and SET
0AF0: 9@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text9" key "Entertext9" //IF and SET
0AF0: 10@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text10" key "Entertext10" //IF and SET
0AF0: 11@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text11" key "Entertext11" //IF and SET
0AF0: 12@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text12" key "Entertext12" //IF and SET
0AF0: 13@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text13" key "Entertext13" //IF and SET
0AF0: 14@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey1" key "Key1" //IF and SET
0AF0: 15@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey2" key "Key1" //IF and SET
0AF0: 16@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey3" key "Key1" //IF and SET
0AF0: 17@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey4" key "Key1" //IF and SET
0AF0: 18@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey5" key "Key1" //IF and SET
0AF0: 19@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey6" key "Key1" //IF and SET
0AF0: 20@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey7" key "Key1" //IF and SET
0AF0: 21@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey8" key "Key1" //IF and SET
0AF0: 22@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey9" key "Key1" //IF and SET
0AF0: 23@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey10" key "Key1" //IF and SET
0AF0: 24@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey11" key "Key1" //IF and SET
0AF0: 25@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey12" key "Key1" //IF and SET
0AF0: 26@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey13" key "Key1" //IF and SET
else_jump @GET_TEXT_FROM_INI_FILE
    
:MAIN_ACTIVATION
wait 0
if
0AB0:   key_pressed 1
else_jump @MAIN_ACTIVATION
0ACD: show_text_highpriority "~W~Keybinder ~B~by ~G~Test_ ~W~Enabled" time 3000
jump @Test_01
        
:Test_01
wait 0
if
0AB0:   key_pressed 14@
0AFA:   is_samp_structures_available
else_jump @Test_01
0AF9: samp say_msg 1@
wait 0@
jump @Test_01

:Test_02
wait 0
if
0AB0:   key_pressed 15@ 
0AFA:   is_samp_structures_available
else_jump @Test_02
0AF9: samp say_msg 2@
wait 0@
jump @Test_02

:Test_03
wait 0
if
0AB0:   key_pressed 16@
0AFA:   is_samp_structures_available
else_jump @Test_03
0AF9: samp say_msg 3@
wait 0@
jump @Test_03

:Test_04
wait 0
if
0AB0:   key_pressed 17@
0AFA:   is_samp_structures_available
else_jump @Test_04
0AF9: samp say_msg 4@
wait 0@
jump @Test_04

:Test_05
wait 0
if
0AB0:   key_pressed 18@
0AFA:   is_samp_structures_available
else_jump @Test_05
0AF9: samp say_msg 5@
wait 0@
jump @Test_05

:Test_06
wait 0
if
0AB0:   key_pressed 19@
0AFA:   is_samp_structures_available
else_jump @Test_06
0AF9: samp say_msg 6@
wait 0@
jump @Test_06

:Test_07
wait 0
if
0AB0:   key_pressed 20@
0AFA:   is_samp_structures_available
else_jump @Test_07
0AF9: samp say_msg 6@
wait 0@
jump @Test_07

:Test_08
wait 0
if
0AB0:   key_pressed 21@
0AFA:   is_samp_structures_available
else_jump @Test_08
0AF9: samp say_msg 7@
wait 0@
jump @Test_08

:Test_09
wait 0
if
0AB0:   key_pressed 22@
0AFA:   is_samp_structures_available
else_jump @Test_09
0AF9: samp say_msg 8@
wait 0@
jump @Test_09

:Test_10
wait 0
if and
0AB0:   key_pressed 23@
0AFA:   is_samp_structures_available
else_jump @Test_10
0AF9: samp say_msg 9@
wait 0@
jump @Test_10

:Test_11
wait 0
if and
0AB0:   key_pressed 24@
0AFA:   is_samp_structures_available
else_jump @Test_011
0AF9: samp say_msg 10@
wait 0@
jump @Test_011

:Test_012
wait 0
if and
0AB0:   key_pressed 25@
0AFA:   is_samp_structures_available
else_jump @Test_012
0AF9: samp say_msg 11@
wait 0@
jump @Test_012

:Test_013
wait 0
if and
0AB0:   key_pressed 26@
0AFA:   is_samp_structures_available
else_jump @Test_013
0AF9: samp say_msg 12@
wait 0@
jump @Test_013

:DEACTIVATION_CHECK
wait 0
if and
0AB0:   key_pressed 2
else_jump @SELF_ACTIVATION
0ACD: show_text_highpriority "~W~Keybinder ~B~by ~R~Test
_ ~W~is ~B~DISABLED" time 2000
jump @MAIN_ACTIVATION

I got this error "Unknown opcode 0AF0."
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Make sure you have opcodes.txt in you sanny builder data folder. Also, 0AF0 is for integers only, it won't read the text. For text use 0AF4 with long variables.
 

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
Okay i fixed the previous error, now i'm getting this error "Incorrect number of the conditions. 8 max."
Script is still the same
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Why not use this? http://ugbase.eu/releases-6/autocmdsenderv2-0-unlimited-keybinds!/


Code:
{$CLEO .cs}
thread 'Test'

if 0AAB: file_exists "CLEO\Keybinder.ini"
then
0AC8: 1@ = 260
0AC8: 2@ = 260
0AC8: 3@ = 260
0AC8: 4@ = 260
0AC8: 5@ = 260
0AC8: 6@ = 260
0AC8: 7@ = 260
0AC8: 8@ = 260
0AC8: 9@ = 260
0AC8: 10@ = 260
0AC8: 11@ = 260
0AC8: 12@ = 260
0AC8: 13@ = 260
    0AF0: 0@ = get_int_from_ini_file "cleo\Keybinder.ini" section "DELAY" key "MILISECONDS"
    0AF4: 1@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text1" key "Entertext1" 
    0AF4: 2@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text2" key "Entertext2" 
    0AF4: 3@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text3" key "Entertext3" 
    0AF4: 4@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text4" key "Entertext4" 
    0AF4: 5@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text5" key "Entertext5" 
    0AF4: 6@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text6" key "Entertext6" 
    0AF4: 7@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text7" key "Entertext7" 
    0AF4: 8@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text8" key "Entertext8" 
    0AF4: 9@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text9" key "Entertext9" 
    0AF4: 10@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text10" key "Entertext10" 
    0AF4: 11@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text11" key "Entertext11" 
    0AF4: 12@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text12" key "Entertext12" 
    0AF4: 13@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Text13" key "Entertext13" 
    0AF0: 14@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey1" key "Key1" 
    0AF0: 15@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey2" key "Key1" 
    0AF0: 16@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey3" key "Key1" 
    0AF0: 17@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey4" key "Key1" 
    0AF0: 18@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey5" key "Key1" 
    0AF0: 19@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey6" key "Key1" 
    0AF0: 20@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey7" key "Key1" 
    0AF0: 21@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey8" key "Key1" 
    0AF0: 22@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey9" key "Key1" 
    0AF0: 23@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey10" key "Key1" 
    0AF0: 24@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey11" key "Key1" 
    0AF0: 25@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey12" key "Key1" 
    0AF0: 26@ = get_int_from_ini_file "CLEO\Keybinder.ini" section "Hotkey13" key "Key1"
else 004E: end_thread
end 
while true
wait 0
    repeat
    wait 0
    if 0AB0: key_pressed 1
    then 31@ = 1
    0AD1: show_text_highpriority "~W~Keybinder ~B~by ~G~Test_ ~W~Enabled" time 3000
    else
        if 0AB0: key_pressed 2
        then 31@ = 0
        0ACD: show_text_highpriority "~W~Keybinder ~B~by ~R~Test_ ~W~is ~B~DISABLED" time 2000
        end
    end
    until 31@ == 1
if 0AB0: 14@
then 0AF9: samp_say "%s" 1@
    wait 0@
end
if 0AB0: 15@
then 0AF9: samp_say "%s" 2@
    wait 0@
end
if 0AB0: 16@
then 0AF9: samp_say "%s" 3@
    wait 0@
end
if 0AB0: 17@
then 0AF9: samp_say "%s" 4@
    wait 0@
end
if 0AB0: 18@
then 0AF9: samp_say "%s" 5@
    wait 0@
end
if 0AB0: 19@
then 0AF9: samp_say "%s" 6@
    wait 0@
end
if 0AB0: 20@
then 0AF9: samp_say "%s" 7@
    wait 0@
end   
if 0AB0: 21@
then 0AF9: samp_say "%s" 8@
    wait 0@
end   
if 0AB0: 22@
then 0AF9: samp_say "%s" 9@
    wait 0@
end
if 0AB0: 23@
then 0AF9: samp_say "%s" 10@
    wait 0@
end               
if 0AB0: 24@
then 0AF9: samp_say "%s" 11@
    wait 0@
end
if 0AB0: 25@
then 0AF9: samp_say "%s" 12@
    wait 0@
end
END
 

Codex1337

Active member
Joined
Mar 1, 2014
Messages
170
Reaction score
1
Thank you very much, but when i press a button to send command or text it gives me the following error:
Warning(s007): Exception 0xC0000005 in-game.
About the link you send me, it instantly crashes after loading samp before connecting the server
 
Status
Not open for further replies.
Top