Simple cleo code

[glow=red,2,300]---------------------------------------------------------------------------------------------------[/glow]

This Tutorial Is Fully By [glow=red,2,300]Mr.Ze[/glow] I'm Just Publishing it To Help Everybody. Mr.Ze Sent This To Me To Help me. And I Want To Help Everybody. I Don't Take Any Credit Of This.

[glow=red,2,300]---------------------------------------------------------------------------------------------------[/glow]


So, CLEO is a simple scripting lang.

The best way you will learn is by looking at the scripts and trying to understand what they do and how they do it.


Good example of a script:

Code:
{$CLEO .cs}

0000: NOP 

:INFINITE_RUN_23
wait 0 
IF AND 
044B:   actor $PLAYER_ACTOR on_foot 
   NOT Actor.Driving($PLAYER_ACTOR)
ELSE_JUMP @INFINITE_RUN_23
Player.InfiniteRun($PLAYER_CHAR) = TRUE
0393: actor $PLAYER_ACTOR perform_animation "SPRINT_CIVI" at 1.15 times_normal_rate 
JUMP @INFINITE_RUN_23

{$CLEO .cs} - This means that when you compile a script, it will compile as a CLEO Script - .cs.

0000: NOP - This is like wait 0, but above the script and the label. It just needs to be there if there isn't anything else, otherwise it could crash.

wait 0 - this is how much time the script will wait until it proceeds further. If set to 0, it won't wait. BUT, you need to have wait 0 there because otherwise the scripts crash for some reason.

:INFINITE_RUN_23 - the label. Everything below it is considered part of it until there is an end, which is either END function or are JUMP.

IF AND
044B:  actor $PLAYER_ACTOR on_foot
NOT Actor.Driving($PLAYER_ACTOR)
- A condition. The condition needs to be fulfilled for script to either proceed or do something. So if player is on foot AND not driving it will do what it says next.

ELSE_JUMP @INFINITE_RUN_23 - This equals to ELSE -> if the condition is not fulfilled, it if it's false; if player is not on foot AND driving, then it will just go back to that label and whole process of checking will start again until player is on foot AND not driving. So the entire time while the script is not activated, it will be just repeating itself checking "Are you on foot, sir? Are you on foot, sir?" and will keep doing it like that.

Player.InfiniteRun($PLAYER_CHAR) = TRUE - Everything after ELSE_JUMP is what will happen if the condition is fulfilled -> it will set infinite run to true.

0393: actor $PLAYER_ACTOR perform_animation "SPRINT_CIVI" at 1.15 times_normal_rate - This means you will perform a "SPRING_CIVI" animation 1.15 times faster than normal, meaning you will run 1.15 times faster than normal.

JUMP @INFINITE_RUN_23 - This is like ELSE_JUMP except it comes at the end of the script. This will do the same effect -> it will go back to the label and whole process will start again just so the script knows when you are no longer on foot AND no longer driving so it can disable infinite run.

That's a simple thing explained in a simple way.

[glow=red,2,300]-Mr.Ze[/glow]
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Simple Tutorial

MR.Ze , how much you paid  him  :dont_care:
 

TheZeRots

Expert
Joined
Dec 21, 2013
Messages
1,247
Reaction score
1
Re: Simple Tutorial

I gave him a simple tutorial.
He liked it.
He posted it.

BlackHate you're jealous, aren't you.  :dont_care:
 

NoJustNo

Active member
Joined
Jul 26, 2014
Messages
178
Reaction score
0
Re: Simple Tutorial

blackHat , I Salute You.
determined-serious-chiseled-not-okay-l.png
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Simple Tutorial

Mr.Ze link said:
I gave him a simple tutorial.
He liked it.
He posted it.

BlackHate you're jealous, aren't you.  :dont_care:

hmm , when you started to giving instead of selling  :motherofgod_
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,126
Solutions
1
Reaction score
158
Re: Simple Tutorial

Very helpful. Thanks to this and blackHat's tutorial series I learned how to make basic cleo script but I'm kinda stuck with learning to be honest. There are some tutorials online or "Scripting bible" in Sanny Builder but they are made using pro language unlike this or blackHat's tutorial. Could you give me a tip about what direction should I look at. Or could you just tell me what were you focused on when you began to learn scripting? Open already existing mod and try to understand what it does by yourself? Read any book? Have a friend who knows all the stuff and is willing to share?
 

NoJustNo

Active member
Joined
Jul 26, 2014
Messages
178
Reaction score
0
Re: Simple Tutorial

monday link said:
Very helpful. Thanks to this and blackHat's tutorial series I learned how to make basic cleo script but I'm kinda stuck with learning to be honest. There are some tutorials online or "Scripting bible" in Sanny Builder but they are made using pro language unlike this or blackHat's tutorial. Could you give me a tip about what direction should I look at. Or could you just tell me what were you focused on when you began to learn scripting? Open already existing mod and try to understand what it does by yourself? Read any book? Have a friend who knows all the stuff and is willing to share?

BLACKHAT ! i command u to tell us how u learnt to make cleos , now!
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Simple Tutorial

monday link said:
Very helpful. Thanks to this and blackHat's tutorial series I learned how to make basic cleo script but I'm kinda stuck with learning to be honest. There are some tutorials online or "Scripting bible" in Sanny Builder but they are made using pro language unlike this or blackHat's tutorial. Could you give me a tip about what direction should I look at. Or could you just tell me what were you focused on when you began to learn scripting? Open already existing mod and try to understand what it does by yourself? Read any book? Have a friend who knows all the stuff and is willing to share?

NoJustNo link said:
BLACKHAT ! i command u to tell us how u learnt to make cleos , now!

i followed xzy tutorial ,, which it is almost the same first tutorial i wrote(hello world)  , i started with bleeding thing with my tutorials series to honor xzy :)

and learned the very basics from [member=970]xzytro[/member] , i got helped by many members such as [member=111]springfield[/member]  and [member=60]Opcode.eXe[/member]  , and on high level of coding structure , my bro ([member=6677]TH3RM4L[/member]) helped me alot (he is very good in coding structure but bad with blowjob  :dont_care:)

but most of stuff i learned is by viewing the list of opcodes , and  opening others simple codes and see what codes do , the more you have a fresh mind and think about cool cleos and viewing the list of opcodes the more it help you, script and test the scripts  , see what differences do < this is the main idea of learning
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Simple Tutorial

Mr.Ze link said:
lol BlackHat hasn't learned CLEO...
When he tried to help a guy with a script, he put a half-broken code...

to be honest...
all you need is here
http://gtaforums.com/topic/403594-gta-sa-cleo-script-tutorial/

Also, unlike you, BlackHat, I don't leech others' CLEOS, I make my own from scratch, and all of my CLEOs are free, except one.
first STFU ,
i know programming lang. more than you bish , i'm not working only with cleo like most of noobs here
i know more than 5 programming langs.
then which topic you are talking about?


all you need is this shit ?
hah man i read that shit and i understood shit


beside if there is a leecher it is you bish
i gave to this community for than you scam give to the world

after all i did/do i called a leecher by some shitty ass punk heh?

i always start from 0 with scripting
i didn't leech a shit

inv. is base on same idea  with more functions , and i'm not willing to explain to bishes like you "again" so STFU and think before talking 
 

TheZeRots

Expert
Joined
Dec 21, 2013
Messages
1,247
Reaction score
1
Re: Simple Tutorial

blackHat link said:
first STFU ,
i know programming lang. more than you bish , i'm not working only with cleo like most of noobs here
i know more than 5 programming langs.
then which topic you are talking about?


all you need is this shit ?
hah man i read that shit and i understood shit


beside if there is a leecher it is you bish
i gave to this community for than you scam give to the world

after all i did/do i called a leecher by some shitty ass punk heh?

i always start from 0 with scripting
i didn't leech a shit

inv. is base on same idea  with more functions , and i'm not willing to explain to bishes like you "again" so STFU and think before talking
mad
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Re: Simple Tutorial

you bish zezo , am very mad  :sweet_jesus:
 
Top