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

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
NicusorN5

How to call a thread and use thread parameters

Recommended Posts

NicusorN5

I want to use for example :

004F: create_thread @DoStuff $PLAYER_ACTOR True


@DoStuff
//Some stuff
end_thread


 

How do I get the parameters?

 

Share this post


Link to post
Share on other sites
ZAZ
Posted (edited)

 

 

ups, this was for cleo opcode 0A92:

Spoiler

opcode 0A92: create_custom_thread allows to attach up to 30 parameter
in example script below, opcode 0A92: has attached 4 parameter

the new thread recieve these parameter by following order:

1.param = [email protected]
2.param = [email protected]
3.param = [email protected]
4.param = [email protected]

and so on

put a check for [email protected] at script beginn to lead the code to desired labels

{$CLEO .s}
:MultiThread
if
0@ == 0
else_jump @MultiThread_20


/////////////  main thread
thread 'MULTHRD'
0A92: create_custom_thread "MultiThread.cs" 1 2 3 4 

    while true
    wait 0
    03F0: enable_text_draw 1  
    045A: draw_text_1number 100.0 100.0 GXT 'NUMBER' number 0@ 
    end 





//// additional thread

:MultiThread_20// second thread
if
0@ == 1
then
    03A4: name_thread 'SECONDT'

    while true
        wait 0
        03F0: enable_text_draw 1  
        045A: draw_text_1number 150.0 120.0 GXT 'NUMBER' number 0@
        045A: draw_text_1number 160.0 120.0 GXT 'NUMBER' number 1@ 
        045A: draw_text_1number 170.0 120.0 GXT 'NUMBER' number 2@
        045A: draw_text_1number 180.0 120.0 GXT 'NUMBER' number 3@ 
    end
end
0A93: end_custom_thread

data type for attach parameter can be:
int
float (not recomanded)
local var
global var
string ? never tested


Check out that mod where i used this method

 

 

opcode 004F: create_thread allows to attach up to 30 parameter
in example script below, opcode 004F: has attached 4 parameter

the started thread recieve these parameter by following order:

1.param = [email protected]
2.param = [email protected]
3.param = [email protected]
4.param = [email protected]

and so on

data type for attach parameter can be:
int
float (not recomanded)
local var
global var
string ? never tested

 


DEFINE OBJECTS  1
DEFINE OBJECT (dummyobject) // This is an unused object. You can put anything here.

DEFINE MISSIONS  0

DEFINE EXTERNAL_SCRIPTS  -1

DEFINE UNKNOWN_EMPTY_SEGMENT  0

DEFINE UNKNOWN_THREADS_MEMORY  0

//-------------MAIN---------------


:MAIN_1
03A4: name_thread 'MAIN'
016A: fade  0 (in)  0 ms
042C: set_total_missions_to  0
030D: set_total_mission_points_to  0
01F0: set_max_wanted_level_to  6
0111: set_wasted_busted_check_to  0 (disabled)
00C0: set_current_time  23  0

04E4: unknown_refresh_game_renderer_at  2494.5 -1668.5
03CB: set_camera  2494.5 -1668.5 13.4
0053: $PLAYER_CHAR = create_player #NULL at  2494.5 -1668.5 13.4
07AF: $PLAYER_GROUP = player $PLAYER_CHAR group
01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR
0173: set_actor $PLAYER_ACTOR z_angle_to  7.0
0373: set_camera_directly_behind_player
070D: $PLAYER_CHAR
0629: change_stat  181 (islands unlocked) to  4  // integer see statdisp.dat
01B6: set_weather  1
04BB: select_interior  0  // select render area
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
01B7: release_weather
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 0 
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 0 
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 1 
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 1 
016C: restart_if_wasted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 2 
016D: restart_if_busted_at 2494.5 -1668.5 13.4 angle 180.0 town_number 2
0629: change_stat  181 (islands unlocked) to  4  // integer see statdisp.dat
0998: add_respect 1000
062A: change_stat 165 (energy) to 800.0 // float
062A: change_stat 23 (muscle) to 800.0 // float
062A: change_stat 21 (fat) to 200.0 // float
0629: change_stat 225 (lung capasity) to 1000 // integer see statdisp.dat
0629: change_stat 22 (stamina) to 1000 // integer see statdisp.dat
0629: change_stat 156 (dance skill) to 1000 // integer see statdisp.dat
062A: change_stat 81 (gambling skill) to 1000.0 // integer see statdisp.dat
087B: set_player $PLAYER_CHAR clothes_texture "HAWAIIRED" model "HAWAII" body_part 0 
087B: set_player $PLAYER_CHAR clothes_texture "BASK2HEATBAND" model "BASK1" body_part 3 
087B: set_player $PLAYER_CHAR clothes_texture "GLASSES05DARK" model "GLASSES03" body_part 15 
087B: set_player $PLAYER_CHAR clothes_texture "LEATHERTR" model "LEATHERTR" body_part 2 
070D: rebuild_player $PLAYER_CHAR
0109: player $PLAYER_CHAR money += 350000
016A: fade  1 (out)  1000 ms
0001: wait  100 ms
03E6: remove_text_box
0180: set_on_mission_flag_to $ONMISSION // Note: your missions have to use the variable defined here

004F: create_thread @MultiThread 1 2 3 4 




:MAIN_3
0001: wait 2500 ms
//end_thread
0002: jump @MAIN_3









:MultiThread//main thread
thread 'MULTHRD' 


while true
    wait 0
    03F0: enable_text_draw 1  
    045A: draw_text_1number 150.0 120.0 GXT 'NUMBER' number 0@
    045A: draw_text_1number 160.0 120.0 GXT 'NUMBER' number 1@ 
    045A: draw_text_1number 170.0 120.0 GXT 'NUMBER' number 2@
    045A: draw_text_1number 180.0 120.0 GXT 'NUMBER' number 3@ 
end

end_thread

 

 

 

 

 

 



 

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
NicusorN5

Thanks, that's is all I wanted to know, sorry for the late reply.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.