CLEO Help how to do this

CLEO related
Status
Not open for further replies.

batonkal

Active member
Joined
May 6, 2017
Messages
100
Reaction score
16
Location
Bosnia and Herzegovina
So I wanna do this on a sever:
I press a keybind and it types /service [id] heal 1
I want to input there in [ID] a nearest player's id.
If it's possible please tell me.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
Code:
{$CLEO}
0000:
0B34: "heal" @COMMAND
0@ = 0

:MAIN
wait 0
if
0@ == 1
else_jump @MAIN
if and
056D: actor $PLAYER_ACTOR defined 
key_down 49  //the default key is 1 edit it by yourself from here ''http://ugbase.eu/Thread-All-Virtual-Key-Codes''
jf @MAIN 
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@ 
if 
056D: actor 1@ defined 
jf @MAIN
2@ = SAMP.GetSAMPPlayerIDByActorHandle(1@)
wait 2000
0AF9: samp say_msg "/service %d heal 1" 2@ 
wait 500 
goto @MAIN 

:COMMAND
wait 0
0B12: 0@ = 0@ XOR 1
if
0@ == 0 
then
print "~r~Keybinder deactivated. (0)" 1500
end 
if
0@ == 1 
then
print "~g~Keybinder activated. (1)" 1500
end 
Samp.CmdRet
jump @MAIN
 

batonkal

Active member
Joined
May 6, 2017
Messages
100
Reaction score
16
Location
Bosnia and Herzegovina
Ok, I've made .cs file using Sanny Builder, when I go to play the game it just freezes after the loading bar has reached the end.
I don't know what causes this but I think the opcode OB34 causes it, it is just my guess, please tell me what to change.
Thanks!
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
batonkal said:
Ok, I've made .cs file using Sanny Builder, when I go to play the game it just freezes after the loading bar has reached the end.
I don't know what causes this but I think the opcode OB34 causes it, it is just my guess, please tell me what to change.
Thanks!

do you have sampfuncs? without sf it will crash cuz it has command.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
batonkal said:
I go to the nearest player press 1 and nothing, it doesn't type the command.

idk, its work with /arrest command but in this command, there's a ''heal 1'' after detecting nearest ped. i think this is why it isnt working
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,692
Reaction score
105
Feel free to reverse engineer this for your personal needs.

http://ugbase.eu/Thread-Another-pointless-CnR-cleo

Also I'm pretty sure 0ab5 doesn't work for detecting vehicles but you can still use it to detect peds and get their playerID
 

batonkal

Active member
Joined
May 6, 2017
Messages
100
Reaction score
16
Location
Bosnia and Herzegovina
dVXT1PYmRz_PM_SZI_kdmQ.png

Why does this happen and how to fix it?
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,692
Reaction score
105
Tick "ignore_unkown" in the little cog at the bottom of sannybuilder as ur only gonna be ripping parts of the code and not recompiling the entire thing.
 
Status
Not open for further replies.
Top