CLEO Help Set health by command

CLEO related
Status
Not open for further replies.

Jik ke

Active member
Joined
Jun 2, 2021
Messages
43
Reaction score
2
Location
America
Hello guys, I'm Jik ke. I came here to ask for help with cleo SAMP 0.3DL. This cleo is working: use the command /sh (number) then it will run the program below and set health to the number entered in /sh. But why isn't it working? Please help me fix it
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{$CLEO .cs}

0000: NOP
wait 8500
while true
wait 0
if and
0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
0AD4: 4@ = scan_string 1@ format "/sh %d" 9@ // IF and SET
then
Actor.health($PLAYER_ACTOR) = 9@
0A8C: write_memory 1@ size 1 value 0 virtual_protect 0 // clear last entered text
end
end

:GetLastSentTextFromChatBox
{
0.3.DL
0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then
0A8E: 3@ = 2@ + 0x2ACA14
0A8D: 3@ = readMem 3@ sz 4 vp 0
0A8E: 4@ = 3@ + 0x14E5 // command
0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
According to this tutorial, doing AND and OR Logical Condition towards an SCM Function(0AB1) and any other boolean Opcodes does not properly override to each other. Always isolate Boolean SCM Function among other boolean opcodes.
Code:
{$CLEO .cs}
0000:

wait 8500
while true
 wait 0
 if 0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
 then
  if 0AD4: 4@ = scan_string 1@ format "/sh %d" 9@ // IF and SET
  then
   Actor.health($PLAYER_ACTOR) = 9@
   0A8C: write_memory 1@ size 1 value 0 virtual_protect 0 // clear last entered text
  end
 end
end

:GetLastSentTextFromChatBox
 {
  0.3.DL
  0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
 }
 if 0AA2: 2@ = "samp.dll"
 then
  0A8E: 3@ = 2@ + 0x2ACA14
  0A8D: 3@ = readMem 3@ sz 4 vp 0
  0A8E: 4@ = 3@ + 0x14E5 // command
  0A8E: 5@ = 3@ + 0x1565 // text
 end
0AB2: 2 4@ 5@
 

Jik ke

Active member
Joined
Jun 2, 2021
Messages
43
Reaction score
2
Location
America
According to this tutorial, doing AND and OR Logical Condition towards an SCM Function(0AB1) and any other boolean Opcodes does not properly override to each other. Always isolate Boolean SCM Function among other boolean opcodes.
Code:
{$CLEO .cs}
0000:

wait 8500
while true
wait 0
if 0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
then
  if 0AD4: 4@ = scan_string 1@ format "/sh %d" 9@ // IF and SET
  then
   Actor.health($PLAYER_ACTOR) = 9@
   0A8C: write_memory 1@ size 1 value 0 virtual_protect 0 // clear last entered text
  end
end
end

:GetLastSentTextFromChatBox
{
  0.3.DL
  0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then
  0A8E: 3@ = 2@ + 0x2ACA14
  0A8D: 3@ = readMem 3@ sz 4 vp 0
  0A8E: 4@ = 3@ + 0x14E5 // command
  0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
Thanks for the help, but why is this code not working?
 

Au_Phu

Active member
Joined
Jun 20, 2019
Messages
34
Reaction score
2
Location
Nothing
Thanks for the help, but why is this code not working?

Answer: Because commands based on reading your send text from chatbox. Which means.., commands never was registered on server and are unknown..
So.., it is normal when server sending something like that to you. Just ignore and enjoy using IT..
 
Status
Not open for further replies.
Top