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

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


Recommended Posts

EdUaRdO - Brazil

 

My question is how you can change the color of the cleo blue, red, green and yellow box and text in the game

One way to do this is by FXT, putting some letters before the words ... for example:

TEXT ~y~Text Example~y~ //Y yellowTEXT ~r~Text Example~r~ //R Red

 

Link to post
Share on other sites
kmlwin.1996

I have still questions....

 

How do you calculate offsets?

How to make search lights?

How to make a particle like smoke?

 

Please help me!

rampage_ani.giframpage_ani.gif

Link to post
Share on other sites
EdUaRdO - Brazil

 

(kmlwin.1996 @ Feb 18 2011, 04:32)

I have still questions....

 

How do you calculate offsets?

How to make search lights?

How to make a particle like smoke?

 

Please help me!

rampage_ani.gif  rampage_ani.gif

Offset is virtually a creation of a coordinated from an imaginary object, car or pedestrian ex ...

 

04C4: store_coords_to $CORDX $CORDY $CORDZ from_actor $PLAYER_ACTOR with_offset 1.0 3.0 1.0

 

 

The ofsset 1.0 3.0 1.0 be namely a more coordinated in X, 3 more coordinated in a Y and Z in the most coordinated in relation to the CJ ... getting this:

 

X = East/West dimension

Y = North/South dimension

Z = Height dimension

 

 

 

How to make search lights?

 

 

06B1: $LIGHT = create_searchlight_at 0.0 0.0 0.0 radius 0.0 target 0.0 0.0 0.0 radius 1.006B3:   searchlight $LIGHT active

 

 

1st parameter = name of the light

2nd parameter = coordinate that will be the beginning of the light

3rd parameter = Radius of the beginning of the light

4rd parameter = coordinate that will be the focus of the light

5rd parameter Radius of focus light

 

 

 

How to make a particle like smoke?

 

CODE

 

064B: $SMOKE = create_particle 'smoke50lit' at $x $y $z type 1064C: make_particle $SMOKE visible

 

 

1st parameter = Name of the particle parameter

2nd parameter = name of the game particle

3rd parameter = Radius of the beginning of the light

4rd parameter = coordinate that will be the particle

5rd parameter = type of particle (1 default) icon14.gif

Edited by EdUaRdO - Brazil
Link to post
Share on other sites

I have a serious problem. I want to write text to a file in code:

 

CAMERA.SETPOSITION(-986.487, 17.0653, 10.2857, 0.0, 0.0, 0.0)CAMERA.POINTAT(-987.243, 17.6505, 10.5804, 2)

 

 

But the file in CLEO 4 saves this code in the form:

 

CAMERA.SETPOSITION(-986.487, 17.0653, 10.2857, 0.0, 0.0, 0.0)CAMERA.POINTAT(-987.243, 17.6505, 10.5804, 2)

 

 

And here is my script in the CLEO4.

 

// 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 'CAM' :CAM_11wait 0 068D: get_camera_position_to [email protected] [email protected] [email protected] 068E: get_camera_target_point_to [email protected] [email protected] [email protected] if 0AB0:   key_pressed 88 else_jump @CAM_11 if   Player.Defined($PLAYER_CHAR)else_jump @CAM_11 if File.Open([email protected], "CLEO\CAM.INI", 119)else_jump @CAM_11 0AD9: write_formatted_text "CAMERA.SETPOSITION(%G, %G, %G, 0.0, 0.0, 0.0)" [email protected] [email protected] [email protected] [email protected]  0AD9: write_formatted_text "CAMERA.POINTAT(%G, %G, %G, 2)" [email protected] [email protected] [email protected] [email protected]  File.Close([email protected])0ACE: show_formatted_text_box "FILE SAVED TO CLEO\CAM.INI DIRECTORY." 2766  jump @CAM_11 

 

When you press the X writes the code in the directory CLEO

 

 

 

Link to post
Share on other sites

 

I have a serious problem. I want to write text to a file in code:

 

CAMERA.SETPOSITION(-986.487, 17.0653, 10.2857, 0.0, 0.0, 0.0)CAMERA.POINTAT(-987.243, 17.6505, 10.5804, 2)

 

 

a new line? don't know if possible

ask >here<

Link to post
Share on other sites

I have a question. Recently I did a little race for gta sa, but I miss the black screen-icon in the lower right corner of the screen, which displays the position of the player. Does anyone know how to do it?

user posted image

Link to post
Share on other sites
I have a question. Recently I did a little race for gta sa, but I miss the black screen-icon in the lower right corner of the screen, which displays the position of the player. Does anyone know how to do it?

 

I assume it's 038E:

 

:MTBIKER_11790038E: draw_box_position [email protected] [email protected] size [email protected] [email protected] RGBA 0 0 0 255 038E: draw_box_position [email protected] [email protected] size [email protected] [email protected] RGBA 134 155 184 255 038E: draw_box_position [email protected] [email protected] size [email protected] [email protected] RGBA 0 0 0 255

 

Link to post
Share on other sites

I put the actor with a marker, and what do you do that, as things are going to kill him, this marker? Here is my code.

 

 

:AAwait 0if0AB0:  key_pressed 63jf @AAModel.Load(#LSV1)Model.Load(#MICRO_UZI)038B: load_requested_models :CARL2_921if and  not Model.Available(#MICRO_UZI)  not Model.Available(#LSV1)jf @CARL2_953 jump @CARL2_921 :[email protected] = Actor.Create(Mission1, #LSV1, 2411.647, -1308.872, 24.6667)Actor.Angle([email protected]) = 181.940901B2: give_actor [email protected] weapon 28 ammo 30000 // Load the weapon model before using this 0568: set_actor [email protected] targetable 1 Actor.Armour([email protected]) = 100077A: set_actor [email protected] acquaintance 0 to_actors_pedtype 24 // see ped.dat 02A9: set_actor [email protected] immune_to_nonplayer 1 0446: set_actor [email protected] immune_to_headshots 0 060B: set_actor [email protected] decision_maker_to [email protected] 0638: AS_actor [email protected] stay_put 1 [email protected] = Marker.CreateAboveActor([email protected])018B: set_marker [email protected] radar_mode 2 Marker.SetIconSize([email protected], 2)Model.Destroy(#MICRO_UZI)Model.Destroy(#LSV1)

 

Link to post
Share on other sites

 

I put the actor with a marker, and what do you do that, as things are going to kill him, this marker? Here is my code.

 

Your code isn't complete and it isn't from you. Post your own complete script to get help.

Furthermore is the discussion section for such themes >here<

 

Check if actor is dead to can remove the marker.

If there are more actors with markers, it needs additional checks to remove the marker only at one time and at the correct moment.

Either use math coding and check the value of a variable which will be changed when the marker will be removed.

or use the check

if

075C: marker [email protected] enabled

 

2 examples below

version1 use math coding and check the value of a variable

version2 use opcode 075C:

 

 

{$CLEO .cs}:Actors_check_dead_marker_version_103A4: name_thread 'ACTDDMK':ACTDDMK_10001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @ACTDDMK_1if0AB0:   key_pressed 8//-------------------------- key Backspace004D: jump_if_false @ACTDDMK_10247: request_model #VMAFF10247: request_model #VMAFF20247: request_model #VMAFF30247: request_model #DESERT_EAGLE:ACTDDMK_30001: wait  0 msif  and0248:   model #VMAFF1 available0248:   model #VMAFF2 available0248:   model #VMAFF3 available0248:   model #DESERT_EAGLE available004D: jump_if_false @ACTDDMK_304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0  4.0  0.2009A: [email protected] = create_actor  24 #VMAFF1 at  [email protected] [email protected] [email protected]@ += 2.0009A: [email protected] = create_actor  24 #VMAFF2 at  [email protected] [email protected] [email protected]@ -= 4.0009A: [email protected] = create_actor  24 #VMAFF3 at  [email protected] [email protected] [email protected]: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR01B2: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR01B2: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR0187: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected]@ = [email protected] = [email protected] = 00249: release_model #VMAFF10249: release_model #VMAFF20249: release_model #VMAFF30249: release_model #DESERT_EAGLE:ACTDDMK_130001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @ACTDDMK_23_cleanupif0118:   actor [email protected] dead004D: jump_if_false @[email protected] == 0004D: jump_if_false @ACTDDMK_150164: disable_marker [email protected]@ = 1:ACTDDMK_15if0118:   actor [email protected] dead004D: jump_if_false @[email protected] == 0004D: jump_if_false @ACTDDMK_170164: disable_marker [email protected]@ = 1:ACTDDMK_17if0118:   actor [email protected] dead004D: jump_if_false @[email protected] == 0004D: jump_if_false @ACTDDMK_190164: disable_marker [email protected]@ = 1:ACTDDMK_19if  and0118:   actor [email protected] dead0118:   actor [email protected] dead0118:   actor [email protected] dead004D: jump_if_false @ACTDDMK_13:[email protected] == 0004D: jump_if_false @ACTDDMK_250164: disable_marker [email protected]:[email protected] == 0004D: jump_if_false @ACTDDMK_270164: disable_marker [email protected]:[email protected] == 0004D: jump_if_false @ACTDDMK_300164: disable_marker [email protected]:ACTDDMK_3001C2: remove_references_to_actor [email protected]: remove_references_to_actor [email protected]: remove_references_to_actor [email protected]: jump @ACTDDMK_1

 

 

 

 

{$CLEO .cs}:Actors_check_dead_marker_version_203A4: name_thread 'ACTDDMK':ACTDDMK_10001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @ACTDDMK_1if0AB0:   key_pressed 8//-------------------------- key Backspace004D: jump_if_false @ACTDDMK_10247: request_model #VMAFF10247: request_model #VMAFF20247: request_model #VMAFF30247: request_model #DESERT_EAGLE:ACTDDMK_30001: wait  0 msif  and0248:   model #VMAFF1 available0248:   model #VMAFF2 available0248:   model #VMAFF3 available0248:   model #DESERT_EAGLE available004D: jump_if_false @ACTDDMK_304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0  4.0  0.2009A: [email protected] = create_actor  24 #VMAFF1 at  [email protected] [email protected] [email protected]@ += 2.0009A: [email protected] = create_actor  24 #VMAFF2 at  [email protected] [email protected] [email protected]@ -= 4.0009A: [email protected] = create_actor  24 #VMAFF3 at  [email protected] [email protected] [email protected]: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR01B2: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR01B2: give_actor [email protected] weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  3005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR0187: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected]: release_model #VMAFF10249: release_model #VMAFF20249: release_model #VMAFF30249: release_model #DESERT_EAGLE:ACTDDMK_130001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @ACTDDMK_23_cleanupif0118:   actor [email protected] dead004D: jump_if_false @ACTDDMK_15if075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_150164: disable_marker [email protected]:ACTDDMK_15if0118:   actor [email protected] dead004D: jump_if_false @ACTDDMK_17if075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_170164: disable_marker [email protected]:ACTDDMK_17if0118:   actor [email protected] dead004D: jump_if_false @ACTDDMK_19if075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_190164: disable_marker [email protected]:ACTDDMK_19if  and0118:   actor [email protected] dead0118:   actor [email protected] dead0118:   actor [email protected] dead004D: jump_if_false @ACTDDMK_13:ACTDDMK_23_cleanupif075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_250164: disable_marker [email protected]:ACTDDMK_25if075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_270164: disable_marker [email protected]:ACTDDMK_27if075C:   marker [email protected] enabled004D: jump_if_false @ACTDDMK_300164: disable_marker [email protected]:ACTDDMK_3001C2: remove_references_to_actor [email protected]: remove_references_to_actor [email protected]: remove_references_to_actor [email protected]: jump @ACTDDMK_1

 

Edited by ZAZ
Link to post
Share on other sites

I wanted to be appeared after the mission but I am more interested in the one with the VCS but here I wrote a script with a pager with gta 3 and then starts flashing (CLEO 4)

 

 

// 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 'PAGER'0000: NOPwait [email protected] = [email protected] = 64.00390: load_txd_dictionary 'PAGER'038F: load_texture "PAGER" as 1 // Load dictionary with 0390 firstAudiostream.Load($PAGER, "CLEO\GTA3PAGER.MP3")Audiostream.PerformAction($PAGER, PLAY):PAGER_9203F0: enable_text_draw 1038D: draw_texture 1 position [email protected] 60.67 size 128.0 119.47 RGBA 255 255 255 25503E3: set_texture_to_be_drawn_antialiased 1:PAGER_134wait 0if not [email protected] > 64.0jf @[email protected] += 2.0jump @PAGER_920AB2: ret 0:PAGER_181wait 0if not [email protected] == 64.0jf @PAGER_218jump @PAGER_920AB2: ret 0:PAGER_218jump @PAGER_1340A93: end_custom_thread

 

 

here it is: http://www.megaupload.com/?d=SFXSCD4B

Edited by gtasite1
Link to post
Share on other sites

 

I wanted to be appeared after the mission but I am more interested in the one with the VCS but here I wrote a script with a pager with gta 3 and then starts flashing (CLEO 4)

don't use globals in cleoscripts and write your script in a simple and clear manner

 

 

{$CLEO .cs}//-------------MAIN---------------thread 'PAGER'0000: NOPwait [email protected] = [email protected] = 64.00390: load_txd_dictionary 'LD_BEAT'038F: load_texture "upr" as 1 // Load dictionary with 0390 firstAudiostream.Load([email protected], "CLEO\GTA3PAGER.MP3")Audiostream.PerformAction([email protected], PLAY):PAGER_92wait 003F0: enable_text_draw 1038D: draw_texture 1 position [email protected] 60.67 size 128.0 119.47 RGBA 255 255 255 25503E3: set_texture_to_be_drawn_antialiased 1 if64.0 > [email protected] @[email protected] += 2.0jump @PAGER_92

 

 

 

 

 

 

 

 

 

 

 

 

What this opcode means?

 

0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset  -10.0  15.0  0.0

 

And what is coordinate? How to create it? How to calculate it?

Read about Coordinate_system at Wikipedia

and select your language at the left navigationmenue

 

user posted image

The coordsystem allows to define a point in the 3-dimension space as well in the virtual space

by definition of the x-value, y-value and z-value

user posted image

The San Andreas gameworld is also allocated to a coordssystem

The corners of the border are

in North-West at x= -3000.0, y= 3000.0

in North-East at x= 3000.0, y= 3000.0

in South-West at x= -3000.0, y= -3000.0

in South-East at x= 3000.0, y= -3000.0

In the z-dimension is the map placed between 0.0 and 300.0,

the interiors are placed at z= 1000.0

If you fall under the ground and reach z= -100.0 the exe will bring you back to the map

 

Each model have it's own coordssystem. Buildings, objects, actors as well as the cars

user posted imageuser posted imageuser posted image

Now let's place a pyramid at the top of the car like in picture below

user posted image

You can do it ingame with script by using this opcode:

 

0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset  0.0  2.0  0.00107: [email protected] = create_object 1240 at [email protected] [email protected] [email protected]

 

The offset parameter are refering to the coordssystem of the car

offset x, y, z

offset 0.0 2.0 0.0

the pyramid is placed 2.0 units at the y-axis

at the center of the x-axis and at the center of the z-axis

 

to attach an object to car use this opcode

 

0681: attach_object [email protected] to_car [email protected] with_offset 0.0 2.0 0.0 rotation 0.0 0.0 90.0

 

the offset parameter have the same meaning like in opcode 0407:

and it have further parameter to define the orientaion (rotation)

 

 

 

Edited by ZAZ
Link to post
Share on other sites
Fatalpipe

I dont want double post,so,can you say to us if this is a possible thing to do?Thank you!!

 

>>>EDIT<<< I'm reading all stuff,and closest I got is this:

 

 

{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'CDRIVE' :CDRIVE_110001: wait 1000 ms 0A95: enable_thread_saving 07D0: [email protected] = weekday 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes 0006: [email protected] = 899 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_11 00D6: if and0039:   [email protected] == 2 0039:   [email protected] == 6 0039:   [email protected] == 20 004D: jump_if_false @CDRIVE_452 0247: load_model #CORVETT 0247: load_model #CROGRL3 0247: load_model #SBFYPRO 07C0: load_path [email protected] :CDRIVE_1050001: wait 0 ms 00D6: if and0248:   model #CORVETT available 0248:   model #CROGRL3 available 0248:   model #SBFYPRO available 004D: jump_if_false @CDRIVE_105 009A: [email protected] = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.6875 0173: set_actor [email protected] Z_angle_to 90.0 009A: [email protected] = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.6875 0173: set_actor [email protected] Z_angle_to 90.0 00A5: [email protected] = create_car #CORVETT at -1990.812 145.1061 27.3718 0175: set_car [email protected] Z_angle_to 0.0 0186: [email protected] = create_marker_above_car [email protected]: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected] 07E0: set_marker [email protected] type_to 207E0: set_marker [email protected] type_to 307E0: set_marker [email protected] type_to 4 0249: release_model #CORVETT 0249: release_model #CROGRL3 0249: release_model #SBFYPRO 05CB: AS_actor [email protected] enter_car [email protected] as_driver 10000 ms 05CA: AS_actor [email protected] enter_car [email protected] passenger_seat 0 10000 ms :CDRIVE_2860001: wait 0 ms 00D6: if and00DB:   actor [email protected] in_car [email protected] 00DB:   actor [email protected] in_car [email protected] 07C1:   path [email protected] available 004D: jump_if_false @CDRIVE_286 05EB: assign_car [email protected] to_path [email protected] 004D: jump_if_false @CDRIVE_286 :CDRIVE_3610001: wait 0 ms00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes 00D6: if and0256:   player $PLAYER_CHAR defined0039:   [email protected] == 80039:   [email protected] == 30004D: jump_if_false @CDRIVE_3610633: AS_actor [email protected] exit_car [email protected]: AS_actor [email protected] exit_car [email protected]:CDRIVE_3630001: wait 1000 ms00D6: if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_36305F5: AS_actor [email protected] goto_point -2624.6763 1412.7266 7.0937 mode 4 5500 ms // versionB0637: AS_actor [email protected] goto -2624.6763 1412.7266 7.0937 mode 6 turn_radius 0.5 stop_radius 5.0 look_at_actor $PLAYER_ACTOR004D: jump_if_false @CDRIVE_363:CDRIVE_3620001: wait 1000 ms0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_362 05EC: release_car [email protected] from_path 0873: release_path [email protected] 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 0164: disable_marker [email protected]: disable_marker [email protected]: disable_marker [email protected] :CDRIVE_4520002: jump @CDRIVE_11 0A93: end_custom_thread 

 

 

This create a car in front of Doherty Garage/Station ,and two female peds every monday at 6:20AM.

 

Righ,but the car is not geting damaged by collisions on traffic...I know something about this with carrec,can someone confirm that is impossible damage a car using carrec?

Also,everything ok,but until the very end,the two peds exits the car,but dont go to the predefined point,I still can't figure why.

 

Another thing is that this only work when I use the 00A5(create_car) opcode,if I use the 014B(init_parked_car_generator) the game crashes after load screen.You know why,whats the diference?

Edited by Fatalpipe
Link to post
Share on other sites

 

I dont want double post,so,can you say to us if this is a possible thing to do?Thank you!!

when I use the 00A5(create_car) opcode,if I use the 014B(init_parked_car_generator) the game crashes after load screen.You know why,whats the diference?

The placing of cars by using parked_car_generator dont allows the using of its variable name in vehicle associated opcodes

because its not a car but a car_generator

The Cleo scripts with extension .cs are started allways from new by loading a save game or start new game,

If such a script includes for exemble a parked car generator and execute it and after this a save game is made,

and then this save game is loaded,

will be created a duplicate of the item, in this case a duplicate of a parked car generator.

This happens with parked car generator, pickups as well as placed objects.

 

To prevent this or to read the script state by using special special Cleo-variable

must be used following Cleo opcode:

0A95: enable_thread_saving

This instruct Cleo to store the script state by making a savegame

 

but you didn't use a parked_car_generator in your script above

then you don't need 0A95: enable_thread_saving

 

>>>EDIT<<< I'm reading all stuff,and closest I got is this:

This create a car in front of Doherty Garage/Station ,and two female peds every monday at 6:20AM.

Righ,but the car is not geting damaged by collisions on traffic...I know something about this with carrec,

good work so far

 

can someone confirm that is impossible damage a car using carrec?

i confirm that is impossible damage a car using carrec

u don't need carrecs if you wanna let the car drive in the streets because you then have paths

use car drive to opcode

or without paths in a smaller range use abandon_path_radius

read car-drive-tutorial

 

 

 

Also,everything ok,but until the very end,the two peds exits the car,but dont go to the predefined point,I still can't figure why.

The timecheck is bad, I took it away because it complicate the teaching

more about the timecheck at the end

You forgot to check the location. It should not happen if you're in Vegas.

furthermore it needs to check if the actors are dead and the car not wrecked

I used infernus because i havn't a CORVETT

and i havn't the carrecs

they will spawn at SF station, enter the car and drive on carrecs and after 5 seconds they stop and go away

I would it write in this way, don't know if carrecs make sense, i don't know your plan

 

{$CLEO .cs}:CDRIVE03A4: name_thread 'CDRIVE':CDRIVE_11wait 000D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @CDRIVE_11if00FE:   actor $PLAYER_ACTOR  0 ()near_point_on_foot -1983.4121 154.3342 27.6875 radius  38.0  38.0  38.0004D: jump_if_false @CDRIVE_11004D: jump_if_false @CDRIVE_4520247: load_model #INFERNUS0247: load_model #CROGRL30247: load_model #SBFYPRO07C0: load_path [email protected]:CDRIVE_1050001: wait 0 ms00D6: if and0248:   model #INFERNUS available0248:   model #CROGRL3 available0248:   model #SBFYPRO available004D: jump_if_false @CDRIVE_105009A: [email protected] = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.68750173: set_actor [email protected] Z_angle_to 90.0009A: [email protected] = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.68750173: set_actor [email protected] Z_angle_to 90.000A5: [email protected] = create_car #INFERNUS at -1990.812 145.1061 27.37180175: set_car [email protected] Z_angle_to 0.00186: [email protected] = create_marker_above_car [email protected]: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected]: set_marker [email protected] type_to 207E0: set_marker [email protected] type_to 307E0: set_marker [email protected] type_to 40249: release_model #INFERNUS0249: release_model #CROGRL30249: release_model #SBFYPRO05CB: AS_actor [email protected] enter_car [email protected] as_driver 10000 ms05CA: AS_actor [email protected] enter_car [email protected] passenger_seat 0 10000 ms:CDRIVE_2860001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @CDRIVE_370if00FE:   actor $PLAYER_ACTOR  0 ()near_point_on_foot -1983.4121 154.3342 27.6875 radius  68.0  68.0  68.0004D: jump_if_false @CDRIVE_370if and8118:   NOT   actor [email protected] dead8118:   NOT   actor [email protected] dead8119:   NOT   car [email protected] wrecked004D: jump_if_false @CDRIVE_37000D6: if and00DB:   actor [email protected] in_car [email protected]:   actor [email protected] in_car [email protected]:   path [email protected] available004D: jump_if_false @CDRIVE_28605EB: assign_car [email protected] to_path [email protected]: jump_if_false @[email protected] = 0:CDRIVE_3610001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @CDRIVE_370if00FE:   actor $PLAYER_ACTOR  0 ()near_point_on_foot -1983.4121 154.3342 27.6875 radius  68.0  68.0  68.0004D: jump_if_false @CDRIVE_370if and8118:   NOT   actor [email protected] dead8118:   NOT   actor [email protected] dead8119:   NOT   car [email protected] wrecked004D: jump_if_false @[email protected] == 5000004D: jump_if_false @CDRIVE_3610633: AS_actor [email protected] exit_car [email protected]: AS_actor [email protected] exit_car [email protected]:CDRIVE_3630001: wait 0 ms00D6: if0256:   player $PLAYER_CHAR defined004D: jump_if_false @CDRIVE_370if00FE:   actor $PLAYER_ACTOR  0 ()near_point_on_foot -1983.4121 154.3342 27.6875 radius  68.0  68.0  68.0004D: jump_if_false @CDRIVE_370if and8118:   NOT   actor [email protected] dead8118:   NOT   actor [email protected] dead004D: jump_if_false @CDRIVE_37005F5: AS_actor [email protected] goto_point -2624.6763 1412.7266 7.0937 mode 4 5500 ms // versionB0637: AS_actor [email protected] goto -2624.6763 1412.7266 7.0937 mode 6 turn_radius 0.5 stop_radius 5.0 look_at_actor $PLAYER_ACTOR004D: jump_if_false @CDRIVE_363:CDRIVE_37005EC: release_car [email protected] from_path0873: release_path [email protected]: remove_references_to_car [email protected] // Like turning a car into any random car01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian0164: disable_marker [email protected]: disable_marker [email protected]: disable_marker [email protected]:CDRIVE_4520002: jump @CDRIVE_110A93: end_custom_thread

 

 

the timecheck

Using math symbols like "if greater than" > or "if greater than or equal" >=

let check a duration of the game time

 

The script below enables the thermal_vision in the night between 22 o`clock and 2 o`clock

The variable [email protected] prevent that the opcode 08B2: will be read permanently

The time check gets the duration which should view the thermal_vision

It doesnt matter if you arrived at midnight after loading a savegame

or if you are present before the view change and can experience the change

 

 

{$CLEO .cs}:GameTime_1thread "GTIME"[email protected] = 0:GameTime_2wait 000BF: [email protected] = current_time_hours, [email protected] = current_time_minutesif [email protected] >= 222 > [email protected] @GameTime_3  [email protected] == 0jf @GameTime_308B2: enable_thermal_vision [email protected] = 1:GameTime_3if [email protected] > 122 > [email protected]@ == 1jf @GameTime_208B2: enable_thermal_vision [email protected] = 0jump @GameTime_2

 

read more in MATH CODING

Edited by ZAZ
Link to post
Share on other sites
Fatalpipe

Thanl you very much ZAZ,now I finish the basics of I wanted,here is the code:

 

 

{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'CDRIVE' :CDRIVE_110001: wait 1000 ms07D0: [email protected] = weekday 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes  00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_11 if and0039:   [email protected] == 2 0039:   [email protected] == 6 0039:   [email protected] == 20 004D: jump_if_false @CDRIVE_452 0247: load_model #INFERNUS 0247: load_model #CROGRL3 0247: load_model #SBFYPRO :CDRIVE_1050001: wait 0 ms if and0248:   model #INFERNUS available 0248:   model #CROGRL3 available 0248:   model #SBFYPRO available 004D: jump_if_false @CDRIVE_105 009A: [email protected] = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.6875 0173: set_actor [email protected] Z_angle_to 90.0 009A: [email protected] = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.6875 0173: set_actor [email protected] Z_angle_to 90.0 00A5: [email protected] = create_car #INFERNUS at -1990.7504 145.0000 27.2389 0175: set_car [email protected] Z_angle_to 0.00186: [email protected] = create_marker_above_car [email protected]: [email protected] = create_marker_above_actor [email protected]: [email protected] = create_marker_above_actor [email protected] 07E0: set_marker [email protected] type_to 207E0: set_marker [email protected] type_to 307E0: set_marker [email protected] type_to 4 0249: release_model #INFERNUS 0249: release_model #CROGRL3 0249: release_model #SBFYPRO 05CB: AS_actor [email protected] enter_car [email protected] as_driver 10000 ms 05CA: AS_actor [email protected] enter_car [email protected] passenger_seat 0 10000 ms :CDRIVE_2860001: wait 0 ms if and00DB:   actor [email protected] in_car [email protected] 00DB:   actor [email protected] in_car [email protected]  004D: jump_if_false @CDRIVE_286 0615: define_action_sequences [email protected]: AS_actor -1 drive_car [email protected] to  -2000.0087 311.5435 35.0156 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  -2136.1233 322.64 35.1622 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  -2155.6082 118.341 35.1719 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  -2017.871 105.7274 27.5937 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  -1998.5907 450.4262 35.0595 speed  40.0  0  0  505CD: AS_actor -1 exit_car [email protected]: define_action_sequences_end [email protected]: assign_actor [email protected] to_action_sequences [email protected]: remove_references_to_AS_pack [email protected] 004D: jump_if_false @CDRIVE_286 :CDRIVE_3610001: wait 0 ms if and0256:   player $PLAYER_CHAR defined0206:   actor [email protected] near_car [email protected] radius 5.0 5.0 3.0 flag 0 on_foot004D: jump_if_false @CDRIVE_3610633: AS_actor [email protected] exit_car:CDRIVE_3620001: wait 1000 msif and0256:   player $PLAYER_CHAR defined0206:   actor [email protected] near_car [email protected] radius 5.0 5.0 3.0 flag 0 on_foot 004D: jump_if_false @CDRIVE_36207CD: AS_actor [email protected] walk_to -1962.2249 439.3388 35.1719 stop_with_angle 270.0 within_radius 4.007CD: AS_actor [email protected] walk_to -1962.2249 439.3388 35.1719 stop_with_angle 270.0 within_radius 4.0:CDRIVE_3630001: wait 30000 ms0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_363 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 0164: disable_marker [email protected]: disable_marker [email protected]: disable_marker [email protected]:CDRIVE_4520002: jump @CDRIVE_11 0A93: end_custom_thread

 

 

Only thing is that I needed to put 0001: wait 30000 ms in the end,otherwise the peds was released before they perform the 07CD: AS_actor [email protected] walk_to.

 

I just need to change the values of peds,coords etc. in each script,to make various things that I've planned to the game.

 

As you asked before,my goal was to make people drive cars that I added(not replaced),and this cars aren't in normal traffic behavior,only predefined peds will own this predefined cars.

I think sometimes we will be doing a mission,or even drive here and there,and suddenly can see a ped getting or driving somekind of car.As most of this peds will follow a daily routine,others will perform actions like kidnapping people,hijacking,or even hooking pros on the alleys.All this unusual things linked to unusual/rare cars.

Maybe this will lead player to pay attention on a certain ped behavior,making player start to follow him to home,or work to get his car,if for some reason(I plan to think about this reasons) this car can't be hijacked.

Of course,I know what I'm doing,but this is for my son,he have 10yr,loves this game and dont make any idea that what I've been doing to the game,so,I'm sure he will like it,even with GTAIV installed.Thank you again ZAZ.As I've learned something this week,I will stay trying to do things with script,I really liked this.

Link to post
Share on other sites
kal-el5676

Not to distract Zaz's attention too much, but i have a question as well. Speaking of coordinates and offsets on objects, i have some coding idea's for the predator plasma caster for the pred mod i am working on. If it's possible in cleo then no prob, but if it can only be SCM also no prob. wink.gif

 

I would like to know is it possible to create a script that utilizes the auto aim lock on system without a weapon selected? To take it even further, fire a missile from an offset of the actor similar to ryosukes missile man mod? And to take it even further attach an additional particle to the missile? Or even one step FURTHER and attaching a second particle to the actor with an offset to create the laser targeting beam effect? smile.gif

 

Any advice is of course greatly appreciated.

 

Link to post
Share on other sites

 

Thanl you very much ZAZ,now I finish the basics of I wanted,here is the code:

 

Only thing is that I needed to put 0001: wait 30000 ms in the end,otherwise the peds was released before they perform the 07CD: AS_actor [email protected] walk_to.

 

I just need to change the values of peds,coords etc. in each script,to make various things that I've planned to the game.

 

As you asked before,my goal was to make people drive cars that I added(not replaced),and this cars aren't in normal traffic behavior,only predefined peds will own this predefined cars.

I think sometimes we will be doing a mission,or even drive here and there,and suddenly can see a ped getting or driving somekind of car.As most of this peds will follow a daily routine,others will perform actions like kidnapping people,hijacking,or even hooking pros on the alleys.All this unusual things linked to unusual/rare cars.

Maybe this will lead player to pay attention on a certain ped behavior,making player start to follow him to home,or work to get his car,if for some reason(I plan to think about this reasons) this car can't be  hijacked.

Of course,I know what I'm doing,but this is for my son,he have 10yr,loves this game and dont make any idea that what I've been doing to the game,so,I'm sure he will like it,even with GTAIV installed.Thank you again ZAZ.As I've learned something this week,I will stay trying to do things with script,I really liked this.

Well, you ignored everything what i tried to teach

anyway, how old is your son? 10? please talk with him about the difference of virtuality and reality

 

 

Not to distract Zaz's attention too much, but i have a question as well. Speaking of coordinates and offsets on objects, i have some coding idea's for the predator plasma caster for the pred mod i am working on. If it's possible in cleo then no prob, but if it can only be SCM also no prob. wink.gif

 

I would like to know is it possible to create a script that utilizes the auto aim lock on system without a weapon selected? To take it even further, fire a missile from an offset of the actor similar to ryosukes missile man mod? And to take it even further attach an additional particle to the missile? Or even one step FURTHER and attaching a second particle to the actor with an offset to create the laser targeting beam effect? smile.gif

 

Any advice is of course greatly appreciated.

which auto aim lock on system?

mp, asault, bazooka, sniper?

the Grenadeflowerlauncher-weapon-data-modification utilizesed the camera and animation

no, not without weapon

if you player_actor attach to object, it switch into firstperson view

 

with script you can just simulate the projectile, doesen't matter if cleo or main or write your own utilizing the camera, animation and demage

Link to post
Share on other sites
Fatalpipe
Well, you ignored everything what i tried to teach

anyway, how old is your son? 10? please talk with him about the difference of virtuality and reality

I think that was more easy extend the wait time than make another check if the peds are on right coords.I deleted the time check and carrec,just did things from car_drive_tutorial.Tried the match coding thing creating a variable "[email protected]= coords XYX values " ,then check if "[email protected]== my desired XYZ coords values",but doesnt work.

And yes,he knows what he should know...

 

You know any way to check weather conditions?Eg.: If current weather is cloudy SF?

 

And I dont understand the "IGNORE UNKNOW" option on SannyBuilder/Debug Options.

I got some error messages when I was looking inside other finished scripts and this option was unchecked,but my point is: If the opcode is unknow,how people put this in script without making any idea of what this opcode does/means?

Link to post
Share on other sites

 

I deleted the time check and carrec,just did things from car_drive_tutorial.Tried the  match coding thing creating a variable "[email protected]= coords XYX values " ,then check if "[email protected]== my desired XYZ coords values",but doesnt work.

post your script

 

 

You know any way to check weather conditions?Eg.: If current weather is cloudy SF?

 

0A8D: [email protected] = read_memory 13112096 size 4 virtual_protect 1 00D6: if or0039:   [email protected] == 8//rainy 0039:   [email protected] == 16//rainy 004D: jump_if_false @L

 

 

 

And I dont understand the "IGNORE UNKNOW" option on SannyBuilder/Debug Options.

I got some error messages when I was looking inside other finished scripts and this option was unchecked,but my point is: If the opcode is unknow,how people put this in script without making any idea of what this opcode does/means?

don't know i have my hook allways only at constant indexes

decompiled scripts can have unsued opcodes and unknown opcodes as well as failcode because of invalid decompilation

they can be modified after compilation with hexeditor

sanny supoorts highlevel syntax but the recompilation translate the code in the classic gta scm code

sanny supports also hexcode

Link to post
Share on other sites

How to create corona with array

 

 

:PCJONDOCKS_1330wait 0 if  27 > [email protected] jf @aa04D5: create_corona_at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) radius 1.0 type 2 flare 2 RGB 0 255 0 024F: create_corona_with_radius 1.0 type 0 lensflares 0 with_color 237 130 180 at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) [email protected] += 1 jump @PCJONDOCKS_1330 :[email protected] = 0 

 

 

but i don't know which does not appear

Link to post
Share on other sites

 

How to create corona with array

 

 

:PCJONDOCKS_1330wait 0 if  27 > [email protected] jf @aa04D5: create_corona_at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) radius 1.0 type 2 flare 2 RGB 0 255 0 024F: create_corona_with_radius 1.0 type 0 lensflares 0 with_color 237 130 180 at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) [email protected] += 1 jump @PCJONDOCKS_1330 :[email protected] = 0 

 

 

but i don't know which does not appear

 

you must define first the coords for the arrays

 

in this way with globals:

 

0005: $5610[0] = 2495.53 0005: $5639[0] = -1711.88 0005: $5668[0] = 1014.24 0005: $5610[1] = 1263.05 0005: $5639[1] = -773.67 0005: $5668[1] = 1091.39 0005: $5610[2] = 416.9548 0005: $5639[2] = 2538.813 0005: $5668[2] = 9.5077 0005: $5610[3] = 2367.192 0005: $5639[3] = -1121.518 0005: $5668[3] = 1050.382:PCJONDOCKS_1330wait 0if27 > [email protected] @aa04D5: create_corona_at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) radius 1.0 type 2 flare 2 RGB 0 255 0

 

 

 

in this way with locals

 

[email protected] = 2495.53 [email protected] = -1711.88 [email protected] = 1014.24 [email protected] = 1263.05 [email protected] = -773.67 [email protected] = 1091.39 [email protected] = 416.9548 [email protected] = 2538.813 [email protected] = 9.5077 [email protected] = 2367.192 [email protected] = -1121.518 [email protected] = 1050.382:PCJONDOCKS_1330wait 0if27 > [email protected] @aa04D5: create_corona_at [email protected]([email protected],27f) [email protected]([email protected],27f) [email protected]([email protected],27f) radius 1.0 type 2 flare 2 RGB 0 255 0

 

 

 

or in this way, be reading coords in same loop

 

:PCJONDOCKS_1330wait 0if27 > [email protected] @aa04C4: create_coordinate [email protected]([email protected],27f) [email protected]([email protected],27f) [email protected]([email protected],27f) from_actor $PLAYER_ACTOR offset 0.0  [email protected]  0.204D5: create_corona_at [email protected]([email protected],27f) [email protected]([email protected],27f) [email protected]([email protected],27f) radius 1.0 type 2 flare 2 RGB 0 255 0 000B: [email protected] +=  2.0  // add 2.0 to the y offset for spawn coords000A: [email protected] +=  1  // Array index

 

but it don't makes much sense because corona don't need to create an script instance

so you can have the same effect with this way, without arrays:

 

:PCJONDOCKS_1330wait 0if27 > [email protected] @aa04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0  [email protected]  0.204D5: create_corona_at [email protected] [email protected] [email protected] radius 1.0 type 2 flare 2 RGB 0 255 0 000B: [email protected] +=  2.0  // add 2.0 to the y offset for spawn coords000A: [email protected] +=  1  // Array index0002: jump @ArrayAct_4

 

 

Edited by ZAZ
Link to post
Share on other sites

I create this code, but corona not working.

 

 

[email protected] = 0 $6062([email protected],27i) = 2 $6063([email protected],27i) = 0 $6090([email protected],27i) = 0 :PCJONDOCKS_1290wait 0 if  $6062([email protected],27i) == 0 jf @PCJONDOCKS_1338 $6059 = 255 $6060 = 0 $6061 = 0 :PCJONDOCKS_1338wait 0 if  $6062([email protected],27i) == 1 jf @PCJONDOCKS_1386 $6059 = 0 $6060 = 255 $6061 = 0 :PCJONDOCKS_1386wait 0 if  $6062([email protected],27i) == 2 jf @PCJONDOCKS_1434 $6059 = 0 $6060 = 0 $6061 = 255 :PCJONDOCKS_1434024F: create_corona_with_radius 1.0 type 2 lensflares 0 with_color $6059 $6060 $6061 at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) if  $6090([email protected],27i) == 0 jf @PCJONDOCKS_1527 018A: $5891([email protected],27i) = create_checkpoint_at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) :[email protected] += 1  [email protected] >= 27 jf @PCJONDOCKS_1290 return [email protected] = 0 $5451([email protected],27i) = 0 :PCJONDOCKS_1568wait 0 if  27 > [email protected] jf @PCJONDOCKS_2070 if  $6063([email protected],27i) == 0 jf @PCJONDOCKS_2056 if  $6062([email protected],27i) == 0 jf @PCJONDOCKS_1656 $6059 = 255 $6060 = 0 $6061 = 0 :PCJONDOCKS_1656wait 0 if  $6062([email protected],27i) == 1 jf @PCJONDOCKS_1704 $6059 = 0 $6060 = 255 $6061 = 0 :PCJONDOCKS_1704wait 0 if  $6062([email protected],27i) == 2 jf @PCJONDOCKS_1752 $6059 = 0 $6060 = 0 $6061 = 255 :PCJONDOCKS_1752024F: create_corona_with_radius 1.0 type 2 lensflares 0 with_color $6059 $6060 $6061 at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) if  $5451([email protected],27i) == 0 jf @PCJONDOCKS_1845 018A: $5891([email protected],27i) = create_checkpoint_at $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) :PCJONDOCKS_1845wait 0 if 00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere $5610([email protected],27f) $5639([email protected],27f) $5668([email protected],27f) radius 4.0 4.0 4.0 jf @PCJONDOCKS_2056 if   Actor.DrivingVehicleType($PLAYER_ACTOR, #PCJ600)jf @PCJONDOCKS_2056 if  $6062([email protected],27i) == 0 jf @PCJONDOCKS_1964 Marker.Disable($5891([email protected],27i))$6063([email protected],27i) = 1 :PCJONDOCKS_1964wait 0 if  $6062([email protected],27i) == 1 jf @PCJONDOCKS_2010 Marker.Disable($5891([email protected],27i))$6063([email protected],27i) = 1 :PCJONDOCKS_2010wait 0 if  $6062([email protected],27i) == 2 jf @PCJONDOCKS_2056 Marker.Disable($5891([email protected],27i))$6063([email protected],27i) = 1 :[email protected] += 1 jump @PCJONDOCKS_1568 :PCJONDOCKS_2070return

 

Link to post
Share on other sites

 

I create this code, but corona not working.

post the whole script, the coords definitions are missing

Edited by ZAZ
Link to post
Share on other sites
Fatalpipe

Again with the rare car script.Last one I did with two peds,and needed to check if one ped is close to another to get them to walk to destination.

But now,with only one ped inside car,isn't working.The driver exits the car and do nothing,stay there and the thread is not ending...I've tried a lot of conditions checks to make the driver walk,but none of them worked.

 

 

//-------------MAIN---------------03A4: name_thread 'RICHMAN' :RICHMAN_110001: wait 1000 ms07D0: [email protected] = weekday 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes  00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @RICHMAN_452 00D6: if and0039:   [email protected] == 2 0039:   [email protected] == 6 0039:   [email protected] == 20 004D: jump_if_false @RICHMAN_452 0247: load_model #INFERNUS 0247: load_model #HMORI :RICHMAN_1050001: wait 0 ms 00D6: if and0248:   model #INFERNUS available 0248:   model #HMORI available004D: jump_if_false @RICHMAN_105 009A: [email protected] = create_actor_pedtype 24 model #HMORI at 645.902 -1117.5109 44.207 0173: set_actor [email protected] Z_angle_to 90.0 00A5: [email protected] = create_car #INFERNUS at 636.3992 -1122.2133 44.6699 0175: set_car [email protected] Z_angle_to 40.00186: [email protected] = create_marker_above_car [email protected]: [email protected] = create_marker_above_actor [email protected] 07E0: set_marker [email protected] type_to 207E0: set_marker [email protected] type_to 3 0249: release_model #INFERNUS 0249: release_model #HMORI   :RICHMAN_2860001: wait 0 ms 00D6: if and0256:   player $PLAYER_CHAR defined8119:   NOT   car [email protected] wrecked8118:   NOT   actor [email protected] dead   004D: jump_if_false @RICHMAN_452 0615: define_action_sequences [email protected]: AS_actor [email protected] enter_car [email protected] as_driver 10000 ms05D1: AS_actor -1 drive_car [email protected] to  627.5103 -1112.3221 46.3197 speed  10.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  1238.5304 -1575.3459 12.928 speed  25.0  0  0  505CD: AS_actor -1 exit_car [email protected]: define_action_sequences_end [email protected]: assign_actor [email protected] to_action_sequences [email protected]: remove_references_to_AS_pack [email protected] 004D: jump_if_false @RICHMAN_286:RICHMAN_2870001: wait 0 ms00D6: if and8119:   NOT   car [email protected] wrecked8118:   NOT   actor [email protected] dead01AE:   car [email protected] sphere 0 near_point 1238.5304 -1575.3459 radius 3.0 3.0 stopped0206:   actor [email protected] near_car [email protected] radius 5.0 5.0 3.0 flag 0 on_foot004D: jump_if_false @RICHMAN_45207CD: AS_actor [email protected] walk_to 1217.1807 -1584.7091 13.5531 stop_with_angle 40.0 within_radius 1.007A1: set_walk_speed 4034F: destroy_actor_with_fade [email protected]  // The actor fades away like a ghost004D: jump_if_false @RICHMAN_287:RICHMAN_3630001: wait 30000 ms00D6: if and8119:   NOT   car [email protected] wrecked8118:   NOT   actor [email protected] dead 004D: jump_if_false @RICHMAN_452 01C3: remove_references_to_car [email protected] // Like turning a car into any random car 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 0164: disable_marker [email protected]: disable_marker [email protected]:RICHMAN_4520002: jump @RICHMAN_11 0A93: end_custom_thread

 

 

Also I tried to put the "07CD: AS_actor [email protected] walk_to" inside the "actions_sequence [email protected]" ,but doesn't work either.

Edited by Fatalpipe
Link to post
Share on other sites

SPAWN A OBJECT AND PICK IT

 

Hello'

 

I know how to spawn a object but i want pick it (like CJ raise the TV)

 

Can you make a script to Spawn a Beachball and pick it ?

i want target the object (like target the Peds') object targetable

and i want kick the object (like soccer) yes... i want to move the object when i point the object with a weapon and shot! (and when i point the ball without weapons to kick it)

 

can you help me? or can you make a mod to release it?

Link to post
Share on other sites

Interactive MENUE

 

I can't explain everything, there are a lot of codes depending to the menue and you can do it with different methods.

 

The essential codes:

 

1. opcode 08D4: defines the menue with a var handle,

with title entry, x/y-positions entries, width, amount of tables, if interactiv or not, with or without background, alignment

 

 

 

 

08D4: [email protected] = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  0

 

 

ignore for now the parameters of amount of tables, if interactiv or not, with or without background, alignment

and use just the values of the example above

 

2. opcode 08DB: adds the true content to the menue

 

08DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'

 

 

column 0 is the first table, use this also like in example above

at header string parameter is it possible to show one more title or a description

then there are 12 string parameter to insert gxt entries, these are the names for the buttons

 

Important: all parameters must have an entry, also the gxt entries for the names of the buttons

 

If you wanna use only 3 buttons, then insert "dummy" in all other string parameter

 

08DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'

 

 

then the buttons will not be shown

same for the header

(also if wrong gxt entries are inserted, the buttons will not be shown)

 

Important: the function to skip from button to button, later ingame, is working automatically with the keys UP/DOWN as well with W/S and also G/H

But nothing else

To let something happen, when a button is selected needs to press another key to confirm the selection and this requires to script a keypress-check

therefor we need the button ID

 

3. opcode 08D7: submits the button number of selected button into a variable

 

08D7: [email protected] = panel [email protected] active_row

 

 

 

4. The menue must be removed with opcode 08DA: before the user continues playing or before another menue should be shown.

 

 

 

 

08DA: remove_panel [email protected]

 

 

If it happens because of any reason, that 2 interactiv menues should be shown, will you get a heavy bug and needs to terminate the game to fix that bug.

 

 

 

 

Recommanded script construct:

 

Loop 1 with keypress-check, to show menue08D4: [email protected] = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  008DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'Loop 2 , while menue is shown including every neccesary checks08DA: remove_panel [email protected] to Loop 1 

 

 

 

To let something happen, when a button is selected needs to press another key to confirm the selection

So we need a keypress-check

and if the keypress-check is passed, it should get the button ID

then you have a variable and it's value must be checked to select into several scriptparts, each what you wanna do

Example below let you set the weather

 

{$CLEO .cs}:WETHERMENUE03A4: name_thread 'WHELP':MenueTempW_01wait  0if0256:   player $PLAYER_CHAR definedjf @MenueTempW_01if0AB0:   key_pressed 8//--- key = Backspace  jf @MenueTempW_0108D4: [email protected] = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  008DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'090E: set_panel [email protected] active_row  0:MenueTempW_1wait  0if0256:   player $PLAYER_CHAR definedjf @MenueTempW_21if00E1:   key_pressed  0  15//--- key = Enter/Exitjf @MenueTempW_2jump @MenueTempW_21//--jump to menue exit:MenueTempW_2if00E1:   key_pressed  0  16//--- key = Ped SPRINTjf @MenueTempW_103E6: remove_text_box08D7: [email protected] = panel [email protected] active_row//-- submit number of the highlighted button into variableif0039:   [email protected] ==  0  // integer valuesjf @MenueTempW_301B6: set_weather  1// = SUNNY_LAjump @MenueTempW_1:MenueTempW_3if0039:   [email protected] ==  1  // integer valuesjf @MenueTempW_401B6: set_weather  4// = CLOUDY_LAjump @MenueTempW_1:MenueTempW_4if0039:   [email protected] ==  2  // integer valuesjf @MenueTempW_501B6: set_weather  5// = SUNNY_SFjump @MenueTempW_1:MenueTempW_5if0039:   [email protected] ==  3  // integer valuesjf @MenueTempW_601B6: set_weather  8// = RAINY_SFjump @MenueTempW_1:MenueTempW_6if0039:   [email protected] ==  4  // integer valuesjf @MenueTempW_701B6: set_weather  9// = FOGGY_SFjump @MenueTempW_1:MenueTempW_7if0039:   [email protected] ==  5  // integer valuesjf @MenueTempW_801B6: set_weather  10// = SUNNY_VEGASjump @MenueTempW_1:MenueTempW_8if0039:   [email protected] ==  6  // integer valuesjf @MenueTempW_901B6: set_weather  12// = CLOUDY_VEGASjump @MenueTempW_1:MenueTempW_9if0039:   [email protected] ==  7  // integer valuesjf @MenueTempW_1001B6: set_weather  14// = SUNNY_COUNTRYSIDEjump @MenueTempW_1:MenueTempW_10if0039:   [email protected] ==  8  // integer valuesjf @MenueTempW_1101B6: set_weather  16// = RAINY_COUNTRYSIDEjump @MenueTempW_1:MenueTempW_11if0039:   [email protected] ==  9  // integer valuesjf @MenueTempW_1201B6: set_weather  17// = EXTRASUNNY_DESERTjump @MenueTempW_1:MenueTempW_12if0039:   [email protected] ==  10  // integer valuesjf @MenueTempW_1301B6: set_weather  19// = SANDSTORM_DESERTjump @MenueTempW_1:MenueTempW_13if0039:   [email protected] ==  11  // integer valuesjf @MenueTempW_101B7: release_weatherjump @MenueTempW_21:MenueTempW_2108DA: remove_panel [email protected] @MenueTempW_01

 

 

 

The script have one more keypress-check to remove the menue:

 

if00E1:   key_pressed  0  15//--- key = Enter/Exitjf @MenueTempW_2jump @MenueTempW_21//--jump to menue exit

 

 

 

 

and then there's this code:

 

090E: set_panel [email protected] active_row  0

 

 

It selects a button when the menue is shown.

 

 

 

 

 

 

 

Another script construct:

 

Only 1 Loop with var value check to select script blocksif  and0AB0:   key_pressed 8//--- key = Backspace  [email protected] == 0jf @Menue_108D4: [email protected] = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  008DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'090E: set_panel [email protected] active_row  [email protected] = [email protected] == 1jf @Menue_01get button ID while menue is shown to let something happen:[email protected] == 1jf @Menue_0108DA: remove_panel [email protected]@ = 0jump @Menue_01

 

 

 

 

Example:

 

{$CLEO .cs}:Menue03A4: name_thread 'Menue'[email protected] = 0:Menue_01wait  0if0256:   player $PLAYER_CHAR definedjf @Menue_21if  and0AB0:   key_pressed 8//--- key = Backspace  [email protected] == 0jf @Menue_108D4: [email protected] = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  008DB: set_panel [email protected] column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'090E: set_panel [email protected] active_row  [email protected] = 1:Menue_1wait  [email protected] == 1jf @Menue_01if00E1:   key_pressed  0  15//--- key = Enter/Exitjf @Menue_2jump @Menue_21//--jump to menue exit:Menue_2if00E1:   key_pressed  0  16//--- key = Ped SPRINTjf @Menue_103E6: remove_text_box08D7: [email protected] = panel [email protected] active_row//-- submit number of the highlighted button into variableif0039:   [email protected] ==  0  // integer valuesjf @Menue_301B6: set_weather  1// = SUNNY_LAjump @Menue_1:Menue_3if0039:   [email protected] ==  1  // integer valuesjf @Menue_101B6: set_weather  4// = CLOUDY_LAjump @Menue_1:[email protected] == 1jf @Menue_0108DA: remove_panel [email protected]@ = 0jump @Menue_01

 

 

 

 

 

 

 

 

High Level script construct with var value check, menue subscripts and jumptables:

(R* menues are mostly done in that way)

 

 

 

 

 

{$CLEO .cs}:MENUE_AND_JUMPTABLE_TEMPLATE03A4: name_thread 'MENUEJP'const  L_PANEL_VAR = [email protected]_ACTIVE_ROW_VAR = [email protected]_PANEL_IS_SHOWN_VAR = [email protected] truewait 0   if       0256:   player $PLAYER_CHAR defined   then           if               L_PANEL_IS_SHOWN_VAR  == 0           then                       if  and                       00E1:   key_pressed  0  9//--- key = GROUP_CONTROL_BWD                       80DF:   not actor $PLAYER_ACTOR driving                   then                       gosub @MENU_1                   end           else// if menue is shown, if L_PANEL_IS_SHOWN_VAR  == 1                   if                       00E1:   key_pressed  0  16//--- key = Ped SPRINT                   then                       gosub @Selection_1                   end                   if                       00E1:   key_pressed  0  15//--- key = Enter/Exit                   then                       gosub @Remove_panel                   end           end   else//if player dies or gets arrested           if               L_PANEL_IS_SHOWN_VAR  == 1           then               gosub @Remove_panel//if player dies or gets arrested while meue is shown           end       endend:MENU_108D4: L_PANEL_VAR = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  008DB: set_panel L_PANEL_VAR column 0 header 'PLA_19' data 'DEBW1' 'DEBW2' 'DEBW3' 'DEBW4' 'DEBW5' 'DEBW6' 'DEBW7' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW11' 'DEBW12'L_PANEL_IS_SHOWN_VAR = 1return:Remove_panel08DA: remove_panel L_PANEL_VARL_PANEL_IS_SHOWN_VAR = 0  return:Selection_108D7: L_ACTIVE_ROW_VAR = panel L_PANEL_VAR active_row0871: init_jump_table L_ACTIVE_ROW_VAR total_jumps  12  0 @Sel_T00 jumps  0 @Sel_T01  1 @Sel_T11  2 @Sel_T22  3 @Sel_T33  4 @Sel_T44  5 @Sel_T55 6 @Sel_T660872: jump_table_jumps  7 @Sel_T77  8 @Sel_T88  9 @Sel_T99  10 @Sel_T101  11 @Sel_T111  -1 @Sel_T00  -1 @Sel_T00  -1 @Sel_T00  -1 @Sel_T00:Sel_T00// here goes the code if the value of the variable not exist in the jumptable00BA: text_styled 'fem_off'  1000 ms  4wait 1000jump @Sel_EXIT:Sel_T01set_weather  0// = Extra Sunny LAjump @Sel_EXIT:Sel_T11set_weather  1// = Sunny LAjump @Sel_EXIT:Sel_T22set_weather  2// = Sunny LAjump @Sel_EXIT:Sel_T33set_weather  3// = Sunny Smog LAjump @Sel_EXIT:Sel_T44set_weather  4// = Cloudy LAjump @Sel_EXIT:Sel_T55set_weather  5// = Sunny SFjump @Sel_EXIT:Sel_T66set_weather  6// = Extra Sunny SFjump @Sel_EXIT:Sel_T77set_weather  7// = Cloudy SFjump @Sel_EXIT:Sel_T88set_weather  8// = Rainy SFjump @Sel_EXIT:Sel_T99set_weather  9// = Foggy SFjump @Sel_EXIT:Sel_T101set_weather  10// = Sunny LVjump @Sel_EXIT:Sel_T111set_weather  11// Extra Sunny LVjump @Sel_EXIT:Sel_EXITreturn
Edited by ZAZ
Link to post
Share on other sites
  • 2 weeks later...

How to use opcodes:

 

0494: get_joystick 0 data_to $MOVE_AXIS_X $MOVE_AXIS_Y $SPECIAL_AXIS_X $SPECIAL_AXIS_Y 0871: init_jump_table $VIDEO_GAME total_jumps 8 default_jump 0 @END_CASE_VIDEO_GAME jumps 0 @MS_GAME_THEYCRAWLEDFROMURANUS 1 @MS_GAME_DUALITY 2 @MS_GAME_GOGOSPACEMONKEY 3 @MS_GAME_LETSGETREADYTOBUMBLE 4 @MS_GAME_TRACKBETTING 5 @MS_GAME_POOL 6 @MS_GAME_LOWRIDER 

 

 

Link to post
Share on other sites

JumpTable

 

define a variable

1@ = 3

the value of the variable decides where the code should jump to

0871: init_jump_table 1@ total_jumps  7  0 @JPTABL_T00 jumps  0 @JPTABL_T01  1 @JPTABL_T11  2 @JPTABL_T22  3 @JPTABL_T33  4 @JPTABL_T44  5 @JPTABL_T55 6 @JPTABL_T66

the meaning:

<opcode> <description> <jumpvariable> <description> <total-amount-of-jumpinstructions> <jumpinstruction to exit if the value of the variable not exist in the jumptable> <description> <7 x jumpinstruction>

 

again, let's remove the opcode and description

 

 

1. parameter: jumpvariable

 

2. parameter: total-amount-of-jumpinstructions

 

3.+4.parameter: jumpinstruction to exit if the value of the variable not exist in the jumptable

 

5.-14.parameter: 7 x jumpinstruction

 

 

total-amount-of-jumpinstructions:

the table of opcode 0871: can have max 7 jumps

the table of opcode 0872: can have max 9 jumps

 

the exit-jumpinstruction(3.+4.parameter) don't counts for the total-amount-of-jumpinstructions

 

adding more lines of opcode 0872: to the opcode 0871:-line can increase the total-amount-of-jumpinstructions

max. 75 jumps

 

 

0871: init_jump_table 1@ total_jumps  23  0 @JPTABL_T00 jumps  0 @JPTABL_T01  1 @JPTABL_T11  2 @JPTABL_T22  3 @JPTABL_T33  4 @JPTABL_T44  5 @JPTABL_T55 6 @JPTABL_T66
0872: jump_table_jumps  7 @JPTABL_T77  8 @JPTABL_T88  9 @JPTABL_T99  10 @JPTABL_T101  11 @JPTABL_T111  12 @JPTABL_T122  13 @JPTABL_T133  14 @JPTABL_T144  15 @JPTABL_T155
0872: jump_table_jumps  16 @JPTABL_T166  17 @JPTABL_T177  18 @JPTABL_T188  19 @JPTABL_T199  20 @JPTABL_T201  21 @JPTABL_T211  22 @JPTABL_T222  -1 @JPTABL_T00  -1 @JPTABL_T00

 

7 x jumpinstruction

0 @JPTABL_T01 1 @JPTABL_T11 2 @JPTABL_T22 3 @JPTABL_T33 4 @JPTABL_T44 5 @JPTABL_T55 6 @JPTABL_T66

 

a jumpinstruction have 2 parameter

0 @JPTABL_T01

first the value which must be equal with the value of the jumpvariable to allocate the jump adress

second the allocated jump adress if the value infront is equal to the jumpvariable

 

Examplescript below:

change the weather by keypress SHIFT

the variable [email protected] decides where the code should jump to

[email protected] will be changed at the end of the table by adding 1

if [email protected] is bigger than 6 then it jumps to the

<"jumpinstruction to exit if the value of the variable not exist in the jumptable">,

to @JPTABL_T00

 

{$CLEO .cs}
:JUMPTABLE
03A4: name_thread 'JPTABL'
1@ = 0

:JPTABL_1
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
jf @JPTABL_1
03F0: enable_text_draw 1
045A: text_draw_1number  400.0  50.0 'NUMBER' 1@    // value
if
0AB0:   key_pressed 16 // -- shift
jf @JPTABL_1

:JPTABL_Table
0871: init_jump_table 1@ total_jumps  7  0 @JPTABL_T00 jumps  0 @JPTABL_T01  1 @JPTABL_T11  2 @JPTABL_T22  3 @JPTABL_T33  4 @JPTABL_T44  5 @JPTABL_T55 6 @JPTABL_T66

:JPTABL_T00// here goes the code if the value of the variable not exist in the jumptable
00BA: text_styled 'fem_off'  1000 ms  4
wait 1000
0002: jump @JPTABL_1

:JPTABL_T01
01B6: set_weather  0// = Extra Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T11
01B6: set_weather  1// = Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T22
01B6: set_weather  2// = Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T33
01B6: set_weather  3// = Sunny Smog LA
0002: jump @JPTABL_EXIT

:JPTABL_T44
01B6: set_weather  4// = Cloudy LA
0002: jump @JPTABL_EXIT

:JPTABL_T55
01B6: set_weather  5// = Sunny SF
0002: jump @JPTABL_EXIT

:JPTABL_T66
01B6: set_weather  6// = Extra Sunny SF
0002: jump @JPTABL_EXIT

:JPTABL_EXIT
1@ +=  1
0001: wait  1000 ms
0002: jump @JPTABL_1

 

 

 

Examplescript below is the extended version of script above

by adding 16 jumps with opcode 0872:

 

{$CLEO .cs}
:JUMPTABLE
03A4: name_thread 'JPTABL'
1@ = 0

:JPTABL_1
0001: wait  0 ms
if
0256:   player $PLAYER_CHAR defined
jf @JPTABL_1
03F0: enable_text_draw 1
045A: text_draw_1number  400.0  50.0 'NUMBER' 1@    // value
if
0AB0:   key_pressed 16 // -- shift
jf @JPTABL_1

:JPTABL_Table
0871: init_jump_table 1@ total_jumps  23  0 @JPTABL_T00 jumps  0 @JPTABL_T01  1 @JPTABL_T11  2 @JPTABL_T22  3 @JPTABL_T33  4 @JPTABL_T44  5 @JPTABL_T55 6 @JPTABL_T66
0872: jump_table_jumps  7 @JPTABL_T77  8 @JPTABL_T88  9 @JPTABL_T99  10 @JPTABL_T101  11 @JPTABL_T111  12 @JPTABL_T122  13 @JPTABL_T133  14 @JPTABL_T144  15 @JPTABL_T155
0872: jump_table_jumps  16 @JPTABL_T166  17 @JPTABL_T177  18 @JPTABL_T188  19 @JPTABL_T199  20 @JPTABL_T201  21 @JPTABL_T211  22 @JPTABL_T222  -1 @JPTABL_T00  -1 @JPTABL_T00


:JPTABL_T00// here goes the code if the value of the variable not exist in the jumptable
00BA: text_styled 'fem_off'  1000 ms  4
wait 1000
0002: jump @JPTABL_1

:JPTABL_T01
01B6: set_weather  0// = Extra Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T11
01B6: set_weather  1// = Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T22
01B6: set_weather  2// = Sunny LA
0002: jump @JPTABL_EXIT

:JPTABL_T33
01B6: set_weather  3// = Sunny Smog LA
0002: jump @JPTABL_EXIT

:JPTABL_T44
01B6: set_weather  4// = Cloudy LA
0002: jump @JPTABL_EXIT

:JPTABL_T55
01B6: set_weather  5// = Sunny SF
0002: jump @JPTABL_EXIT

:JPTABL_T66
01B6: set_weather  6// = Extra Sunny SF
0002: jump @JPTABL_EXIT

:JPTABL_T77
01B6: set_weather  7// = Cloudy SF
0002: jump @JPTABL_EXIT

:JPTABL_T88
01B6: set_weather  8// = Rainy SF
0002: jump @JPTABL_EXIT

:JPTABL_T99
01B6: set_weather  9// = Foggy SF
0002: jump @JPTABL_EXIT

:JPTABL_T101
01B6: set_weather  10// = Sunny LV
0002: jump @JPTABL_EXIT

:JPTABL_T111
01B6: set_weather  11// Extra Sunny LV
0002: jump @JPTABL_EXIT

:JPTABL_T122
01B6: set_weather  12// Cloudy LV
0002: jump @JPTABL_EXIT

:JPTABL_T133
01B6: set_weather  13// Extra Sunny Country
0002: jump @JPTABL_EXIT

:JPTABL_T144
01B6: set_weather  14// Sunny Country
0002: jump @JPTABL_EXIT

:JPTABL_T155
01B6: set_weather  15// Cloudy Country
0002: jump @JPTABL_EXIT

:JPTABL_T166
01B6: set_weather  16// Rainy Country
0002: jump @JPTABL_EXIT

:JPTABL_T177
01B6: set_weather  17// Extra Sunny Desert
0002: jump @JPTABL_EXIT

:JPTABL_T188
01B6: set_weather  18// Sunny Desert
0002: jump @JPTABL_EXIT

:JPTABL_T199
01B6: set_weather  19// Sandstorm Desert
0002: jump @JPTABL_EXIT

:JPTABL_T201
01B6: set_weather  20// Underwater
0002: jump @JPTABL_EXIT

:JPTABL_T211
01B6: set_weather  21// Extracolours 1
0002: jump @JPTABL_EXIT

:JPTABL_T222
01B6: set_weather  22// Extracolours 2
0002: jump @JPTABL_EXIT


:JPTABL_EXIT
1@ +=  1
0001: wait  1000 ms
0002: jump @JPTABL_1

 

 

 

 

 

______________________________________________________________

 

 

0494: get_joystick_data 0 [email protected] [email protected] [email protected] [email protected]

this opcode reads values of the presetted movement controle of keyboard, joystick or gamepad

depending to the settings which are done in Pause menue>options>controler settings

of <left/right> <forward/backward>

 

1.param: playervalue, player 1 = 0, player 2 = 1

2.param: values of <left/right>

3.param: values of <forward/backward>

4.param: unknown

5.param: unknown

 

2. and 3. param returns either negativ or positiv values each which button is pressed

so you need to check if the value is smaller or bigger than 0 to differ if the player use forward or backward

left or right

 

script below shows the values which opcode 0494: returns by pressing left or right or forward or backward

 

{$CLEO .cs}
:Joystick_data
03A4: name_thread 'JOYDATA'

:JOYDATA_1
wait 0
0494: get_joystick_data  0 1@ 2@ 3@ 4@
if 
1@ >  0
004D: jump_if_false @JOYDATA_04
03F0: enable_text_draw 1
045A: text_draw_1number  250.0  250.0 'NUMBER' 1@    // value
0002: jump @JOYDATA_07

:JOYDATA_04
if 
0 > 1@
004D: jump_if_false @JOYDATA_07
03F0: enable_text_draw 1
045A: text_draw_1number  350.0  250.0 'NUMBER' 1@    // value
0002: jump @JOYDATA_07

:JOYDATA_07 
if 
2@ >  0
004D: jump_if_false @JOYDATA_09
03F0: enable_text_draw 1
045A: text_draw_1number  300.0  200.0 'NUMBER' 2@    // value 
0002: jump @JOYDATA_10

:JOYDATA_09
if 
0 > 2@
004D: jump_if_false @JOYDATA_10
03F0: enable_text_draw 1
045A: text_draw_1number  300.0  300.0 'NUMBER' 2@    // value
0002: jump @JOYDATA_10

:JOYDATA_10
0002: jump @JOYDATA_1

 

 

 

 

 

 

 

______________________________________________________________

 

 

0A4A: store_joystick_X_offset_to [email protected] Y_offset_to [email protected]

 

opcode 0A4A: gives also the mouse movement

try this script to see which values this opcode returns

 

 

{$CLEO .cs}
:MControl_00
03A4: name_thread 'MCONTRL'


:MControl_01
wait 0
0A4A: store_joystick_X_offset_to 1@ Y_offset_to 2@
0092: 4@ = float_to_integer 1@  
0092: 5@ = float_to_integer 2@
03F0: enable_text_draw 1
045A: text_draw_1number  200.0  50.0 'NUMBER' 4@    // value
045A: text_draw_1number  350.0  50.0 'NUMBER' 5@    // value
0002: jump @MControl_01

 

 

Edited by ZAZ
  • Like 1
Link to post
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
  • 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.