CLEO Help Help my game crashes from my cleo that i made

  • Thread starter Deleted member 65633
  • Start date
CLEO related
D

Deleted member 65633

Guest
Guys so i made something like a "keybinder" for samp and its cleo. But when i run samp on server, it stays on loading screen for seconds and then crashes.I know there is programs but i want cleo. This is my code:


Code:
{$CLEO .cs}
0000:

while true
wait 0

if
key_down Num1
then
0AF9: samp say_msg "/usedrug weed"
wait 500
end

if
key_down Num2
then
0AF9: samp say_msg "/usedrug heroin"
wait 500
end

if
key_down Num5
then
0AF9: samp say_msg "/ramping"
wait 500
end

if
key_down Num6
then
0AF9: samp say_msg "/healme"
wait 500
end

if
key_down Num7
then
0AF9: samp say_msg "/bcase get weed 2"
wait 500
end

if
key_down Num8
then
0AF9: samp say_msg "/bcase get heroin 2"
wait 500
end

if
key_down Num9
then
0AF9: samp say_msg "/invisible"
wait 500
end

if
key_down Num+
then
0AF9: samp say_msg "/bcase hold left"
wait 500
end

if
key_down Num-
then
0AF9: samp say_msg "/bcase hide"
wait 500
end
If u can just fix it for me like change the code and give it here i will be so happy!
 
Last edited by a moderator:
D

Deleted member 65633

Guest
i changed it like this it loads in the game, loads in the server but when i press like my key it doesnt type anything, please help [RP]Foolish
Code:
{$CLEO .cs}
0000:

while true
wait 0

if
key_down 96
then
0AF9: samp say_msg "/jetpack"
wait 500
end

if
key_down 97
then
0AF9: samp say_msg "/usedrug weed"
wait 500
end

if
key_down 98
then
0AF9: samp say_msg "/usedrug heroin"
wait 500
end

if
key_down 101
then
0AF9: samp say_msg "/ramping"
wait 500
end

if
key_down 102
then
0AF9: samp say_msg "/healme"
wait 500
end

if
key_down 103
then
0AF9: samp say_msg "/bcase get weed 2"
wait 500
end

if
key_down 104
then
0AF9: samp say_msg "/bcase get heroin 2"
wait 500
end

if
key_down 105
then
0AF9: samp say_msg "/invisible"
wait 500
end

if
key_down 107
then
0AF9: samp say_msg "/bcase hold left"
wait 500
end

if
key_down 109
then
0AF9: samp say_msg "/bcase hide"
wait 500
end
end
 
D

Deleted member 65633

Guest
try w/ this opcode
0AB0: key_pressed 96
Ok so the game loaded but when I click the key like i added the 0AB0: for every key_pressed and when i click my key nothing happens.... If u have time to code it fully for me that would be great. Or just do only 1 command and I will do the others mine.
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
Ok so the game loaded but when I click the key like i added the 0AB0: for every key_pressed and when i click my key nothing happens.... If u have time to code it fully for me that would be great. Or just do only 1 command and I will do the others mine.
I can make it but it would be good if you check why your cleo compilation is not working correctly

1. Your samp has SAMPFUNCS? (because 0AF9: only works when u have it)
2. Your Sanny Builder has Sampfuncs Data? (because 0AF9: only compile correctly if u have it): Check how to install here (Parazitas)
3. In your Sanny Builder Configuration, check if Case Converting is "As is", for default SannyBuilder set it to UPPER, like in the image:



4.I attached the cleo here, I tested it using SAMPFUNCS. in ugbase server, and it worked perfectly.
 

Attachments

  • keybinds.cs
    18.4 KB · Views: 13
  • formats-en.png
    formats-en.png
    13.2 KB · Views: 11
D

Deleted member 65633

Guest
Oh bro when i changed it to as is and load in server the textures were like idk glitching maybe, now i will test this one also if you have source this will be good
 
D

Deleted member 65633

Guest
bro thanks it works, do you have discord, cuz i want to add some whitelist system like not password, just nick like if people use the nick i write in the cleo file that they connect to server only to work like this, ex. if i add excelds on whitelist, and they dont use excelds, they use jukcel i want it to not work when they dont use the nick from whitelist. Idk if you can understand me :D
 

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
Oh bro when i changed it to as is and load in server the textures were like idk glitching maybe, now i will test this one also if you have source this will be good
and you have Sampfuncs Data installed in your SannyBuilder? ..
the source code is the same, like I said, the problem is when u compile it:


PHP:
{$CLEO .cs}
0000:

WHILE TRUE
WAIT 0
    if 0AB0: key_pressed 96 //NUMPAD 0
    then
        0AF9: samp say_msg "/jetpack"
        wait 500
    end
    
    if 0AB0: key_pressed 97 //NUMPAD 1
    then
        0AF9: samp say_msg "/usedrug weed"
        wait 500
    end
    
    if 0AB0: key_pressed 98 //NUMPAD 2
    then
    0AF9: samp say_msg "/usedrug heroin"
    wait 500
    end
    
    if 0AB0: key_pressed 101 //NUMPAD 5
    then
        0AF9: samp say_msg "/ramping"
        wait 500
    end
    
    if 0AB0: key_pressed 102 //NUMPAD 6
    then
        0AF9: samp say_msg "/healme"
        wait 500
    end
    
    if 0AB0: key_pressed 103 //NUMPAD 7
    then
        0AF9: samp say_msg "/bcase get weed 2"
        wait 500
    end
    
    if 0AB0: key_pressed 104 //NUMPAD 8
    then
        0AF9: samp say_msg "/bcase get heroin 2"
        wait 500
    end
    
    if 0AB0: key_pressed 105 //NUMPAD 9
    then
        0AF9: samp say_msg "/invisible"
        wait 500
    end
    
    if 0AB0: key_pressed 107 //NUMPAD +
    then
        0AF9: samp say_msg "/bcase hold left"
        wait 500
    end
    
    if 0AB0: key_pressed 109 //NUMPAD -
    then
        0AF9: samp say_msg "/bcase hide"
        wait 500
    end
END
 
D

Deleted member 65633

Guest
idk if the error was like your is like if 0AB0: key_pressed 109 etc.
and mine was
if
0AB0: key_pressed 107 etc.

but when i tried your script and it compiled it so i think that was beacuse i didnt write it in the correct place.
 
Last edited by a moderator:

[RP]Foolish

Active member
Joined
Mar 18, 2020
Messages
68
Reaction score
36
Location
sea
idk if the error was like your is like if 0AB0: key_pressed 109 etc.
and mine was
if
0AB0: key_pressed 107 etc.

but when i tried your script and it decompiled it so i think that was beacuse i didnt write it in the correct place.
nah, the two ways is correct

PHP:
if condition
then
end
or

PHP:
if
    condition
then
end
 
Top