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

how a thread is activated?


Barot
 Share

Recommended Posts

All the codes I used had a different structure of this one, and it was like this:

 

-Event: What happens to activate the followed actions (Ex: Player enters a sphere).

-Condition: there is no need to explain..

-Action: What happens..

 

Like this one:

 

:Models_Loaded01if0248: not model #GREENWOO availableelse_jump @Creating_Army01wait 0 msjump @Models_Loaded01

 

The event would be when the model #GREENWOO is available, i have no problem with this.

 

The problem is that in many threads there is no event (for my understanding), like in this one:

 

:Load_Models010247: load_model #GREENWOO038B: load_requested_models 

 

The thing I dont understand is when the thread starts to work.. The game starts and just this happens? or i must put in some other thread "jump @Load_Models01" or something like that?

 

 

 

 

 

Link to comment
Share on other sites

Ok I will read it..

 

I have another questions u.u

 

1) Im trying to make the threads with "events" (its easier for me confused.gif .. im used to it), like this:

 

{$CLEO}:Init_War01   $modelsused_war01 = 0   $modelsloaded_war01 = 0   $modelsloading_war01 = 0   $inwar01 = 0   02A7: $sphere_war01 = create_icon_marker_and_sphere 6 at 2518.5596 -1692.0238 18.052end_thread:EnterSphere_War01   if and       $onmission == 0        00FF: actor $PLAYER_ACTOR sphere $sphere_war01 in_sphere 2518.5596 -1692.0238 18.052 radius 15.0 15.0 15.0 on_foot   then       $inwar01 = 1   else       wait 0 ms       jump @EnterSphere_War01   endend_thread:LoadModels_War01   wait 0 ms   until $inwar01 == 1   0247: load_model #GREENWOO   038B: load_requested_models   $modelsloading_war01 = 1end_thread :ModelsLoaded_War01   wait 0 ms   until $modelsloading_war01 == 1   if and       0248: not model #GREENWOO available   then       wait 0 ms       jump @ModelsLoaded_War01   else       $modelsloaded_war01 = 1       $modelsloading_war01 = 0   endend_thread :CreatingArmy_War01   wait 0 ms   until $modelsloaded_war01 == 1   $greenwood = car.Create(#GREENWOO, 2498.4966, -1651.4208, 13.515)   car.Angle($greenwood) = 177.0116   $modelsused_war01 = 1   $modelsloaded_war01 = 0end_thread :ClearModels_War01   wait 0 ms   until $modelsused_war01 == 1   0249: release_model #GREENWOO   $modelsused_war01 = 0 end_thread

 

 

Is this right?? confused.gif

 

2) I have an error when I whant to compile it.. it appears this error:

user posted image

The problem is in this line: until $inwar01 == 1

 

I dont understand which is the problem.. its an integer variable, i dont find any error sad.gif

 

Thanks for your help smile.gif

Link to comment
Share on other sites

 

Never use custom global variables in your CLEO-scripts ($car, $foo, $blahblah, etc), or your script will work incorrectly. You may use only a few global variables

 

 

Use the opcode 0A93, if you need to stop a CLEO-thread.

 

Not end_thread

 

2. You cannot use until alone until goes with repeat

 

Syntax

 

 

repeat[code]until [condition] 

 

 

repeat   wait 0until [email protected] == 0xFF 

 

 

Why do you want end_thread

Edited by BnB
Link to comment
Share on other sites

I dont need to use end_thread? i thought it was neccesary always i finish a thread ...

 

thank you bennington ^^

Link to comment
Share on other sites

 

I dont need to use end_thread? i thought it was neccesary always i finish a thread ...

 

thank you bennington ^^

no, we normaly let the code jump back to the beginning

 

we are writing Loops

 

a loop must beginn with a wait, mostly wait 0 ms

 

 

:Aktwait 0jump @Akt

 

example:

 

{$CLEO .cs}:Akt03A4: name_thread 'AKT':Akt_010001: wait 0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @Akt_01if0AB0:   key_pressed 8//-----------------key = Backspace004D: jump_if_false @Akt_0108B2: toggle_thermal_vision 10001: wait 3000 ms08B2: toggle_thermal_vision 00002: jump @Akt_01//--------Normal jump instruction to 1.LoopAdress

 

 

 

to create stuff, like actor, car, object etc.. needs to define a variable to declare the instance of an item

 

and your script should have a cleanup part to terminate the created instances

 

like the car in script below

 

{$CLEO .cs}:akt03A4: name_thread 'AKT':akt01//----------------------------1.Loop Adress0001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @akt01if00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false @akt0103C0: [email protected] = actor $PLAYER_ACTOR car0229: set_car [email protected] color_to 17 002AC: set_car [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 1053F: set_car [email protected] tires_vulnerability 0:akt03//----------------------------2.Loop Adress0001: wait 0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @akt03if80DF:   not actor $PLAYER_ACTOR driving004D: jump_if_false @akt0301C3: remove_references_to_car [email protected]: jump @akt01//--------Normal jump instruction to 1.LoopAdress

 

 

 

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

aaaaa.. becouse if it happens again, the thread will be still working.. if i dont do that, the thread will be activated only one time and never more, no?

 

I didnt understand the cleanup part u.u..

Link to comment
Share on other sites

 

I dont need to use end_thread? i thought it was neccesary always i finish a thread ...

 

thank you bennington ^^

Actually it had a bit of irony...

At least your choosing right topic titles tounge2.gif

OK, enough of that.

Edited by Bennington
Link to comment
Share on other sites

You should check Mission Coding For Dummies tutorial, it will explain you most things that are basic and you don't seem to know yet.
Yl8KS.jpg
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.