How to use "0ADC: test_cheat"

Hi,

I recieved a PM about a cleo tutorial which shows how to create a simple cleo file that activates when the user typed something on keyboard. So let's do it  :challenge_accepted:

What to do uhm.  :surprised: Oh! , a cleo mod that gives nitro to the car when typed "NOS".

Open Sanny Builder, hit Ctrl + N. Start with this :
Code:
{$CLEO .cs}
Without this the cleo will not work. Then, add name to your cleo file like below :
Code:
thread 'NOS!'
Any name you want.
Now that we wrote this as total :
Code:
{$CLEO .cs}

thread "NOS!"
Now we start scripting. To start, put something that starts with ':', like ':<yourname>_01', ==>
Code:
:MAIN
wait 0
I added "wait 0", because the cleo crashes if i don't use the "wait" command at the beginning. Now, we will put whatever we want. What do we want ? Put nitro to my car. Oh! so we must tell the script to define our current car. To do that we need it's opcode. To get it's opcode, we must search it from opcode list. Open the opcode list with ctlr + alt + 2, and search :
7F1yo.png

03C0: $2197 = actor $PLAYER_ACTOR car
Hmm  :me_gusta: We will use that !
Code:
03C0: $car = actor $PLAYER_ACTOR car
:forever_opcode_alone: but this will crash me if i am not driving a car. So first, we must put a condition for driving, then we must define the car, like this :
Code:
if
00DF:   actor $PLAYER_ACTOR driving
else_jump @MAIN
03C0: $car = actor $PLAYER_ACTOR car
But oh ! We got another condition ! It's "if we typed NOS", so we must do ctrl + alt + 2 again, and then search "test cheat". We will get this
0ADC:  test_cheat "BLOWUP"
, we will use it :ppffh: Like this :
Code:
if and
0ADC:   test_cheat "NOS"
00DF:   actor $PLAYER_ACTOR driving
else_jump @MAIN
Now, the codes look like this :
Code:
{$CLEO .cs}

thread "NOS!"

:MAIN
wait 0
if and
0ADC:   test_cheat "NOS"
00DF:   actor $PLAYER_ACTOR driving
else_jump @MAIN
03C0: $car = actor $PLAYER_ACTOR car
From the beginning till the end, it means, "if i am driving and if i type "NOS" while driving, define my car."
We're on the right way  :iknowwhatyoudid:
Now we gotta put nitro on our car :ppffh:
Let's search on opcode list :
7F24u.png

:motherofgod_ Nothing appeared. Let's search add nitro :ppffh:
7F27P.png

YES! :somuchwin: Let's use it :ppffh:
Code:
09E9: car $car add_single_nitro
So the codes are all like this :
Code:
{$CLEO .cs}

thread "NOS!"

:MAIN
wait 0
if and
0ADC:   test_cheat "NOS"
00DF:   actor $PLAYER_ACTOR driving
else_jump @MAIN
03C0: $car = actor $PLAYER_ACTOR car
09E9: car $car add_single_nitro
jump @MAIN

Type NOS to add nitro always  :forever_hurra:
 

Attachments

  • nos.cs
    17.4 KB · Views: 104

Simon98

Well-known member
Joined
Feb 18, 2014
Messages
287
Reaction score
0
Re: A cleo that works when i type something

HOLY FUCK!!!!
BEST TUT EVER!!  :forever_hurra:
 

YesHax

Member
Joined
Mar 17, 2014
Messages
17
Reaction score
3
Re: A cleo that works when i type something

Best guy i love youuu <3
 

FixmeH

Active member
Joined
Feb 27, 2014
Messages
33
Reaction score
0
Re: A cleo that works when i type something

Cool tutorial which can also teach you how to code some CLEO mods.
 

Felipe Ramos

Active member
Joined
Mar 15, 2014
Messages
33
Reaction score
0
Re: A cleo that works when i type something

Awsome tuto, my respect  :yesyes:
 
Top