CLEO3 Script Tutorial
Contents
1. Introduction
2. CLEO3 and Sanny Builder
3. Things you should know/Glossary
4. Spawn a car
5. Spawning pickups
6. Spawn an actor (Ped)
7. Making a cheat
8. High level constructions
9. Keywords
10. Opcode search
11. End
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1. INTRODUCTION
Coding is fun and easy when you get the hang of it. An experienced coder can basically make the
game "His" by changing an important file: The main.scm . I, James227uk, thought I would write
this tutorial because it would help people.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2. CLEO3 AND SANNY BUILDER
Sanny Builder (We'll call it SB from now XD)is the tool you code in. Not to mention, SB is the
only tool that can open and save .cs and .cm files. CLEO3 is an extensive project to extend the
coding possibilities in the game. With lots of extra opcodes it certainly achieves it's goal.
More to the point, CLEO scripts do not require you to start a new game. This means you can just
add and remove mods all you like without starting from the beginning. Cool huh? Yep, it is.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3. THINGS YOU SHOULD KNOW/GLOSSARY
In coding you store data to things called variables. Something like $EXAMPLE or 1@. When
making CLEO scripts, it's advisable to use Local Variables (1@, 2@, 3@ etc) to avoid conflicts
with the main.scm file. The limit for locals in a single script is form 0@ to 30@, although to
33@ if you count 32@ and 33@, which are local timers and not normal use locals.
A global variable is like $CUSTOM. The only time you really need to use them is when you need
a variable in more than one thread. Although, there will be times when you will HAVE TO USE THEM!
- THREAD
A thread is basically your mod. It organises it. It's composed of labels
- LABEL
A label is a section of your script. You typically start a new label when using a loop
- MAIN.SCM
The main.scm is the main script file for the game. It contains the missions and the CODE for
external scripts
- EXTERNAL SCRIPT
Examples of external scripts are the Parachute and the video games. The CODE is stored in the
SCM, though the actual thing is in the script.img
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
4. SPAWN A CAR
Something most people want to do. There are two ways of achieving this. Either a Car Generator
or a Keypress Spawn. A Car generator typically spawns a car like the Greenwood in Grove St.
Here is the opcode you need:
Lets go through the values.
$PARKED_RHINO - is the name of this car generator. We will need it later.
#RHINO - is the vehicle's model. A full list appears when you type a #
-1 -1 - These values are the cars colours. -1 -1 means the primary and secondary colour of the
car will be a random colour. A full list of colours can be found on this chart:
alarm 0 - 0 for alarm off 1 for on. If it's on, when the player or a ped trys to enter the
vehicle it's alarm will sound.
door_lock 0 - 0 for doors unlocked, 50 for a 50 percent chance doors will be locked and 100
for always locked
2435.302 -1671.848 12.8007 - The position the car will spawn at. These are called coordinates.
Move to a place in the game where you want your car, ALT+TAB to
SB and right click. Hover over
insert and click Player Coords.
angle 90.0 - The way the car will face. Face the way you want it to face in game, ALT+TAB to SB,
right click, hover over insert and click Player Angle
So now we have discussed the values (Correctly called Parameters). Here is a script you can
change:
This simply creates an Infernus under the bridge in Grove St. It's never locked and never
alarmed. Now look at opcode 014C. 0 means it will never spawn, and 101 means it will spawn unlimited times. (where as 99 would make it spawn 99 times, and etc, read more about how that works in the topic "Car generator(rules)".
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
5. SPAWN A PICKUP
There are namy types of pickups. We're talking Money, Asset, Property and the most common of all
, Weapons. In this section I will explain how to create a Weapon pickup. Here is the opcode:
There are also another opcodes for pickups:
There are many more in the opcode search. But we will focus on 032B. Lets look at the params:
$811 - The variable identifier
#M4 - The weapon
15 - Type of pickup. The main ones are 1, which is disabled and 15 which reappears after
sometime
60 - How much ammo which will be in this pickup. A melee weapon should only have 1 ammo.
2021.879 1001.467 10.3203 - The coords. Use the right click trick from the car section to get
these
Heres a script you can change:
This spawns an Ak47 at the desired coords with infinite ammo.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Contents
1. Introduction
2. CLEO3 and Sanny Builder
3. Things you should know/Glossary
4. Spawn a car
5. Spawning pickups
6. Spawn an actor (Ped)
7. Making a cheat
8. High level constructions
9. Keywords
10. Opcode search
11. End
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
1. INTRODUCTION
Coding is fun and easy when you get the hang of it. An experienced coder can basically make the
game "His" by changing an important file: The main.scm . I, James227uk, thought I would write
this tutorial because it would help people.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2. CLEO3 AND SANNY BUILDER
Sanny Builder (We'll call it SB from now XD)is the tool you code in. Not to mention, SB is the
only tool that can open and save .cs and .cm files. CLEO3 is an extensive project to extend the
coding possibilities in the game. With lots of extra opcodes it certainly achieves it's goal.
More to the point, CLEO scripts do not require you to start a new game. This means you can just
add and remove mods all you like without starting from the beginning. Cool huh? Yep, it is.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3. THINGS YOU SHOULD KNOW/GLOSSARY
In coding you store data to things called variables. Something like $EXAMPLE or 1@. When
making CLEO scripts, it's advisable to use Local Variables (1@, 2@, 3@ etc) to avoid conflicts
with the main.scm file. The limit for locals in a single script is form 0@ to 30@, although to
33@ if you count 32@ and 33@, which are local timers and not normal use locals.
A global variable is like $CUSTOM. The only time you really need to use them is when you need
a variable in more than one thread. Although, there will be times when you will HAVE TO USE THEM!
- THREAD
A thread is basically your mod. It organises it. It's composed of labels
- LABEL
A label is a section of your script. You typically start a new label when using a loop
- MAIN.SCM
The main.scm is the main script file for the game. It contains the missions and the CODE for
external scripts
- EXTERNAL SCRIPT
Examples of external scripts are the Parachute and the video games. The CODE is stored in the
SCM, though the actual thing is in the script.img
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
4. SPAWN A CAR
Something most people want to do. There are two ways of achieving this. Either a Car Generator
or a Keypress Spawn. A Car generator typically spawns a car like the Greenwood in Grove St.
Here is the opcode you need:
- Code:
014B: $PARKED_RHINO = init_parked_car_generator #RHINO color -1 -1 1 alarm 0 door_lock 0 0 10000
at 2435.302 -1671.848 12.8007 angle 90.0
Lets go through the values.
$PARKED_RHINO - is the name of this car generator. We will need it later.
#RHINO - is the vehicle's model. A full list appears when you type a #
-1 -1 - These values are the cars colours. -1 -1 means the primary and secondary colour of the
car will be a random colour. A full list of colours can be found on this chart:
alarm 0 - 0 for alarm off 1 for on. If it's on, when the player or a ped trys to enter the
vehicle it's alarm will sound.
door_lock 0 - 0 for doors unlocked, 50 for a 50 percent chance doors will be locked and 100
for always locked
2435.302 -1671.848 12.8007 - The position the car will spawn at. These are called coordinates.
Move to a place in the game where you want your car, ALT+TAB to
SB and right click. Hover over
insert and click Player Coords.
angle 90.0 - The way the car will face. Face the way you want it to face in game, ALT+TAB to SB,
right click, hover over insert and click Player Angle
So now we have discussed the values (Correctly called Parameters). Here is a script you can
change:
- Code:
{$CLEO .cs}
014B: 1@ = init_parked_car_generator #INFERNUS color -1 -1 1 alarm 0 door_lock 0 0 10000
at 2435.302 -1671.848 12.8007 angle 90.0
014C: set_parked_car_generator 1@ cars_to_generate_to 101
0A95: enable_thread_saving
0A93: end_custom_thread
This simply creates an Infernus under the bridge in Grove St. It's never locked and never
alarmed. Now look at opcode 014C. 0 means it will never spawn, and 101 means it will spawn unlimited times. (where as 99 would make it spawn 99 times, and etc, read more about how that works in the topic "Car generator(rules)".
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
5. SPAWN A PICKUP
There are namy types of pickups. We're talking Money, Asset, Property and the most common of all
, Weapons. In this section I will explain how to create a Weapon pickup. Here is the opcode:
- Code:
032B: $811 = create_weapon_pickup #M4 group 15 ammo 60 at 2021.879 1001.467 10.3203
There are also another opcodes for pickups:
- Code:
0213: $PICKUP_INFO_HOSPITAL = create_pickup #INFO type 3 at 2027.77 -1420.52 16.49
0213: $PICKUP_INFO_HOSPITAL = create_pickup #INFO type 3 at 2027.77 -1420.52 16.49
0518: $BUY_ASSET_PICKUPS[0] = create_available_asset_pickup 'PROP_3' at $X_PROPERTY_TO_BUY[0] $Y_PROPERTY_TO_BUY[0] $Z_PROPERTY_TO_BUY[0] price $1653 // Press ~k~~PED_ANSWER_PHONE~ to buy this property.
There are many more in the opcode search. But we will focus on 032B. Lets look at the params:
$811 - The variable identifier
#M4 - The weapon
15 - Type of pickup. The main ones are 1, which is disabled and 15 which reappears after
sometime
60 - How much ammo which will be in this pickup. A melee weapon should only have 1 ammo.
2021.879 1001.467 10.3203 - The coords. Use the right click trick from the car section to get
these
Heres a script you can change:
- Code:
{$CLEO}
thread 'WEAPONSS'
032B: 2@ = create_weapon_pickup #AK47 group 15 ammo 100000 at 2021.879 1001.467 10.3203
This spawns an Ak47 at the desired coords with infinite ammo.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Last edited by james227uk on Sat Apr 18, 2009 8:04 pm; edited 1 time in total