# [SA] ~ CLEO Script Tutorial ~

## Recommended Posts

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

##### Share on other sites

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

##### Share on other sites

I have still questions....

How do you calculate offsets?

How to make search lights?

How to make a particle like smoke?

##### Share on other sites

(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?

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) Edited by EdUaRdO - Brazil ##### Link to comment ##### 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 0@ 1@ 2@ 068E: get_camera_target_point_to 3@ 4@ 5@ if 0AB0: key_pressed 88 else_jump @CAM_11 if Player.Defined($PLAYER_CHAR)else_jump @CAM_11 if File.Open(10@, "CLEO\CAM.INI", 119)else_jump @CAM_11 0AD9: write_formatted_text "CAMERA.SETPOSITION(%G, %G, %G, 0.0, 0.0, 0.0)" 10@ 0@ 1@ 2@  0AD9: write_formatted_text "CAMERA.POINTAT(%G, %G, %G, 2)" 10@ 3@ 4@ 5@  File.Close(10@)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

##### 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

##### 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?

##### 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 40@ 47@ size 54@ 61@ RGBA 0 0 0 255 038E: draw_box_position 39@ 46@ size 53@ 60@ RGBA 134 155 184 255 038E: draw_box_position 34@ 41@ size 48@ 55@ RGBA 0 0 0 255

##### 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 :CARL2_953561@ = Actor.Create(Mission1, #LSV1, 2411.647, -1308.872, 24.6667)Actor.Angle(561@) = 181.940901B2: give_actor 561@ weapon 28 ammo 30000 // Load the weapon model before using this 0568: set_actor 561@ targetable 1 Actor.Armour(561@) = 100077A: set_actor 561@ acquaintance 0 to_actors_pedtype 24 // see ped.dat 02A9: set_actor 561@ immune_to_nonplayer 1 0446: set_actor 561@ immune_to_headshots 0 060B: set_actor 561@ decision_maker_to 266@ 0638: AS_actor 561@ stay_put 1 347@ = Marker.CreateAboveActor(561@)018B: set_marker 347@ radar_mode 2 Marker.SetIconSize(347@, 2)Model.Destroy(#MICRO_UZI)Model.Destroy(#LSV1)

##### 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 12@ 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 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 0.0 4.0 0.2009A: 1@ = create_actor 24 #VMAFF1 at 21@ 22@ 23@21@ += 2.0009A: 2@ = create_actor 24 #VMAFF2 at 21@ 22@ 23@21@ -= 4.0009A: 3@ = create_actor 24 #VMAFF3 at 21@ 22@ 23@01B2: give_actor 1@ weapon 24 ammo 99999 // Load the weapon model before using this02E2: set_actor 1@ weapon_accuracy_to 3005E2: AS_actor 1@ kill_actor$PLAYER_ACTOR01B2: give_actor 2@ weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to  3005E2: AS_actor 2@ kill_actor $PLAYER_ACTOR01B2: give_actor 3@ weapon 24 ammo 99999 // Load the weapon model before using this02E2: set_actor 3@ weapon_accuracy_to 3005E2: AS_actor 3@ kill_actor$PLAYER_ACTOR0187: 11@ = create_marker_above_actor 1@0187: 12@ = create_marker_above_actor 2@0187: 13@ = create_marker_above_actor 3@15@ = 016@ = 017@ = 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 1@ dead004D: jump_if_false @ACTDDMK_15if15@ == 0004D: jump_if_false @ACTDDMK_150164: disable_marker 11@15@ = 1:ACTDDMK_15if0118: actor 2@ dead004D: jump_if_false @ACTDDMK_17if16@ == 0004D: jump_if_false @ACTDDMK_170164: disable_marker 12@16@ = 1:ACTDDMK_17if0118: actor 3@ dead004D: jump_if_false @ACTDDMK_19if17@ == 0004D: jump_if_false @ACTDDMK_190164: disable_marker 13@17@ = 1:ACTDDMK_19if and0118: actor 1@ dead0118: actor 2@ dead0118: actor 3@ dead004D: jump_if_false @ACTDDMK_13:ACTDDMK_23_cleanupif15@ == 0004D: jump_if_false @ACTDDMK_250164: disable_marker 11@:ACTDDMK_25if16@ == 0004D: jump_if_false @ACTDDMK_270164: disable_marker 12@:ACTDDMK_27if17@ == 0004D: jump_if_false @ACTDDMK_300164: disable_marker 13@:ACTDDMK_3001C2: remove_references_to_actor 1@01C2: remove_references_to_actor 2@01C2: remove_references_to_actor 3@0002: 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 21@ 22@ 23@ from_actor$PLAYER_ACTOR offset 0.0  4.0  0.2009A: 1@ = create_actor  24 #VMAFF1 at  21@ 22@ 23@21@ += 2.0009A: 2@ = create_actor  24 #VMAFF2 at  21@ 22@ 23@21@ -= 4.0009A: 3@ = create_actor  24 #VMAFF3 at  21@ 22@ 23@01B2: give_actor 1@ weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor 1@ weapon_accuracy_to  3005E2: AS_actor 1@ kill_actor $PLAYER_ACTOR01B2: give_actor 2@ weapon 24 ammo 99999 // Load the weapon model before using this02E2: set_actor 2@ weapon_accuracy_to 3005E2: AS_actor 2@ kill_actor$PLAYER_ACTOR01B2: give_actor 3@ weapon  24 ammo  99999  // Load the weapon model before using this02E2: set_actor 3@ weapon_accuracy_to  3005E2: AS_actor 3@ kill_actor $PLAYER_ACTOR0187: 11@ = create_marker_above_actor 1@0187: 12@ = create_marker_above_actor 2@0187: 13@ = create_marker_above_actor 3@0249: 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 1@ dead004D: jump_if_false @ACTDDMK_15if075C:   marker 11@ enabled004D: jump_if_false @ACTDDMK_150164: disable_marker 11@:ACTDDMK_15if0118:   actor 2@ dead004D: jump_if_false @ACTDDMK_17if075C:   marker 12@ enabled004D: jump_if_false @ACTDDMK_170164: disable_marker 12@:ACTDDMK_17if0118:   actor 3@ dead004D: jump_if_false @ACTDDMK_19if075C:   marker 13@ enabled004D: jump_if_false @ACTDDMK_190164: disable_marker 13@:ACTDDMK_19if  and0118:   actor 1@ dead0118:   actor 2@ dead0118:   actor 3@ dead004D: jump_if_false @ACTDDMK_13:ACTDDMK_23_cleanupif075C:   marker 11@ enabled004D: jump_if_false @ACTDDMK_250164: disable_marker 11@:ACTDDMK_25if075C:   marker 12@ enabled004D: jump_if_false @ACTDDMK_270164: disable_marker 12@:ACTDDMK_27if075C:   marker 13@ enabled004D: jump_if_false @ACTDDMK_300164: disable_marker 13@:ACTDDMK_3001C2: remove_references_to_actor 1@01C2: remove_references_to_actor 2@01C2: remove_references_to_actor 3@0002: jump @ACTDDMK_1

Edited by ZAZ
##### 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 50000@ = -64.01@ = 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 0@ 60.67 size 128.0 119.47 RGBA 255 255 255 25503E3: set_texture_to_be_drawn_antialiased 1:PAGER_134wait 0if not 0@ > 64.0jf @PAGER_1810@ += 2.0jump @PAGER_920AB2: ret 0:PAGER_181wait 0if not 0@ == 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
##### Share on other sites

What this opcode means?

0407: create_coordinate 11@ 12@ 13@ from_car 1@ offset -10.0 15.0 0.0

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

##### 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 50000@ = -64.01@ = 64.00390: load_txd_dictionary 'LD_BEAT'038F: load_texture "upr" as 1 // Load dictionary with 0390 firstAudiostream.Load(25@, "CLEO\GTA3PAGER.MP3")Audiostream.PerformAction(25@, PLAY):PAGER_92wait 003F0: enable_text_draw 1038D: draw_texture 1 position 0@ 60.67 size 128.0 119.47 RGBA 255 255 255 25503E3: set_texture_to_be_drawn_antialiased 1 if64.0 > 0@jf @PAGER_920@ += 2.0jump @PAGER_92 What this opcode means? 0407: create_coordinate 11@ 12@ 13@ from_car 1@ 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 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 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 Now let's place a pyramid at the top of the car like in picture below You can do it ingame with script by using this opcode: 0407: create_coordinate 11@ 12@ 13@ from_car 0@ offset 0.0 2.0 0.00107: 25@ = create_object 1240 at 11@ 12@ 13@ 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 25@ to_car 0@ 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 comment ##### Share on other sites Nothing. Post must be deleted. Edited by gtasite1 ##### Link to comment ##### 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!! >>>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: 5@ = weekday 00BF: 6@ = current_time_hours, 7@ = current_time_minutes 0006: 8@ = 899 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_11 00D6: if and0039: 5@ == 2 0039: 6@ == 6 0039: 7@ == 20 004D: jump_if_false @CDRIVE_452 0247: load_model #CORVETT 0247: load_model #CROGRL3 0247: load_model #SBFYPRO 07C0: load_path 8@ :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: 2@ = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.6875 0173: set_actor 2@ Z_angle_to 90.0 009A: 3@ = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.6875 0173: set_actor 3@ Z_angle_to 90.0 00A5: 1@ = create_car #CORVETT at -1990.812 145.1061 27.3718 0175: set_car 1@ Z_angle_to 0.0 0186: 4@ = create_marker_above_car 1@0187: 11@ = create_marker_above_actor 2@0187: 12@ = create_marker_above_actor 3@ 07E0: set_marker 4@ type_to 207E0: set_marker 11@ type_to 307E0: set_marker 12@ type_to 4 0249: release_model #CORVETT 0249: release_model #CROGRL3 0249: release_model #SBFYPRO 05CB: AS_actor 2@ enter_car 1@ as_driver 10000 ms 05CA: AS_actor 3@ enter_car 1@ passenger_seat 0 10000 ms :CDRIVE_2860001: wait 0 ms 00D6: if and00DB: actor 2@ in_car 1@ 00DB: actor 3@ in_car 1@ 07C1: path 8@ available 004D: jump_if_false @CDRIVE_286 05EB: assign_car 1@ to_path 8@ 004D: jump_if_false @CDRIVE_286 :CDRIVE_3610001: wait 0 ms00BF: 9@ = current_time_hours, 10@ = current_time_minutes 00D6: if and0256: player$PLAYER_CHAR defined0039:   9@ == 80039:   10@ == 30004D: jump_if_false @CDRIVE_3610633: AS_actor 2@ exit_car 1@0633: AS_actor 3@ exit_car 1@:CDRIVE_3630001: wait 1000 ms00D6: if0256:   player $PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_36305F5: AS_actor 2@ goto_point -2624.6763 1412.7266 7.0937 mode 4 5500 ms // versionB0637: AS_actor 3@ 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 1@ from_path 0873: release_path 8@ 01C3: remove_references_to_car 1@ // Like turning a car into any random car 01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian 0164: disable_marker 4@0164: disable_marker 11@0164: disable_marker 12@ :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 comment ##### 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 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 8@:CDRIVE_1050001: wait 0 ms00D6: if and0248:   model #INFERNUS available0248:   model #CROGRL3 available0248:   model #SBFYPRO available004D: jump_if_false @CDRIVE_105009A: 2@ = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.68750173: set_actor 2@ Z_angle_to 90.0009A: 3@ = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.68750173: set_actor 3@ Z_angle_to 90.000A5: 1@ = create_car #INFERNUS at -1990.812 145.1061 27.37180175: set_car 1@ Z_angle_to 0.00186: 4@ = create_marker_above_car 1@0187: 11@ = create_marker_above_actor 2@0187: 12@ = create_marker_above_actor 3@07E0: set_marker 4@ type_to 207E0: set_marker 11@ type_to 307E0: set_marker 12@ type_to 40249: release_model #INFERNUS0249: release_model #CROGRL30249: release_model #SBFYPRO05CB: AS_actor 2@ enter_car 1@ as_driver 10000 ms05CA: AS_actor 3@ enter_car 1@ 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 2@ dead8118:   NOT   actor 3@ dead8119:   NOT   car 1@ wrecked004D: jump_if_false @CDRIVE_37000D6: if and00DB:   actor 2@ in_car 1@00DB:   actor 3@ in_car 1@07C1:   path 8@ available004D: jump_if_false @CDRIVE_28605EB: assign_car 1@ to_path 8@004D: jump_if_false @CDRIVE_28633@ = 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 2@ dead8118:   NOT   actor 3@ dead8119:   NOT   car 1@ wrecked004D: jump_if_false @CDRIVE_370if33@ == 5000004D: jump_if_false @CDRIVE_3610633: AS_actor 2@ exit_car 1@0633: AS_actor 3@ exit_car 1@: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 2@ dead8118:   NOT   actor 3@ dead004D: jump_if_false @CDRIVE_37005F5: AS_actor 2@ goto_point -2624.6763 1412.7266 7.0937 mode 4 5500 ms // versionB0637: AS_actor 3@ 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 1@ from_path0873: release_path 8@01C3: remove_references_to_car 1@ // Like turning a car into any random car01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian0164: disable_marker 4@0164: disable_marker 11@0164: disable_marker 12@: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 oclock and 2 oclock The variable 3@ 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"3@ = 0:GameTime_2wait 000BF: 0@ = current_time_hours, 1@ = current_time_minutesif or0@ >= 222 > 0@jf @GameTime_3  if3@ == 0jf @GameTime_308B2: enable_thermal_vision 13@ = 1:GameTime_3if and0@ > 122 > 0@3@ == 1jf @GameTime_208B2: enable_thermal_vision 03@ = 0jump @GameTime_2

read more in MATH CODING

Edited by ZAZ
##### Share on other sites

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: 5@ = weekday 00BF: 6@ = current_time_hours, 7@ = current_time_minutes 00D6: if 0256: player$PLAYER_CHAR defined 004D: jump_if_false @CDRIVE_11 if and0039:   5@ == 2 0039:   6@ == 6 0039:   7@ == 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: 2@ = create_actor_pedtype 24 model #CROGRL3 at -1983.4121 154.3342 27.6875 0173: set_actor 2@ Z_angle_to 90.0 009A: 3@ = create_actor_pedtype 24 model #SBFYPRO at -1985.1122 138.0835 27.6875 0173: set_actor 3@ Z_angle_to 90.0 00A5: 1@ = create_car #INFERNUS at -1990.7504 145.0000 27.2389 0175: set_car 1@ Z_angle_to 0.00186: 4@ = create_marker_above_car 1@0187: 11@ = create_marker_above_actor 2@0187: 12@ = create_marker_above_actor 3@ 07E0: set_marker 4@ type_to 207E0: set_marker 11@ type_to 307E0: set_marker 12@ type_to 4 0249: release_model #INFERNUS 0249: release_model #CROGRL3 0249: release_model #SBFYPRO 05CB: AS_actor 2@ enter_car 1@ as_driver 10000 ms 05CA: AS_actor 3@ enter_car 1@ passenger_seat 0 10000 ms :CDRIVE_2860001: wait 0 ms if and00DB:   actor 2@ in_car 1@ 00DB:   actor 3@ in_car 1@  004D: jump_if_false @CDRIVE_286 0615: define_action_sequences 8@05D1: AS_actor -1 drive_car 1@ to  -2000.0087 311.5435 35.0156 speed  20.0  0  0  505D1: AS_actor -1 drive_car 1@ to  -2136.1233 322.64 35.1622 speed  20.0  0  0  505D1: AS_actor -1 drive_car 1@ to  -2155.6082 118.341 35.1719 speed  20.0  0  0  505D1: AS_actor -1 drive_car 1@ to  -2017.871 105.7274 27.5937 speed  20.0  0  0  505D1: AS_actor -1 drive_car 1@ to  -1998.5907 450.4262 35.0595 speed  40.0  0  0  505CD: AS_actor -1 exit_car 1@0616: define_action_sequences_end 8@0618: assign_actor 2@ to_action_sequences 8@061B: remove_references_to_AS_pack 8@ 004D: jump_if_false @CDRIVE_286 :CDRIVE_3610001: wait 0 ms if and0256:   player $PLAYER_CHAR defined0206: actor 2@ near_car 1@ radius 5.0 5.0 3.0 flag 0 on_foot004D: jump_if_false @CDRIVE_3610633: AS_actor 3@ exit_car:CDRIVE_3620001: wait 1000 msif and0256: player$PLAYER_CHAR defined0206:   actor 3@ near_car 1@ radius 5.0 5.0 3.0 flag 0 on_foot 004D: jump_if_false @CDRIVE_36207CD: AS_actor 2@ walk_to -1962.2249 439.3388 35.1719 stop_with_angle 270.0 within_radius 4.007CD: AS_actor 3@ 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 1@ // Like turning a car into any random car 01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor 3@ // Like turning an actor into a random pedestrian 0164: disable_marker 4@0164: disable_marker 11@0164: disable_marker 12@: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 3@ 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 comment ##### Share on other sites 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. 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? Any advice is of course greatly appreciated. ##### Link to comment ##### 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 3@ 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. 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? 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 comment ##### Share on other sites 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 "25@= coords XYX values " ,then check if "25@== 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 comment ##### 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 "25@= coords XYX values " ,then check if "25@== 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: 1@ = read_memory 13112096 size 4 virtual_protect 1 00D6: if or0039: 1@ == 8//rainy 0039: 1@ == 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 comment ##### Share on other sites How to create corona with array :PCJONDOCKS_1330wait 0 if 27 > 30@ jf @aa04D5: create_corona_at$5610(30@,27f) $5639(30@,27f)$5668(30@,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(30@,27f)$5639(30@,27f) $5668(30@,27f) 30@ += 1 jump @PCJONDOCKS_1330 :aa30@ = 0  but i don't know which does not appear ##### Link to comment ##### Share on other sites How to create corona with array :PCJONDOCKS_1330wait 0 if 27 > 30@ jf @aa04D5: create_corona_at$5610(30@,27f) $5639(30@,27f)$5668(30@,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(30@,27f)$5639(30@,27f) $5668(30@,27f) 30@ += 1 jump @PCJONDOCKS_1330 :aa30@ = 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 > 30@jf @aa04D5: create_corona_at$5610(30@,27f) $5639(30@,27f)$5668(30@,27f) radius 1.0 type 2 flare 2 RGB 0 255 0

in this way with locals

0@ = 2495.53 10@ = -1711.88 20@ = 1014.24 1@ = 1263.05 11@ = -773.67 21@ = 1091.39 2@ = 416.9548 12@ = 2538.813 22@ = 9.5077 3@ = 2367.192 13@ = -1121.518 23@ = 1050.382:PCJONDOCKS_1330wait 0if27 > 30@jf @aa04D5: create_corona_at 0@(30@,27f) 10@(30@,27f) 20@(30@,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 > 30@jf @aa04C4: create_coordinate 0@(30@,27f) 10@(30@,27f) 20@(30@,27f) from_actor $PLAYER_ACTOR offset 0.0 31@ 0.204D5: create_corona_at 0@(30@,27f) 10@(30@,27f) 20@(30@,27f) radius 1.0 type 2 flare 2 RGB 0 255 0 000B: 31@ += 2.0 // add 2.0 to the y offset for spawn coords000A: 30@ += 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 > 30@jf @aa04C4: create_coordinate 11@ 12@ 13@ from_actor$PLAYER_ACTOR offset 0.0  31@  0.204D5: create_corona_at 11@ 12@ 13@ radius 1.0 type 2 flare 2 RGB 0 255 0 000B: 31@ +=  2.0  // add 2.0 to the y offset for spawn coords000A: 30@ +=  1  // Array index0002: jump @ArrayAct_4

Edited by ZAZ
##### Share on other sites

I create this code, but corona not working.

30@ = 0 $6062(30@,27i) = 2$6063(30@,27i) = 0 $6090(30@,27i) = 0 :PCJONDOCKS_1290wait 0 if$6062(30@,27i) == 0 jf @PCJONDOCKS_1338 $6059 = 255$6060 = 0 $6061 = 0 :PCJONDOCKS_1338wait 0 if$6062(30@,27i) == 1 jf @PCJONDOCKS_1386 $6059 = 0$6060 = 255 $6061 = 0 :PCJONDOCKS_1386wait 0 if$6062(30@,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(30@,27f)$5639(30@,27f) $5668(30@,27f) if$6090(30@,27i) == 0 jf @PCJONDOCKS_1527 018A: $5891(30@,27i) = create_checkpoint_at$5610(30@,27f) $5639(30@,27f)$5668(30@,27f) :PCJONDOCKS_152730@ += 1  30@ >= 27 jf @PCJONDOCKS_1290 return 30@ = 0 $5451(30@,27i) = 0 :PCJONDOCKS_1568wait 0 if 27 > 30@ jf @PCJONDOCKS_2070 if$6063(30@,27i) == 0 jf @PCJONDOCKS_2056 if  $6062(30@,27i) == 0 jf @PCJONDOCKS_1656$6059 = 255 $6060 = 0$6061 = 0 :PCJONDOCKS_1656wait 0 if  $6062(30@,27i) == 1 jf @PCJONDOCKS_1704$6059 = 0 $6060 = 255$6061 = 0 :PCJONDOCKS_1704wait 0 if  $6062(30@,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(30@,27f) $5639(30@,27f)$5668(30@,27f) if  $5451(30@,27i) == 0 jf @PCJONDOCKS_1845 018A:$5891(30@,27i) = create_checkpoint_at $5610(30@,27f)$5639(30@,27f) $5668(30@,27f) :PCJONDOCKS_1845wait 0 if 00FE: actor$PLAYER_ACTOR sphere 0 in_sphere $5610(30@,27f)$5639(30@,27f) $5668(30@,27f) radius 4.0 4.0 4.0 jf @PCJONDOCKS_2056 if Actor.DrivingVehicleType($PLAYER_ACTOR, #PCJ600)jf @PCJONDOCKS_2056 if  $6062(30@,27i) == 0 jf @PCJONDOCKS_1964 Marker.Disable($5891(30@,27i))$6063(30@,27i) = 1 :PCJONDOCKS_1964wait 0 if$6062(30@,27i) == 1 jf @PCJONDOCKS_2010 Marker.Disable($5891(30@,27i))$6063(30@,27i) = 1 :PCJONDOCKS_2010wait 0 if  $6062(30@,27i) == 2 jf @PCJONDOCKS_2056 Marker.Disable($5891(30@,27i))$6063(30@,27i) = 1 :PCJONDOCKS_20560@ += 1 jump @PCJONDOCKS_1568 :PCJONDOCKS_2070return ##### Link to comment ##### 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 comment ##### Share on other sites 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: 5@ = weekday 00BF: 6@ = current_time_hours, 7@ = current_time_minutes 00D6: if 0256: player$PLAYER_CHAR defined 004D: jump_if_false @RICHMAN_452 00D6: if and0039:   5@ == 2 0039:   6@ == 6 0039:   7@ == 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: 2@ = create_actor_pedtype 24 model #HMORI at 645.902 -1117.5109 44.207 0173: set_actor 2@ Z_angle_to 90.0 00A5: 1@ = create_car #INFERNUS at 636.3992 -1122.2133 44.6699 0175: set_car 1@ Z_angle_to 40.00186: 4@ = create_marker_above_car 1@0187: 11@ = create_marker_above_actor 2@ 07E0: set_marker 4@ type_to 207E0: set_marker 11@ 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 1@ wrecked8118: NOT actor 2@ dead 004D: jump_if_false @RICHMAN_452 0615: define_action_sequences 8@05CB: AS_actor 2@ enter_car 1@ as_driver 10000 ms05D1: AS_actor -1 drive_car 1@ to 627.5103 -1112.3221 46.3197 speed 10.0 0 0 505D1: AS_actor -1 drive_car 1@ to 1238.5304 -1575.3459 12.928 speed 25.0 0 0 505CD: AS_actor -1 exit_car 1@0616: define_action_sequences_end 8@0618: assign_actor 2@ to_action_sequences 8@061B: remove_references_to_AS_pack 8@ 004D: jump_if_false @RICHMAN_286:RICHMAN_2870001: wait 0 ms00D6: if and8119: NOT car 1@ wrecked8118: NOT actor 2@ dead01AE: car 1@ sphere 0 near_point 1238.5304 -1575.3459 radius 3.0 3.0 stopped0206: actor 2@ near_car 1@ radius 5.0 5.0 3.0 flag 0 on_foot004D: jump_if_false @RICHMAN_45207CD: AS_actor 2@ 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 3@ // The actor fades away like a ghost004D: jump_if_false @RICHMAN_287:RICHMAN_3630001: wait 30000 ms00D6: if and8119: NOT car 1@ wrecked8118: NOT actor 2@ dead 004D: jump_if_false @RICHMAN_452 01C3: remove_references_to_car 1@ // Like turning a car into any random car 01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian 0164: disable_marker 4@0164: disable_marker 11@:RICHMAN_4520002: jump @RICHMAN_11 0A93: end_custom_thread Also I tried to put the "07CD: AS_actor 2@ walk_to" inside the "actions_sequence 8@" ,but doesn't work either. Edited by Fatalpipe ##### Link to comment ##### 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 comment ##### 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: 1@ = 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 1@ 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 1@ 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: 2@ = panel 1@ 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 1@ 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 menue 08D4: 1@ = create_panel_with_title 'CHEAT7' position 340.0 120.0 width 240.0 columns 1 interactive 1 background 1 alignment 008DB: set_panel 1@ 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 checks 08DA: remove_panel 1@ back 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}

wait  0
if
0256:   player PLAYER_CHAR defined jf @MenueTempW_01 if 0AB0: key_pressed 8//--- key = Backspace jf @MenueTempW_01 08D4: 1@ = create_panel_with_title 'CHEAT7' position 340.0 120.0 width 240.0 columns 1 interactive 1 background 1 alignment 0 08DB: set_panel 1@ column 0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0' 090E: set_panel 1@ active_row 0 :MenueTempW_1 wait 0 if 0256: playerPLAYER_CHAR defined
if
00E1:   key_pressed  0  15//--- key = Enter/Exit

if
00E1:   key_pressed  0  16//--- key = Ped SPRINT
03E6: remove_text_box
08D7: 2@ = panel 1@ active_row//-- submit number of the highlighted button into variable
if
0039:   2@ ==  0  // integer values
01B6: set_weather  1// = SUNNY_LA

if
0039:   2@ ==  1  // integer values
01B6: set_weather  4// = CLOUDY_LA

if
0039:   2@ ==  2  // integer values
01B6: set_weather  5// = SUNNY_SF

if
0039:   2@ ==  3  // integer values
01B6: set_weather  8// = RAINY_SF

if
0039:   2@ ==  4  // integer values
01B6: set_weather  9// = FOGGY_SF

if
0039:   2@ ==  5  // integer values
01B6: set_weather  10// = SUNNY_VEGAS

if
0039:   2@ ==  6  // integer values
01B6: set_weather  12// = CLOUDY_VEGAS

if
0039:   2@ ==  7  // integer values
01B6: set_weather  14// = SUNNY_COUNTRYSIDE

if
0039:   2@ ==  8  // integer values
01B6: set_weather  16// = RAINY_COUNTRYSIDE

if
0039:   2@ ==  9  // integer values
01B6: set_weather  17// = EXTRASUNNY_DESERT

if
0039:   2@ ==  10  // integer values
01B6: set_weather  19// = SANDSTORM_DESERT

if
0039:   2@ ==  11  // integer values
01B7: release_weather

08DA: remove_panel 1@
jump @MenueTempW_01

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

if
00E1:   key_pressed  0  15//--- key = Enter/Exit
jump @MenueTempW_21//--jump to menue exit

and then there's this code:

090E: set_panel 1@ 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 blocks

if  and
0AB0:   key_pressed 8//--- key = Backspace
5@ == 0
08D4: 1@ = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  0
08DB: set_panel 1@ column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'
090E: set_panel 1@ active_row  0
5@ = 1

if
5@ == 1
get button ID while menue is shown to let something happen

if
5@ == 1
08DA: remove_panel 1@
5@ = 0
jump @Menue_01

Example:

{$CLEO .cs} :Menue 03A4: name_thread 'Menue' 5@ = 0 :Menue_01 wait 0 if 0256: player$PLAYER_CHAR defined
if  and
0AB0:   key_pressed 8//--- key = Backspace
5@ == 0

08D4: 1@ = create_panel_with_title 'CHEAT7' position  340.0  120.0 width  240.0 columns  1 interactive  1 background  1 alignment  0
08DB: set_panel 1@ column  0 header 'PLA_19' data 'DEBW1' 'DEBW4' 'DEBW5' 'DEBW8' 'DEBW9' 'DEBW10' 'DEBW12' 'DEBW14' 'DEBW16' 'DEBW17' 'DEBW18' 'WEATH0'
090E: set_panel 1@ active_row  0
5@ = 1

wait  0
if
5@ == 1
if
00E1:   key_pressed  0  15//--- key = Enter/Exit

if
00E1:   key_pressed  0  16//--- key = Ped SPRINT
03E6: remove_text_box
08D7: 2@ = panel 1@ active_row//-- submit number of the highlighted button into variable
if
0039:   2@ ==  0  // integer values
01B6: set_weather  1// = SUNNY_LA

if
0039:   2@ ==  1  // integer values
01B6: set_weather  4// = CLOUDY_LA

if
5@ == 1
08DA: remove_panel 1@
5@ = 0
jump @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_TEMPLATE 03A4: name_thread 'MENUEJP' const L_PANEL_VAR = 0@ L_ACTIVE_ROW_VAR = 1@ L_PANEL_IS_SHOWN_VAR = 2@ end while true wait 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

##### 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 1@ decides where the code should jump to

1@ will be changed at the end of the table by adding 1

if 1@ 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 1@ 2@ 3@ 4@

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 1@ Y_offset_to 2@ opcode 0A4A: gives also the mouse movement try this script to see which values this opcode returns {$CLEO .cs}
:MControl_00

: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
• 1

## 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

×