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. Forum Support

    3. Suggestions

Is possible use a .ini for saving cleo mission stuff?


sxriter
 Share

Recommended Posts

Hello, today i was thinking about this, and try to investigate my self in the .ini files and see what i can do

 

I explain now:

 

I made a Mission in cleo (mission.cs and mission.cm) the .cm works very good. without errors.

 

But i think on more missions, and make use of a .ini file, that store the player progress if the mission is completed or not.

 

This is the .ini file 


 

Quote

 

[MISSION1]
MISSION_PASSED=1   <- 1 mission passed
[MISSION2]
MISSION_PASSED=0   <- 0 mission available 

[MISSION3]
MISSION_PASSED=-1  <- -1 mission locked.

[MISS....

The values are changed every mission finished. That works, i finish the mission, look in the .ini file and values changes.

 

Everything looks perfect, but...

 

When i finish the mission, the game doesn't destroy the marker. I cant do the rest of the code. 

 

This is the code. 

 

Quote

 

{$CLEO .cs}

 

:MISSION_1
03A4: name_thread 'MISSION1'    

 

:MISSION_2
$X_JOHNSON_HOUSE = 2495.3274
$Y_JOHNSON_HOUSE = -1686.9609
$Z_JOHNSON_HOUSE = 13.515
$1 = Marker.CreateIconAndSphere (15, $X_JOHNSON_HOUSE, $Y_JOHNSON_HOUSE, $Z_JOHNSON_HOUSE)
0AF0: read_int_from_ini_file "cleo\samissions.ini" section "MISSION1" key "MISSION_PASSED" store_to [email protected] 

 

:MISSION_3  
0001: wait  0 ms
00D6: if  0
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @MISSION_3
00D6: if  0
0038:   $ONMISSION ==  0 
004D: jump_if_false @MISSION_3  
00D6: if
0006: [email protected] = 1
004D: jump_if_false @MISSION_7
0002: jump @MISSIONE_5

 

:MISSION_7 
00D6: if
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $X_JOHNSON_HOUSE $Y_JOHNSON_HOUSE $Z_JOHNSON_HOUSE radius 1.0 1.0 2.0 on_foot
004D: jump_if_false @MISSION_3
0002: jump @MISSION_4

 

:MISSION_4
00BA: text_styled 'BSMKM1'  1000 ms  2  
0004: $ONMISSION =  1  // integer values
Player.CanMove($PLAYER_CHAR, false)
fade 0 500
repeat
wait 0    
until 816B:   not fading
0A94: start_custom_mission "BSMOKEM"  //
Player.CanMove($PLAYER_CHAR, true)
fade 1 500
repeat
wait 0
until 816B:   not fading

jump @MISSION_3    //<-----------------works perfect!!!!


:MISSION_5    
wait 5000                                                                                    
Marker.Disable($1)   

 


I'm thinking that 

 

Quote

0AF0: read_int_from_ini_file "cleo\samissions.ini" section "MISSION1" key "MISSION_PASSED" store_to [email protected]

 

 

is the problem. And i don't know how to solve it. Or maybe there is another problem and i didnt, know. Please Help

 

Also Last Question

 

Quote

0006: [email protected] = 1
004D: jump_if_false @MISSION_7
0002: jump @MISSIONE_5

Im thinking of change this ⤴️ to something like this ⤵️, i dont know if this would work. or if this exist.

 

Quote

 

{$CLEO .cs}

:MISSION_1  //example xD
03A4: name_thread 'MISSION1'     

 

:MISSION_2
$X_JOHNSON_HOUSE = 2492.3274
$Y_JOHNSON_HOUSE = -1682.9609
$Z_JOHNSON_HOUSE = 13.515
0AF0: read_int_from_ini_file "cleo\samissions.ini" section "MISSION1" key "MISSION_PASSED" store_to [email protected]
if and
 0006: [email protected] = 0
004D: jump_if_false @MISSION_6
jump @MISSION_5


:MISSION_5
$1 = Marker.CreateIconAndSphere (16, $X_JOHNSON_HOUSE, $Y_JOHNSON_HOUSE, $Z_JOHNSON_HOUSE)

 

 :MISSION_6
 if and
  0006: [email protected] = -1
004D: jump_if_false @MISSION_8
jump @MISSION_7  

 

:MISSION_7
$1 = Marker.CreateIconAndSphere (17, $X_JOHNSON_HOUSE, $Y_JOHNSON_HOUSE, $Z_JOHNSON_HOUSE)

 

 :MISSION_8
 if and 
  0006: [email protected] = 1
004D: jump_if_false @MISSION_2
jump @MISSION_9

 

:MISSION_9
$1 = Marker.CreateIconAndSphere (19, $X_JOHNSON_HOUSE, $Y_JOHNSON_HOUSE, $Z_JOHNSON_HOUSE)

 

 

I need three values one for mission locked, one for mission available, and one for mission finished. THANKS 

 

 

 

Link to comment
Share on other sites

Replace opcode 0006 with 0038(for global variable) or 0039(for local variable). Also I recommend to not use global variables in cleo script.

Edited by In45do
Link to comment
Share on other sites

27 minutes ago, In45do said:

Replace opcode 0006 with 0038. Also don't use global variables in cleo script.

Didnt work :/

Link to comment
Share on other sites

1 hour ago, In45do said:

Replace opcode 0006 with 0038(for global variable) or 0039(for local variable). Also I recommend to not use global variables in cleo script.

SORRY YES IT WORKS OMG I LOVE YOU... xD thank you!

Edited by sxriter
it works xD
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.