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

Mission coding help


sci4me
 Share

Recommended Posts

Ok, i made this SIMPLE mission, and i did my BEST to make it work, but i cant get it to work. PLEASE HELP ME! THANKS! Code:

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'AM' :PT_11wait 0 if player.Defined($PLAYER_CHAR)jf @PT_11 wait 0 Model.Load(#CELLPHONE)wait 5000 03BD: destroy_sphere [email protected]: AS_actor $PLAYER_ACTOR hold_cellphone 1 03BF: set_player $PLAYER_CHAR ignored_by_everyone 1 wait 2000 00BB: show_text_lowpriority GXT 'HELLO' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'HI' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'WHAT' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'WHY' time 2000 flag 1 wait 2000 00BB: show_text_lowpriority GXT 'COME' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'OK' time 3000 flag 1 wait 300002A3: enable_widescreen 0 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 03BF: set_player $PLAYER_CHAR ignored_by_everyone 0 wait 3000 02A7: [email protected] = create_icon_marker_and_sphere [email protected] at -2815.0996 -1526.0273 140.8437jump @insphere:insphereif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5  else_jump @inspherejump @mstart:mstartmodel.Load(#SWAT)038B: load_requested_models if andmodel.Available(#SWAT)else_jump @mstartjump @mon:mon03BD: destroy_sphere [email protected] [email protected] = Actor.Create(4, #SWAT, -2815.7368, -1522.215, 140.8437)actor.Angle([email protected]) = 179.9298wait 4002A3: enable_widescreen 1 wait 5005BA: AS_actor [email protected] move_mouth -1 ms wait 500BB: show_text_lowpriority GXT 'DOTHIS' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'WHA' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'WEFRAID' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'NUKE' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'MELIVE' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'OFCO' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'OK' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'TOP' time 3000 flag 1wait 30000968: actor [email protected] stop_mouth 02A3: enable_widescreen 0wait 50 02A7: [email protected] = create_icon_marker_and_sphere [email protected] at -2294.7734 -1671.8262 483.3995wait 5000actor.DestroyWithFade([email protected])model.Destroy(#SWAT)jump @blowup:blowupif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5 else_jump @blowupjump @blowit:blowit03BD: destroy_sphere [email protected] 100000948: create_explosion_at -2815.0996 -1526.0273 140.8437 type 10 camera_shake 0.0 0A93: end_custom_thread

 

It compiles fine, but the mission freezes after i put away my phone (ingame).

PLZ HELP! and yes the text does work fine.

Link to comment
Share on other sites

Put a wait-instruction at the beginning of each label and try out.

It´s mostly the reason for game freezings...

Link to comment
Share on other sites

 

03BD: destroy_sphere [email protected]

 

is not defined

 

 

:insphere// missing wait if00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5  else_jump @inspherejump @mstart

 

 

 

:mstartmodel.Load(#SWAT)038B: load_requested_modelsif andmodel.Available(#SWAT)else_jump @mstartjump @mon

 

 

change it to:

 

:mstartmodel.load(#SWAT)while not Model.Available(#SWAT)   wait 0end

 

 

 

:blowup// missing waitif00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5else_jump @blowupjump @blowit

 

 

Link to comment
Share on other sites

Put a wait-instruction at the beginning of each label and try out.

It´s mostly the reason for game freezings...

Not totally necessary, but I do it. You only really need a WAIT 0 at the beginning of a label when that label starts off with a condition (IF etc).

Link to comment
Share on other sites

OK I see a lot of stuff that can be fixed!

 

 

:PT_11wait 0ifplayer.Defined($PLAYER_CHAR)jf @PT_11wait 0Model.Load(#CELLPHONE)wait 5000 

 

 

You don't need that second wait 0 there. Also, instead of waiting 5 seconds so the model can load, you could use a "Repeat...Until" structure. Its syntax is like this -

[/code]Repeat

// Stuff to do while the condition is false. Usually when people want the script to wait for a model to load, they put a wait 0 here.

Until <condition> // The condition, when the condition returns true, the script will stop doing whatever is between Repeat and Until.[/code]

Or you could use a While...End structure. Basically the script will do whatever is between them until the condition returns false. Syntax below -

 

While <condition>// Stuff to doend

 

 

Oh yeah and you don't need to jump to the next label, the game reads and script up to down automatically tounge.gif The only time the game will crash is if the script reaches the end of the script. When you want your script to stop and not crash the game then put opcode 0A93 at the end. Good luck with your mission smile.gif

 

Yeah and also read The_Siggi's corrections above ^^

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.