Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    2. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    3. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    4. Bugs*

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    6. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


ZAZ
 Share

Recommended Posts

Evil empire

I found a solution with the missing Frosted winter bonus.

 

I'd still like to know about unlocking the quadruple insane stunt through CLEO, please.

Link to comment
Share on other sites

You can't modify main.scm code by cleo script

have you read here and here?

 

Spoiler

On 2/21/2019 at 12:17 AM, JAJ said:

 I got the idea for the Chain Game from OrionSR in August 2005.

 

Edited by ZAZ
Link to comment
Share on other sites

  • 1 month later...
12 hours ago, Recommended said:

@MH-T88

 

I don't think Zaz's Cleo tutorial topic should be used for requesting. It's kind of rude to drop in here and demand someones cleo mod to be fixed. This is more suited: GTA 3D Era Modding Requests & Finds

Sorry, I didn't know this is not the suitable topic. My mistake.

Link to comment
Share on other sites

LordStarship
On 5/3/2018 at 1:56 PM, Diegoti said:

Hello i have to said something:

I come from the Warcraft 3 world editor, where all the scripts had three factors.

 
Event -> Something that must happen for the script to run
examples: cj jumps, a car explodes, cj dies, cj enters X area. etc
 
Condition -> This is what decides to run or not to run the script (its like a IF)
example: cj dies -> if cj is in x area -> run action so
 
Action -> here is where you specify what will happen
example: cj enters a vehicle (event) -> the vehicle is a Rhino (condition or "if") -> explode vehicle (action)
 
Other example:
Cj enters to X area -> If cj is driving a Hydra -> Add 6 stars
""""""""""""""""""""""""---""""""""""""""""""""""""""""----"""""""""""""""

 

I can understand better if someone explains to me where the "event" and "condition" is.

For WC3 editor, the structure is this:

 

Event Occur > Check Condition > Run Actions

 

As someone that has experienced with the editor for a while, it does work as same as CLEO, but it is easier to do rather than using opcodes.

 

For example:

Event: A unit dies

Condition: Owner of unit is Player 1(Red) and the unit-type is Thrall

Action: Player 1(Red) defeat

Player 2(Blue) victory

 

That is the example of it, if you make it with SannyBuilder it would be like this:

(sorry there are no opcodes and the words aren't as same as the original opcode because i have no time to check Sanny lol)

 

{CLEO. cs}

name_thread 'WC3EX'

 

:WC3EX_12

wait 0

if

Player.Defined ($PLAYER_CHAR)

jf @WC3EX_12

 

:WC3EX_38

load_model #THRALL //Custom model Thrall

load_requested_model

 

:WC3EX_52

@12= (X Coord)

@13= (Y Coord)

@14= (Z Coord)

wait 0

if

model #THRALL available

jf @WC3EX_52

jump @WC3EX_107

 

:WC3EX_107

@4= Actor.Create(CIVMALE, #THRALL, @12, @13, @14)

set_actor @4 health_to 1000

AS_actor @4 attack $PLAYER_ACTOR

 

//Event, Condition//

repeat

wait 0

until actor @4 dies

 

//Action//

play (Mission passed sound)

show text 'MISSPAS' style 1 5000 ms

 

The FXT 'MISSPAS' file can be like this:

 

MISSPAS Mission Passed! The Horde is now your enemy!

 

The Event is:

Actor .... dies

Which means that there is someone dies

 

The Condition is:

Actor @4 dies

Which means the @4 actor dies.

 

And then the action is like the mission pass text and the sound.

 

Simple as that

I still don't understand about array 😰 kinda hard to understand tbh

Link to comment
Share on other sites

  • 2 months later...
electronicsfan

 

hey good work. I wanted to ask how to run a wav file outside and near a vehicle(esp. trains) and change sounds as per the speed... Thanks.

Link to comment
Share on other sites

On 9/14/2018 at 8:27 AM, electronicsfan said:

 

hey good work. I wanted to ask how to run a wav file outside and near a vehicle(esp. trains) and change sounds as per the speed... Thanks.

 

load wave, link wave to car and play wave

Quote

040D: unload_wav 1
03CF: load_wav  19800 as  1


repeat
wait  0
until 03D0:   wav  1 loaded

0A16: link_wav 1 to_car [email protected]
03D1: play_wav 1

 

  • Like 2
Link to comment
Share on other sites

electronicsfan
16 minutes ago, ZAZ said:

 

load wave, link wave to car and play wave

 

Also anything we can do to change sound as per speed?? Thx

Link to comment
Share on other sites

get car speed and build condtional checks to give different wav number

 

02E3: 1@ = car 0@ speed

if
    1@ > 20.0
then
    03CF: load_wav  <number> as  1
else
    03CF: load_wav  <number> as  1
end
Edited by ZAZ
  • Like 1
Link to comment
Share on other sites

electronicsfan
23 hours ago, ZAZ said:

get car speed and build condtional checks to give different wav number

 

02E3: 1@ = car 0@ speed

if
    1@ > 20.0
then
    03CF: load_wav  <number> as  1
else
    03CF: load_wav  <number> as  1
end

I came up with this code but it doesn't run... please give suggestion to improve the code.

 

{$CLEO .cs}

[email protected] = Car.Model(#FREIGHT)
02E3: [email protected] = car [email protected] speed
if
   Actor.DrivingVehicleType($PLAYER_ACTOR, #FREIGHT)
   else_jump @WDGSOUND
if 
  [email protected] > 0.0 
else_jump @WDGSOUND_66 
[email protected] = Audiostream.Load("CLEO\HORN\WDM2_POWER_2.WAV")

:WDGSOUND_66
if 
  [email protected] > 20.0 
else_jump @WDGSOUND_120 
[email protected] = Audiostream.Load("CLEO\HORN\WDM2_POWER_3.WAV")

:WDGSOUND_120
if 
  [email protected] > 40.0 
else_jump @WDGSOUND_174 
[email protected] = Audiostream.Load("CLEO\HORN\WDM2_POWER_4.WAV")

:WDGSOUND_174
if 
  [email protected] > 60.0 
else_jump @WDGSOUND_228 
[email protected] = Audiostream.Load("CLEO\HORN\WDM2_POWER_5.WAV")

:WDGSOUND_228
[email protected] = Audiostream.Length([email protected])
[email protected] *= 1000 
Audiostream.PerformAction([email protected], STOP)
Audiostream.PerformAction([email protected], PLAY)
wait [email protected]
:WDGSOUND 
return

Link to comment
Share on other sites

That's nonsense

[email protected] = Car.Model(#FREIGHT)
02E3: [email protected] = car [email protected] speed

You have to learn first the coding basics

I know the tutorial messed up because of forums software update, so start here: zazmahall CLEO_Script_Tutorial

Link to comment
Share on other sites

  • 3 weeks later...

i already did that in the past, as old forum changed to previous version

now the newest agian, I'm too lazy for that, always again because the software can't convert the code format? also i don't like the new

go here to read the tut scripts

Edited by ZAZ
Link to comment
Share on other sites

what buffer?

00E1:   player 0 pressed_key <key press function number>

 

Link to comment
Share on other sites

5 minutes ago, ZAZ said:

what buffer?

00E1:   player 0 pressed_key <key press function number>

 

forget that.That was stupid.

Edited by Grinch_
Link to comment
Share on other sites

  • 1 month later...
On 3/20/2009 at 7:17 PM, ZAZ said:

To let something happen, when a button is selected needs to press another key to confirm the selection and this requires to script a keypress-check

therefor we need the button ID

Old as hell. In case of topic bumping let me know. I didn't get this part, how to make something to happen if I select a choice in the menu?

Link to comment
Share on other sites

18 hours ago, SMACKED! said:

Old as hell. In case of topic bumping let me know. I didn't get this part, how to make something to happen if I select a choice in the menu?

the selected button is given by opcode 08D7

08D7: 2@ = panel 1@ active_row

 [email protected] = panel active_row

 

it doesn't mater if there's a key_press to to confirm

active_row ID will be given when you read it with opcode 08D7

Link to comment
Share on other sites

On 11/23/2018 at 10:37 AM, ZAZ said:

the selected button is given by opcode 08D7

08D7: 2@ = panel 1@ active_row

  [email protected] = panel active_row

 

it doesn't mater if there's a key_press to to confirm

active_row ID will be given when you read it with opcode 08D7

the @2 variable is actually the choice/button?

and the [email protected] variable is the panel right?

On 11/23/2018 at 3:06 AM, Grinch_ said:

thanks! i know it all now

Link to comment
Share on other sites

  • 3 weeks later...
On 12/12/2018 at 3:53 PM, Davve95 said:

Sorry for bumping this one, but could you fix the links?

No sorry, the first 9 links are anchor links that worked for the old forum software and was linking to positions inside the first post

Link 10 Additional Themes links to 2. post and link 11, 12, 13, 14, 15 are also anchor links that worked for the old forum software and was linking to positions inside the 2.post

All others are working

Edited by ZAZ
Link to comment
Share on other sites

  • 2 months later...
10 minutes ago, Grinch_ said:

How do I check if there is a specific object near player?

opcodes 0471: 0472: 0473: 0474: 0475: 0476:

Link to comment
Share on other sites

  • 3 months later...

 

write the script in this way

{$CLEO .cs}
thread 'LOWRID'

:LOWR_1
wait 0 
if 
0256:   player $PLAYER_CHAR defined 
jf @LOWR_1 
if and
0AB0:   key_pressed 80// 	p key 
0AB0:   key_pressed 49// 	1 key 
   Actor.Driving($PLAYER_ACTOR)
else_jump @LOWR_1

gosub @LOWR_load1
0605: actor $PLAYER_ACTOR perform_animation "lrgirl_l0_to_l1" IFP "LOWRIDER" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 1 time -1


:LOWR_13
wait 0 
if 
0256:   player $PLAYER_CHAR defined 
jf @LOWR_clean
if
   Actor.Driving($PLAYER_ACTOR)
else_jump @LOWR_clean 
if
0AB0:   key_pressed 20// 	caps lock key 
else_jump @LOWR_13

gosub @LOWR_load1
0605: actor $PLAYER_ACTOR perform_animation "lrgirl_l12_to_l0" IFP "LOWRIDER" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
wait 2000
jump @LOWR_1
 
:LOWR_clean
wait 0 
if 
0256:   player $PLAYER_CHAR defined 
jf @LOWR_clean
0792: disembark_instantly_actor $PLAYER_ACTOR
jump @LOWR_1


:LOWR_load1
if
84EE: not  animation "LOWRIDER" loaded
jf @LOWR_load2
04ED: load_animation "LOWRIDER"
wait 0
jump @LOWR_load1


:LOWR_load2
return

 

 

if other samp player can't see the anim, then this anim isn't supported by serverside script

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi @ZAZ , recently i read your cleo tutorial on your website to make pickup script for added weapons but it caused bug which made CJ fall from the sky after completing some missions , especially 'nike and ak ' mission when CJ got out Binco store . I really need your help .

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.