Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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. Grand Theft Auto Series

      1. Bugs*
      2. 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. GTA San Andreas

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

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

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. 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

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Encoding if the player fails a CLEO mission or mini-mission?


DavidReyes2250
 Share

Recommended Posts

DavidReyes2250

Hello again, I would like to know how I can make a CLEO custom mission, for example, if the player goes to a specific area, the mission fails just like an original mission from the game, how could I code it?

I have seen that at the beginning of the script it says, for example:

 

script_name 'MYCLEO'
MICLEO_03()
if
wasted_or_busted
jf @ MICLEO_02
MICLEO_05()

 

: MICLEO_02
MICLEO_06()
terminate_this_script

 

: MICLEO_03
(rest of the script)

 

: MICLEO_05
00BA: show_text_styled GXT 'M_FAIL' time 5000 style 1
return

 

: MICLEO_06
0924: enable_screen_darkness 0 with_value -1
Player.SprintMode ($ PLAYER_CHAR, False)
01F0: set_max_wanted_level_to 6
Player.ClearWantedLevel ($ PLAYER_CHAR)

 

I put this in my CLEO script but it doesn't work, am I missing something?
I hope you have understood me, thank you

 

Note: this cleo mod is created by me from the most recent version of Sanny Builder

Edited by DavidReyes2250
Link to comment
Share on other sites

 

First of all, read cleo tutorial

 

Second: Cleo scripts must beginn with the cleo directive:  {$CLEO .cs} or {$CLEO .cm}

 

{$CLEO .cs} for normal scripts

 

{$CLEO .cm} for mission scripts

 

 

3.)  a mission script requires always another script to initialize the mission

doesn't matter if main.scm or cleo

 

I f you wanna start a R* mission of main.scm with a cleo script, then it needs just this code:

Quote

0417: start_mission  1

make a little cleo script therefore

Quote

{$CLEO .cs}
thread 'INTRO'

wait 3000
0417: start_mission  2
0A93: end_custom_thread

 

 

4.) to initialize a cleo mission needs:

 

- a cleo script that beginns with {$CLEO .cs}

and have the code to initialize a mission script

Quote

0A94: start_custom_mission "TestMission"

 

Required entry between "  "

The script name of the *.cm cleo file

TestMission.cm -> "TestMission"

 

 

- the cleo mission script that beginns with {$CLEO .cm}

 

 

 

Below templates, first the script for initialize a mission script, then the mission script

Quote

{$CLEO .cs}
:Test_M_Start_1
03A4: name_thread 'TSTM'

:Test_M_Start_2
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Test_M_Start_2
if
0038:   $ONMISSION ==  0  // integer values
jf @Test_M_Start_2

:Test_M_Start_6
if
00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0
jf @Test_M_Start_2
00BA: text_styled 'fem_on'  1000 ms  2
wait  500
0004: $ONMISSION =  1  // integer values
0A94: start_custom_mission "TestMission"
0002: jump @Test_M_Start_2

Enter the red spot at groovestreet (1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 )

to start the mission

 

Quote

{$CLEO .cm}
:TestMiss_1
03A4: name_thread "TESTM"  
0050: gosub @TestMiss_main_1
00D6: if  0
0112:   wasted_or_busted
004D: jump_if_false @TestMiss_end_1
0050: gosub @TestMiss_fail_1                    

:TestMiss_end_1
0050: gosub @TestMiss_clep_1
004E: end_thread

:TestMiss_main_1
0317: increment_mission_attempts//here starts the missionscript
0004: $ONMISSION =  1
00BC: text_highpriority 'fem_ok'  3000 ms  1

:TestMiss_11
0001: wait 0 ms
if or
02D8:   actor $PLAYER_ACTOR currentweapon == 0
02D8:   actor $PLAYER_ACTOR currentweapon == 1
004D: jump_if_false @TestMiss_11
if
00E1:   key_pressed 0 17
004D: jump_if_false @TestMiss_11

:TestMiss_pass_1
00BA: text_styled 'M_PASS'  5000 ms  1
0051: return

:TestMiss_fail_1
00BA: text_styled 'M_FAIL'  5000 ms  1
0051: return

:TestMiss_clep_1
0004: $ONMISSION =  0
00D8: mission_cleanup
0051: return

 

 

Press firekey with fist or brass knuckle to pass the mission

 

 

 

Edited by ZAZ
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.