CLEO Help [Help] Set Health and Chat Message

CLEO related
Status
Not open for further replies.

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
Hey,
I made this script for SA-MP 0.3z a months back. It's basically a simple script that gives you 99 Health, and then says "Pizza Slice Consumed!", in order to make it real on your screen.

It worked on 0.3z and I don't think it uses Sampfuncs (it might), and now it crashes when I try it on SA-MP 0.3.7.
So could you please take a look at the code and tell me what's wrong?

Code:
{$CLEO .cs}
0AA2: 26@ = load_library "SAMP.DLL"

0000: NOP

:A
wait 0 
if
0AB0:   key_pressed 36 
jf @A
Actor.Health($PLAYER_ACTOR) = 99
0085: 27@ = 26@ // (int) 
27@ += 2173548 
0A8D: 29@ = read_memory 27@ size 4 virtual_protect 1 
0085: 28@ = 26@ // (int) 
28@ += 500976
0AA6: call_method 28@ struct 29@ num_params 5 pop 0 0 -1 0 "Pizza Slice consumed !" 8
wait 2000 
goto @A

Thanks a lot in advance.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Nothing's wrong. Only CHAT INFO OFFSET and FUNCADDTOCHATWND needs to to be updated with the offsets from 0.3.7. I did it for you.

Code:
{$CLEO}

thread "slice"

0AA2: 26@ = load_library "SAMP.DLL"


:A
wait 0 
if
0AB0:   key_pressed 36 
jf @A
Actor.Health($PLAYER_ACTOR) = 99
0085: 27@ = 26@ // (int) 
27@ += 0x21A0E4 
0A8D: 29@ = read_memory 27@ size 4 virtual_protect 1 
0085: 28@ = 26@ // (int) 
28@ += 0x64010
0AA6: call_method 28@ struct 29@ num_params 5 pop 0 0 -1 0 "Pizza Slice consumed !" 8
wait 2000 
goto @A
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
0B36 link said:
Nothing's wrong. Only CHAT INFO OFFSET and FUNCADDTOCHATWND needs to to be updated with the offsets from 0.3.7. I did it for you.

Code:
-snip-

The code works and it's brilliant, but I have one small issue. The text "Pizza Slice Consumed!" is uppercased, because of some weird reason. What is causing this?

PyrYsNg.jpg
 
Status
Not open for further replies.
Top