CLEO Help samp add_message_to_chat

CLEO related
Status
Not open for further replies.

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
Hi,
I have been trying to fix this bug in very long time but I can't do it, I have tried so much. I want my script to set HP to 98 and also say a text "Hello" but it doesn't do that, it sets the HP but the text is blank, there's an empty line that shows up, like this:

Code:
[18:12:41] 

[18:12:42] 

[18:12:42] 

[18:12:42]

Here's my code:

Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0662: printstring "HP" 

:NONAME_35
wait 0 
if and
   Player.Defined($PLAYER_ACTOR)
0AB0:   key_pressed 36 
else_jump @NONAME_35 
wait 10 
Actor.Health($PLAYER_ACTOR) = 98
0AF8: samp add_message_to_chat "Hello" color 0xCC0000  
wait 2000 
jump @NONAME_35

Anyone know what's the problem?
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
I tried your script and it works for me, be sure you have:
CLEO 4.1
SAMPFUNCS 3.1.2
GTA_SA.EXE V1.0 US
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
Try this, it doesn't need SAMPFUNCS:

Code:
0AA2: 26@ = load_library "SAMP.DLL" // IF and SET 
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 16711680 0 "TROLOLO" 8 
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
m1zg4rd link said:
Try this, it doesn't need SAMPFUNCS:

Code:
0AA2: 26@ = load_library "SAMP.DLL" // IF and SET 
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 16711680 0 "TROLOLO" 8 

How can I change key botton?
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
I installed Sampfunc 3.1.2 and everything you asked me to do. Now I got this crash when I try it.

[10:16:09] ÿÿÿ

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x571A00

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

[10:16:09] Warning(s007): Exception 0xC0000005 at 0x0

How can I fix it?
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
:surprised:
I think SAMPFUNCS doesn't load, it might be blocked by your antivirus or firewall, it happened to me too. Turn them off and try again.
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
TH3RM4L link said:
:surprised:
I think SAMPFUNCS doesn't load, it might be blocked by your antivirus or firewall, it happened to me too. Turn them off and try again.

I don't have an antivirus :/
How can I fix this? :S
 

m1zg4rd_PL

Well-known member
Joined
Jul 19, 2013
Messages
222
Reaction score
0
SiraBots link said:
How can I change key botton?

I don't understand, paste this at the begin of your script:

Code:
0AA2: 26@ = load_library "SAMP.DLL" // IF and SET

and use this code instead of 0AF8:

Code:
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 YOUR_COLOR_CODE 0 "YOUR TEXT HERE" 8

YOUR_COLOR_CODE is hex RGB color (e.g. FF0000) converted from hex to decimal (Converter: http://www.statman.info/conversions/hexadecimal.html)
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
I'm really confused here, haha. Can someone just make me the cleo mod real quick and upload it somewhere? Just a cleo that sets your HP to 98 and gives you a message, "Hello"
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
Okay, here:

{$CLEO .cs}

0000: NOP

:A
wait 0
if
0AB0:  key_pressed 36
jf @A
Actor.Health($PLAYER_ACTOR) = 98
0AF8: samp add_message_to_chat "{0xCC0000}Hello" color 0xFFFFFF 
wait 500
goto @A
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
m1zg4rd link said:
I don't understand, paste this at the begin of your script:

Code:
0AA2: 26@ = load_library "SAMP.DLL" // IF and SET

and use this code instead of 0AF8:

Code:
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 YOUR_COLOR_CODE 0 "YOUR TEXT HERE" 8

YOUR_COLOR_CODE is hex RGB color (e.g. FF0000) converted from hex to decimal (Converter: http://www.statman.info/conversions/hexadecimal.html)

Oh my god, this worked. But the problem is now, my text color is RED and I want it WHITE. I have tried converting it and got 16777215, but it doesn't turn to white when I try it in-game. Can you please convert for me, or tell me how I can get white?

Here's my new code:
Code:
{$CLEO .cs}
0AA2: 26@ = load_library "SAMP.DLL" // IF and SET 

0000: NOP

:A
wait 0 
if
0AB0:   key_pressed 36 
jf @A
Actor.Health($PLAYER_ACTOR) = 98
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 16777215 0 "Pizza Slice consumed !" 8
wait 2000 
goto @A
 

SiraBots

Active member
Joined
Aug 11, 2013
Messages
50
Reaction score
0
Location
Norway
Alright, I got it working with the color. But now a new question, how can I add an animation when I do the cleo mod? Like a crack down anim
 
Status
Not open for further replies.
Top