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. Los Santos Tuners
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    2. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    3. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    4. Bugs*

    1. Grand Theft Auto Series

      1. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    6. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

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

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

      1. GTANet 20th Anniversary
    2. Support

    3. Suggestions

[SA] ~ CLEO Script Tutorial ~


ZAZ
 Share

Recommended Posts

Samp chat.-

UPDATE: i tried something like that

 

it compile, but it doesn`t do anything in game, just first line the message.

Edited by Robbert
Link to comment
Share on other sites

Hi @ZAZ

I'am sorry, I'am asking about GTA SA Android here, or maybe there is peoples that can help me here.

IDK why, everytime i using 0DD9 in the CLEO script, the game is crash. It's write memory address from GTA SA Android V2.00.

But if i use other 0DD code like 0DD2, 0DD3, 0DD4. The game is work.

So, can you help me? Or somebody else?

Thank you! This is my friend script btw. Sorry for my bad english.

I've attached the script.

Spoiler

{$CLEO .csa}

       0000:
while true
    wait 0
    if
    00E1:   player 3 pressed_key 1 
    then               
        wait 3000
        const
        addr [email protected]
 StartNewScript [email protected]   
 NewScript [email protected]       
 forto [email protected]
end // const
        0DD0: addr = get_label_addr @_ZN11CTheScripts14StartNewScriptEPh
        0DD1: addr = get_func_addr_by_cstr_name addr  
        0DD0: StartNewScript = get_label_addr @StartNewScript
        0DD3: context_set_reg 0 value StartNewScript                                                                            
        0DD2: context_call_func addr     
        0DD4: NewScript = context_get_reg 0   
        //StartNewScript += @StartNewScript
        NewScript += 0x10
        0DD9: write_mem_addr NewScript value StartNewScript size 4 add_ib 0 protect 0    
        NewScript += 0x2C
        StartNewScript = 1
        for forto = 0 to 30     
            0DD9: write_mem_addr NewScript value StartNewScript size 4 add_ib 0 protect 0 
            StartNewScript = 0 
          
            000A: NewScript += 4
        end  
      wait 9000
       end_thread   
    end
end  

:_ZN11CTheScripts14StartNewScriptEPh
hex
"_ZN11CTheScripts14StartNewScriptEPh" 00
END           
:StartNewScript
// crash 
0DD9: write_mem_addr 0x...... value 0 size 1 add_ib 1 protect 1 
end_thread

 

Edited by dot exe
Link to comment
Share on other sites

Thanks For Help ZAZ! :^: :cool:

Link to comment
Share on other sites

  • 4 weeks later...
santosvagos

Hello @ZAZ , currently i am using your GFXXX mods and i really want to know how you make your custom GX.img . Could you you show me the roles how to do it , please ?

Link to comment
Share on other sites

  • 1 month later...
Captain Bigboss

@ZAZ can you teach me how to put actor at coord i wanted . How to make that script . Please help me 🙏🙏🙏

Link to comment
Share on other sites

  • 3 months later...

i want some help plz i want to make a mod in which hydra will always on to targets without pressing the lock-on key plz help i am a rookie 

Link to comment
Share on other sites

  • 4 weeks later...
Spoiler
Spoiler

 

 

On 8/29/2009 at 1:30 AM, ZAZ said:

 

Car Drive Tutorial

 

 

Ok, lets start with the base: "how can I spawn a vehicle" and use the exemple script of

tutorial theme: Scripting/Writing a Thread -- Next Step/ Spawn a 3D model

 

Script below spawns the car Infernus in Grovestreet if player goes into red marker(sphere)

If player leave the spot the car will be released from script and the reading process jumps back into 1.Loop

 

{$CLEO .cs}:3dModels_103A4: name_thread 'MODL':3dModels_20001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @3dModels_200D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0004D: jump_if_false @3dModels_20247: request_model #INFERNUS:Load_Model_Check0001: wait  0 ms00D6: if  00248:   model #INFERNUS available004D: jump_if_false @Load_Model_Check00A5: [email protected] = create_car #INFERNUS at 2487.5  -1660.5  13.350175: set_car [email protected] z_angle_to 90.00249: release_model #INFERNUS:3dModels_30001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @3dModels_300D6: if  080FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0004D: jump_if_false @3dModels_301C3: remove_references_to_car [email protected]  // Like turning a car into any random car0002: jump @3dModels_2
 

 

 

 

In the next step I spawn 2 actors in the car and let the car drive to a fix coord destination

fourthermore I add an marker to can see on radar where the car is.

 

To spawn the actor directly in the car I use opcode 0129: for the driver and 01C8: for the passenger.

It's also possible to spawn the actors by normal placement and let then the actors enter the car. Either as driver or as passenger, also with different opcodes.

The passenger opcodes needs to set the seat number in the last parameter:

0 = front passenger seat, 1 or 2 for the back seats

 

To let the car drive I use a simple "drive_to opcode"

There are a lot of other variation to let a car drive and it requires allways to set the speed.

 

The Loop after the "drive-to commands" needs now conditions which belongs to the car drive action

Very important is to check if the car is wrecked.

We need one or more ways to let the script refresh, I mean to release the car, it's marker and the actors from our script in some cases to can beginn the script from beginning.

Such situations can be if player dies or gets arrested, if the car is wrecked or if it is far away

if or

0119: car [email protected] wrecked

01F4: car [email protected] flipped

8202: not actor $PLAYER_ACTOR near_car [email protected] radius 500.0 500.0 flag 0

 

 

Script below spawns the car Infernus in Grovestreet with two homies inthere,

if player goes into red marker(sphere)

It drives to the next crossroad and stays there till player is far away from car (500.0 units)

 

{$CLEO .cs}:CarDrive_103A4: name_thread 'CDRIVE':CarDrive_20001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @CarDrive_2if00FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0004D: jump_if_false @CarDrive_20247: request_model #INFERNUS0247: request_model #fam10247: request_model #fam2:CarDrive_30001: wait  0 msif  and0248:   model #INFERNUS available0248:   model #fam1 available0248:   model #fam2 available004D: jump_if_false @CarDrive_300A5: [email protected] = create_car #INFERNUS at 2487.5  -1660.5  13.350175: set_car [email protected] z_angle_to 90.00129: [email protected] = create_actor  8 #fam1 in_car [email protected] driverseat01C8: [email protected] = create_actor  8 #fam2 in_car [email protected] passenger_seat  00186: [email protected] = create_marker_above_car [email protected] 07E0: set_marker [email protected] type_to 1 0249: release_model #INFERNUS0249: release_model #fam10249: release_model #fam2////////////////////  the drive-to commands --vv----00A7: car [email protected] drive_to 2353.1528 -1658.6493 13.3846//---simple drive-to command00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic////////////////////  the drive-to commands --^^----:CarDrive_130001: wait  0 msif0256:   player $PLAYER_CHAR defined004D: jump_if_false @CarDrive_13if  or0119:     car [email protected] wrecked01F4:     car [email protected] flipped8202:   not actor $PLAYER_ACTOR near_car [email protected] radius 500.0 500.0 flag 0 004D: jump_if_false @CarDrive_1301C3: 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] 0002: jump @CarDrive_2
 

 

 

 

As I said, there are a lot of other variation to let a car drive. The opcode 00A7: of the exemple above is the simpliest.

The car drive then strictly along the gta paths. The paths are stored in the nodes.dat in gta3.img

These paths are the routes for the random cars in traffic.

If you place a car in an area without path like in middle of the desert and let then the car drive, it drives first to the path

and then to the destination.

The car can not reach the destination if the destination is not on a path.

A car drive script can be a very annoying work, also if the destinations are on paths.

It often won't drive that route which we want or it stucks.

 

----------------------------------------------------------------------------

 

We have several opcodes to force the car to let it do what we want

 

----------------------------------------------------------------------------

 

opcode 04e0: let the car ingnore the paths and let it drive straight ahead to the destination

04e0: car [email protected] abandon_path_radius 200

 

replace the script part with the drive-to commands of script above with this drive-to commands:

 

////////////////////  the drive-to commands --vv----00A7: car [email protected] drive_to 2431.5864 -1628.0818 13.698//---simple drive-to command00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic04e0: car [email protected] abandon_path_radius 200////////////////////  the drive-to commands --^^----
 

 

the destination is between the highway and grovestreet at that empty area

without 04e0: the car drives a long way on the street

opcode 04e0: works only in the given radius,

it means: by radius 200 the startpoint and the next destination may not be bigger than 200 units

more than 250 is not possible

 

----------------------------------------------------------------------------

 

the car chases the player with opcode 00AF: and 2 as last parameter

 

 

////////////////////  the drive-to commands --vv----00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic00AF: set_car [email protected] driver_behaviour_to  2//-- 2 as last param let chase the player////////////////////  the drive-to commands --^^----
 

 

 

four valid settings for opcode 00AF:

1 - follow road, drive back if way is blocked

2 - kill the player

4 - drive to player and stop

8 - ignore road-paths

 

----------------------------------------------------------------------------

 

the car drives automaticly along the paths with opcode 00AF: and 1 as last parameter

 

 

////////////////////  the drive-to commands --vv----00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic00AF: set_car [email protected] driver_behaviour_to 1////////////////////  the drive-to commands --^^----
 

 

 

----------------------------------------------------------------------------

 

We can use an opcode to read the coords infront of the car and let it drive to that point

 

 

////////////////////  the drive-to commands --vv----0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset  -10.0  15.0  0.000A7: car [email protected] drive_to [email protected] [email protected] [email protected]//---simple drive-to command00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic////////////////////  the drive-to commands --^^----
 

 

 

----------------------------------------------------------------------------

 

We can use an opcode to read the coords infront of the car and let it drive to that point

and give it a start boost with opcode 04BA:

 

 

////////////////////  the drive-to commands --vv----0407: create_coordinate [email protected] [email protected] [email protected] from_car [email protected] offset  -10.0  15.0  0.000A7: car [email protected] drive_to [email protected] [email protected] [email protected]//---simple drive-to command00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic04BA: set_car [email protected] speed_instantly  50.0////////////////////  the drive-to commands --^^----
 

 

 

----------------------------------------------------------------------------

 

Let the driver do corrections

 

R* use in the main.scm a stuck car check, but this function don't work in Cleo

But to let the driver do corrections can be used opcode 06C7:

 

 

////////////////////  the drive-to commands --vv----06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 14 timelimit 3000    //backward circle00A7: car [email protected] drive_to 2353.1528 -1658.6493 13.3846//---simple drive-to command00AD: set_car [email protected] max_speed_to  20.0//---speed declaration, important!!00AE: unknown_set_car [email protected] to_ignore_traffic_lights  2//--optional, sets car to ignore red-lights and drive around traffic////////////////////  the drive-to commands --^^----
 

 

 

the driver make first a backward circle for ca. 3 seconds, then the car drives to the given point

----------------------------------------------------------------------------

some different versions of opcode 06C7:

 

06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 6 timelimit 1000     //a short stop                     06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 6 timelimit 2000000  //a long stop                     06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 3 timelimit 3000     //backwards to the right side, than straight ahead 06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 22 timelimit 3000    //backwards to the left side, than straight ahead  06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 14 timelimit 3000    //backward circle                  06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 9 timelimit 3000     //bump forward                        06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 7 timelimit 3000     //steer left                             06C7: AS_actor [email protected] driver_of_car [email protected] perform_action 8 timelimit 3000     //steer right
 

 

 

----------------------------------------------------------------------------

 

Let the driver drive

 

Opcode 05D1: let the driver drive instead to let the car drive

 

This function can also ignore the paths (like using 04e0: car [email protected] abandon_path_radius)

and let the driver drive the car directly to the given point

It's depending from the setting in the flags

 

0 0 5 let it drive on paths

2 0 5 ignore the paths

 

 

////////////////////  the drive-to commands --vv----05D1: AS_actor [email protected] drive_car [email protected] to  2353.1528 -1658.6493 13.384 speed  20.0  0  0  5////////////////////  the drive-to commands --^^----
 

 

 

----------------------------------------------------------------------------

 

Opcode 05D1: can be set more times as combo in an AS_Pack

It needs than to set -1 instead the variable name of the driver

and assign the actor [email protected] after the AS_pack-setup to the defined AS_pack

 

 

////////////////////  the drive-to commands --vv----0615: define_action_sequences [email protected]: AS_actor -1 drive_car [email protected] to  2353.1528 -1658.6493 13.384 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  2431.7739 -1674.7444 13.6643 speed  20.0  0  0  505D1: AS_actor -1 drive_car [email protected] to  2431.5864 -1628.0818 13.698 speed  20.0  2  0  50616: define_action_sequences_end [email protected] 0618: assign_actor [email protected] to_action_sequences [email protected] 061B: remove_references_to_AS_pack [email protected]////////////////////  the drive-to commands --^^----
 

 

 

 

----------------------------------------------------------------------------

 

Define a scmpath for the driver

 

Set first opcode 05D6: to clear first a possibly created previous scmpath

Than set new coords for the scmpath and use opcode 07E7: to let the driver drive along this path

 

This function can also ignore the paths (like using 04e0: car [email protected] abandon_path_radius)

and let the driver drive the car directly to the given point

It's depending from the setting in the flags

 

0 0 5 let it drive on paths

2 0 5 ignore the paths

 

 

////////////////////  the drive-to commands --vv----05D6: clear_scmpath05D7: add_point_to_scmpath  2353.1528 -1658.6493 13.38405D7: add_point_to_scmpath  2431.7739 -1674.7444 13.664307E7: AS_assign_scmpath_to_actor [email protected] in_car [email protected] speed  20.0 flags  0  0  5////////////////////  the drive-to commands --^^----
 

 

 

----------------------------------------------------------------------------

 

Car drive scripts in praxis

 

----------------------------------------------------------------------------

 

In praxis to write a car drive script with a longer specific route needs a more complex script,

which checks if the car reached the destination to can submit the new destination.

Because you can not check the same destination coords which you want to submit when the car reached it,

you must use access checks

 

Fourthermore it needs to check if the car do airborns because it looses the coord information

and we must give this information again in this case

 

A check if the car is fliped or wrecked makes allways sense, because it can not continue the route and the script should cancel the action in this case

 

R* use in the main.scm a stuck car check, but this function don't work in Cleo

a check if the car speed is smaller than 1.0 can help

 

----------------------------------------------------------------------------

 

The SF-Airport Circle version 1

 

The script below teleport the player to the SF airport on a motorbike and spawns an opponent driver on motorbike who drives around the airort building.

Go outside to the exterior map and press Backspace then follow the opponent driver to see what he do

Opcode 00A7: car [email protected] drive_to is used and 04e0: car [email protected] abandon_path_radius

The driver falls from bike sometimes and enters again his ride to continue the drive

Alternativ you can activte the opcode 08C6:

 

//08C6: set_actor [email protected]  stay_on_bike 1
 

 

To refresh the script needs to leave the aiport, you must have a distance of 700.0 units to the startpoint

 

 

{$CLEO .cs}:Drive_103A4: name_thread 'DRIV':Drive_30001: wait 0 msif0256: player $PLAYER_CHAR definedjf @Drive_3077E: [email protected] = active_interiorif  and0039:   [email protected] ==  0  // integer values0AB0:   key_pressed 8//----------------------------------------Backspace  jf @Drive_3016A: fade  0 ()  250 ms0001: wait 250 ms01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5  -408.1  14.10173: set_actor $PLAYER_ACTOR z_angle_to  90.80001: wait  500 ms0247: request_model #NRG5000247: request_model #MAFFA:Drive_50001: wait  0 msif  and0248:   model #NRG500 available0248:   model #MAFFA availablejf @Drive_500A5: [email protected] = create_car #NRG500 at -1333.5  -408.1  14.10175: set_car [email protected] z_angle_to  280.00224: set_car [email protected] health_to  200000A5: [email protected] = create_car #NRG500 at -1354.5  -419.1  14.10175: set_car [email protected] z_angle_to  280.00224: set_car [email protected] health_to  2000020A: set_car  [email protected] door_status_to 402AC: set_car [email protected] immunities  1  1  1  1  101EC: make_car [email protected] very_heavy  10129: [email protected] = create_actor  24 #MAFFA in_car [email protected] driverseat0223: set_actor [email protected] health_to  300004E4: unknown_refresh_game_renderer_at  -1333.5  -408.103CB: set_camera  -1333.5  -408.1  14.1029B: [email protected] = init_object 1655 at -1576.02  -202.34  13.760177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1597.9  -506.5  21.70177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1375.9  -581.5  13.690177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1374.9  -585.5  13.690177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  10177: set_object [email protected] z_angle_to  135.00177: set_object [email protected] z_angle_to  225.00177: set_object [email protected] z_angle_to  280.00177: set_object [email protected] z_angle_to  280.00186: [email protected] = create_marker_above_car [email protected] 07E0: set_marker [email protected] type_to 10249: release_model #NRG5000249: release_model #MAFFA04e0: car [email protected] abandon_path_radius 20000AD: set_car [email protected] max_speed_to  100.004BA: set_car [email protected] speed_instantly  30.000AF: set_car [email protected] driver_behaviour_to  100AE: unknown_set_car [email protected] to_ignore_traffic_lights  20001: wait  250 ms036A: put_actor $PLAYER_ACTOR in_car [email protected]: wait  250 ms016A: fade  1 ()  1000 ms0001: wait  1000 ms0373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0006: [email protected] =  0  // integer values0006: [email protected] =  0  // integer values0006: [email protected] =  20000  // floating-point values0006: [email protected] =  0  // integer values0007: [email protected] =  -1320.48  // floating-point values0007: [email protected] =  -407.1  // floating-point values0007: [email protected] =  13.76  // floating-point values00A7: car [email protected] drive_to  [email protected] [email protected] [email protected]: set_car [email protected] max_speed_to  1.004e0: car [email protected] abandon_path_radius 250//08C6: set_actor [email protected]  stay_on_bike 1:Drive_70001: wait 0 msif0256: player $PLAYER_CHAR definedjf @Drive_70050: gosub @Drive_sub_3if  and8119:   NOT   car [email protected] wrecked8119:   NOT   car [email protected] wrecked8118:   NOT   actor [email protected] deadjf @Drive_7if00FE:   actor $PLAYER_ACTOR  0 ()near_point -1333.5  -408.1  14.1 radius  650.5  650.5  50.5jf @Drive_12jump @Drive_7:Drive_120164: disable_marker [email protected]: remove_references_to_car [email protected]  // Like turning a car into any random car01C3: 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 pedestrian0108: destroy_object [email protected]: destroy_object [email protected]: destroy_object [email protected]: destroy_object [email protected] @Drive_3:Drive_sub_3if8119:   NOT   car [email protected] wreckedjf @Drive_sub_109if00DB:   actor [email protected] in_car [email protected] @Drive_sub_99if0039:   [email protected] ==  1  // integer valuesjf @Drive_sub_100006: [email protected] =  0  // integer valuesjump @Drive_sub_100:Drive_sub_10if0039:   [email protected] ==  0  // integer valuesjf @Drive_sub_11if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  5.2  5.2  5.0jf @Drive_sub_110006: [email protected] =  1  // integer values0007: [email protected] =  -1181.78  // floating-point values0007: [email protected] =  -331.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_11if0039:   [email protected] ==  1  // integer valuesjf @Drive_sub_12if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @Drive_sub_1200AD: set_car [email protected] max_speed_to  10.00006: [email protected] =  2  // integer values0007: [email protected] =  -1282.1  // floating-point values0007: [email protected] =  -159.3  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 340.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_12if0039:   [email protected] ==  2  // integer valuesjf @Drive_sub_13if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @Drive_sub_1300AD: set_car [email protected] max_speed_to  25.00006: [email protected] =  3  // integer values0007: [email protected] =  -1498.78  // floating-point values0007: [email protected] =  -138.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 65.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_13if0039:   [email protected] ==  3  // integer valuesjf @Drive_sub_14if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  8.2  8.2  5.0jf @Drive_sub_1400AD: set_car [email protected] max_speed_to  25.00006: [email protected] =  4  // integer values0007: [email protected] =  -1576.78  // floating-point values0007: [email protected] =  -202.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 135.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_14if0039:   [email protected] ==  4  // integer valuesjf @Drive_sub_15if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  5.2  5.2  5.0jf @Drive_sub_150006: [email protected] =  5  // integer values0007: [email protected] =  -1694.78  // floating-point values0007: [email protected] =  -352.30  // floating-point values0007: [email protected] =  13.9  // floating-point values0175: set_car [email protected] z_angle_to 135.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_15if0039:   [email protected] ==  5  // integer valuesjf @Drive_sub_16if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @Drive_sub_1600AD: set_car [email protected] max_speed_to  10.00006: [email protected] =  6  // integer values0007: [email protected] =  -1691.78  // floating-point values0007: [email protected] =  -409.30  // floating-point values0007: [email protected] =  13.9  // floating-point values0175: set_car [email protected] z_angle_to 180.0000A: [email protected] +=  0  // integer values0007: [email protected] =  40.0  // floating-point values0007: [email protected] =  10.0  // floating-point values04e0: car [email protected] abandon_path_radius 25000AE: unknown_set_car [email protected] to_ignore_traffic_lights  2jump @Drive_sub_100:Drive_sub_16if0039:   [email protected] ==  6  // integer valuesjf @Drive_sub_17if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  8.2  8.2  5.0jf @Drive_sub_1700AD: set_car [email protected] max_speed_to  0.00006: [email protected] =  7  // integer values0007: [email protected] =  -1519.78  // floating-point values0007: [email protected] =  -580.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 250.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  0.0  // floating-point values04e0: car [email protected] abandon_path_radius 25000AE: unknown_set_car [email protected] to_ignore_traffic_lights  2jump @Drive_sub_100:Drive_sub_17if0039:   [email protected] ==  7  // integer valuesjf @Drive_sub_18if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @Drive_sub_1800AD: set_car [email protected] max_speed_to  5.001EB: set_car_density_to  0.00006: [email protected] =  8  // integer values0007: [email protected] =  -1299.78  // floating-point values0007: [email protected] =  -565.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 0.0000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 250jump @Drive_sub_100:Drive_sub_18if0039:   [email protected] ==  8  // integer valuesjf @Drive_sub_109if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  25.2  25.2  5.0jf @Drive_sub_10900AD: set_car [email protected] max_speed_to  0.00006: [email protected] =  1  // integer values000A: [email protected] +=  1  // integer values0007: [email protected] =  -1181.78  // floating-point values0007: [email protected] =  -331.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0175: set_car [email protected] z_angle_to 1.00007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values04e0: car [email protected] abandon_path_radius 25000AE: unknown_set_car [email protected] to_ignore_traffic_lights  2if0039:   [email protected] ==  2  // integer valuesjf @Drive_sub_10000BC: text_highpriority 'BJ_LOSE'  5000 ms  1jump @Drive_sub_100:Drive_sub_99if0039:   [email protected] ==  0  // integer valuesjf @Drive_sub_10900AD: set_car [email protected] max_speed_to  0.005CB: actor_goto_and_enter_car [email protected] [email protected]  5000 0006: [email protected] =  1  // integer valuesjump @Drive_sub_109:Drive_sub_10000A7: car [email protected] drive_to  [email protected] [email protected] [email protected]: set_car [email protected] max_speed_to  [email protected]: text_draw_toggle  00006: [email protected] =  0  // integer valuesjump @Drive_sub_109:Drive_sub_102if01F3:   car [email protected] airbornejf @Drive_sub_1030007: [email protected] =  0.0  // floating-point values00A7: car [email protected] drive_to  [email protected] [email protected] [email protected]: set_car [email protected] speed_instantly  [email protected]: set_car [email protected] max_speed_to  [email protected] @Drive_sub_103:Drive_sub_103if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  30.2  30.2  5.0jf @Drive_sub_104jump @Drive_sub_105:Drive_sub_10402E3: [email protected] = car [email protected] speedif81F3:   NOT   car [email protected] airbornejf @Drive_sub_106if  and0021:   [email protected] >  30.0  // floating-point values0019:   [email protected] >  700  // integer valuesjf @Drive_sub_10504BA: set_car [email protected] speed_instantly  50.0:Drive_sub_105if0019:   [email protected] >  2000  // integer valuesjf @Drive_sub_109:Drive_sub_1060006: [email protected] =  0  // integer values:Drive_sub_1090051: return
 

 

 

----------------------------------------------------------------------------

 

The SF-Airport Circle version 2

 

Same script as above but now opcode 07E7: AS_assign_scmpath_to_actor is used

It teleports the player to the SF airport on a motorbike and spawns an opponent driver on motorbike who drives around the airort building.

Go outside to the exterior map and press Backspace then follow the opponent driver to see what he do

To refresh the script needs to leave the aiport, you must have a distance of 700.0 units to the startpoint

 

 

{$CLEO .cs}:scmpath_103A4: name_thread 'SCMP':scmpath_30001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_3077E: [email protected] = active_interiorif  and0038:   [email protected] ==  0  // integer values0AB0:   key_pressed 8//----------------------------------------Backspace  jf @scmpath_3016A: fade  0 ()  250 ms0001: wait 250 ms01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)0362: remove_actor $PLAYER_ACTOR from_car_and_place_at -1338.5  -408.1  14.10173: set_actor $PLAYER_ACTOR z_angle_to  90.80001: wait  500 ms0247: request_model #NRG5000247: request_model #MAFFA:scmpath_50001: wait  0 msif  and0248:   model #NRG500 available0248:   model #MAFFA availablejf @scmpath_500A5: [email protected] = create_car #NRG500 at -1333.5  -408.1  14.10175: set_car [email protected] z_angle_to  280.00224: set_car [email protected] health_to  200000A5: [email protected] = create_car #NRG500 at -1354.5  -419.1  14.10175: set_car [email protected] z_angle_to  280.00224: set_car [email protected] health_to  2000020A: set_car  [email protected] door_status_to 402AC: set_car [email protected] immunities  1  1  1  1  101EC: make_car [email protected] very_heavy  10129: [email protected] = create_actor  24 #MAFFA in_car [email protected] driverseat0223: set_actor [email protected] health_to  300004E4: unknown_refresh_game_renderer_at  -1333.5  -408.103CB: set_camera  -1333.5  -408.1  14.1029B: [email protected] = init_object 1655 at -1576.02  -202.34  13.760177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1597.9  -506.5  21.70177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1375.9  -581.5  13.690177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  1029B: [email protected] = init_object 1655 at -1374.9  -585.5  13.690177: set_object [email protected] z_angle_to  270.001C7: remove_object_from_mission_cleanup_list [email protected]: set_object [email protected] collision_detection  10177: set_object [email protected] z_angle_to  135.00177: set_object [email protected] z_angle_to  225.00177: set_object [email protected] z_angle_to  280.00177: set_object [email protected] z_angle_to  280.00186: [email protected] = create_marker_above_car [email protected] 07E0: set_marker [email protected] type_to 10249: release_model #NRG5000249: release_model #MAFFA04e0: car [email protected] abandon_path_radius 20000AD: set_car [email protected] max_speed_to  100.004BA: set_car [email protected] speed_instantly  30.000AF: set_car [email protected] driver_behaviour_to  100AE: unknown_set_car [email protected] to_ignore_traffic_lights  20001: wait  250 ms036A: put_actor $PLAYER_ACTOR in_car [email protected]: wait  250 ms016A: fade  1 ()  1000 ms0001: wait  1000 ms0373: set_camera_directly_behind_player02EB: restore_camera_with_jumpcut01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)0006: [email protected] =  0  // integer values0006: [email protected] =  0  // integer values0006: [email protected] =  20000  // floating-point values0006: [email protected] =  0  // integer values0007: [email protected] =  -1320.48  // floating-point values0007: [email protected] =  -407.1  // floating-point values0007: [email protected] =  13.76  // floating-point values00A7: car [email protected] drive_to  [email protected] [email protected] [email protected]: set_car [email protected] max_speed_to  1.004e0: car [email protected] abandon_path_radius 25008C6: set_actor [email protected]  stay_on_bike 1:scmpath_70001: wait 0 msif0256: player $PLAYER_CHAR definedjf @scmpath_70050: gosub @scmpath_sub_3if  and8119:   NOT   car [email protected] wrecked8119:   NOT   car [email protected] wrecked8118:   NOT   actor [email protected] deadjf @scmpath_7if00FE:   actor $PLAYER_ACTOR  0 ()near_point -1333.5  -408.1  14.1 radius  650.5  650.5  50.5jf @scmpath_12jump @scmpath_7:scmpath_120164: disable_marker [email protected]: remove_references_to_car [email protected]  // Like turning a car into any random car01C3: 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 pedestrian0108: destroy_object [email protected]: destroy_object [email protected]: destroy_object [email protected]: destroy_object [email protected] @scmpath_3:scmpath_sub_3if8119:   NOT   car [email protected] wreckedjf @scmpath_sub_109if00DB:   actor [email protected] in_car [email protected] @scmpath_sub_99if0039:   [email protected] ==  1  // integer valuesjf @scmpath_sub_100006: [email protected] =  0  // integer valuesjump @scmpath_sub_100:scmpath_sub_10if0039:   [email protected] ==  0  // integer valuesjf @scmpath_sub_11if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  5.2  5.2  5.0jf @scmpath_sub_110006: [email protected] =  1  // integer values05D6: clear_scmpath0007: [email protected] =  -1181.78  // floating-point values0007: [email protected] =  -331.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_11if0039:   [email protected] ==  1  // integer valuesjf @scmpath_sub_12if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @scmpath_sub_1200AD: set_car [email protected] max_speed_to  10.00006: [email protected] =  2  // integer values05D6: clear_scmpath0007: [email protected] =  -1282.1  // floating-point values0007: [email protected] =  -159.3  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_12if0039:   [email protected] ==  2  // integer valuesjf @scmpath_sub_13if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @scmpath_sub_1300AD: set_car [email protected] max_speed_to  25.00006: [email protected] =  3  // integer values05D6: clear_scmpath0007: [email protected] =  -1498.78  // floating-point values0007: [email protected] =  -138.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_13if0039:   [email protected] ==  3  // integer valuesjf @scmpath_sub_14if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  8.2  8.2  5.0jf @scmpath_sub_1400AD: set_car [email protected] max_speed_to  25.00006: [email protected] =  4  // integer values05D6: clear_scmpath0007: [email protected] =  -1576.78  // floating-point values0007: [email protected] =  -202.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_14if0039:   [email protected] ==  4  // integer valuesjf @scmpath_sub_15if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  5.2  5.2  5.0jf @scmpath_sub_150006: [email protected] =  5  // integer values05D6: clear_scmpath0007: [email protected] =  -1694.78  // floating-point values0007: [email protected] =  -352.30  // floating-point values0007: [email protected] =  13.9  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_15if0039:   [email protected] ==  5  // integer valuesjf @scmpath_sub_16if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @scmpath_sub_1600AD: set_car [email protected] max_speed_to  10.00006: [email protected] =  6  // integer values05D6: clear_scmpath0007: [email protected] =  -1691.78  // floating-point values0007: [email protected] =  -409.30  // floating-point values0007: [email protected] =  13.9  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  40.0  // floating-point values0007: [email protected] =  10.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected]: unknown_set_car [email protected] to_ignore_traffic_lights  2jump @scmpath_sub_100:scmpath_sub_16if0039:   [email protected] ==  6  // integer valuesjf @scmpath_sub_17if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  8.2  8.2  5.0jf @scmpath_sub_1700AD: set_car [email protected] max_speed_to  0.00006: [email protected] =  7  // integer values05D6: clear_scmpath0007: [email protected] =  -1519.78  // floating-point values0007: [email protected] =  -580.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  0.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected]: unknown_set_car [email protected] to_ignore_traffic_lights  2jump @scmpath_sub_100:scmpath_sub_17if0039:   [email protected] ==  7  // integer valuesjf @scmpath_sub_18if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  15.2  15.2  5.0jf @scmpath_sub_1800AD: set_car [email protected] max_speed_to  5.001EB: set_car_density_to  0.00006: [email protected] =  8  // integer values05D6: clear_scmpath0007: [email protected] =  -1299.78  // floating-point values0007: [email protected] =  -565.30  // floating-point values0007: [email protected] =  13.76  // floating-point values000A: [email protected] +=  0  // integer values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected] @scmpath_sub_100:scmpath_sub_18if0039:   [email protected] ==  8  // integer valuesjf @scmpath_sub_109if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  25.2  25.2  5.0jf @scmpath_sub_10900AD: set_car [email protected] max_speed_to  0.00006: [email protected] =  1  // integer values000A: [email protected] +=  1  // integer values05D6: clear_scmpath0007: [email protected] =  -1181.78  // floating-point values0007: [email protected] =  -331.30  // floating-point values0007: [email protected] =  13.76  // floating-point values0007: [email protected] =  100.0  // floating-point values0007: [email protected] =  20.0  // floating-point values05D7: add_point_to_scmpath [email protected] [email protected] [email protected]:   [email protected] ==  2  // integer valuesjf @scmpath_sub_10000BC: text_highpriority 'BJ_LOSE'  5000 ms  1jump @scmpath_sub_100:scmpath_sub_99if0039:   [email protected] ==  0  // integer valuesjf @scmpath_sub_10900AD: set_car [email protected] max_speed_to  0.005CB: actor_goto_and_enter_car [email protected] [email protected]  5000 0006: [email protected] =  1  // integer valuesjump @scmpath_sub_109:scmpath_sub_10007E7: AS_assign_scmpath_to_actor [email protected] in_car [email protected] speed [email protected] flags 2 0 303F0: text_draw_toggle  00006: [email protected] =  0  // integer valuesjump @scmpath_sub_109:scmpath_sub_102if01F3:   car [email protected] airbornejf @scmpath_sub_1030007: [email protected] =  0.0  // floating-point values04BA: set_car [email protected] speed_instantly  [email protected]: AS_assign_scmpath_to_actor [email protected] in_car [email protected] speed [email protected] flags 2 0 3jump @scmpath_sub_103:scmpath_sub_103if01AF:   car [email protected]  0 ()near_point [email protected] [email protected] [email protected] radius  30.2  30.2  5.0jf @scmpath_sub_104jump @scmpath_sub_105:scmpath_sub_10402E3: [email protected] = car [email protected] speedif81F3:   NOT   car [email protected] airbornejf @scmpath_sub_106if  and0021:   [email protected] >  30.0  // floating-point values0019:   [email protected] >  700  // integer valuesjf @scmpath_sub_10504BA: set_car [email protected] speed_instantly  50.0:scmpath_sub_105if0019:   [email protected] >  2000  // integer valuesjf @scmpath_sub_109:scmpath_sub_1060006: [email protected] =  0  // integer values:scmpath_sub_1090051: return
 

 

00AF: set_car [email protected] driver_behaviour_to 4 
00AE: set_car [email protected] traffic_behaviour_to 2 

 

how to set peds in bike without crash at player shoot peds bikers to fall

Link to comment
Share on other sites

On 11/8/2020 at 3:46 AM, ZAZ said:

please post your script

Spoiler

// This file was decompiled using SASCM.ini published by GTAG (http://gtagmodding.com/opcode-database/) on 7.7.2019
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
wait 0 

:NONAME_6
01C0: [email protected] = player $PLAYER_CHAR wanted_level 
wait 1000 
077E: get_active_interior_to [email protected] 
if and
  [email protected] == 5 
  [email protected] == 0 
jf @NONAME_6 
0247: load_model #SANCHEZ 
0247: load_model #MP5LNG 
0247: load_model #SWAT 
038B: load_requested_models 

:NONAME_66
wait 300 
if and
0248:   model #SANCHEZ available 
0248:   model #MP5LNG available 
0248:   model #SWAT available 
jf @NONAME_66 
wait 0 
0209: [email protected] = random_int_in_ranges 50.0 100.0 
0209: [email protected] = random_int_in_ranges 50.0 100.0 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset [email protected] [email protected] 1.0 
02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 
00A5: [email protected] = create_car #SANCHEZ at [email protected] [email protected] [email protected] 
0129: [email protected] = create_actor_pedtype 6 model #SWAT in_car [email protected] driverseat 
01C8: [email protected] = create_actor_pedtype 6 model #SWAT in_car [email protected] passenger_seat 0 
0223: set_actor [email protected] health_to 250 
0223: set_actor [email protected] health_to 250 
02E2: set_actor [email protected] weapon_accuracy_to 75 
02E2: set_actor [email protected] weapon_accuracy_to 75 
01B2: give_actor [email protected] weapon 29 ammo 99999 // Load the weapon model before using this 
01B2: give_actor [email protected] weapon 29 ammo 99999 // Load the weapon model before using this 
0423: set_car [email protected] improved_handling_to 2.0 // (float) 
00AD: set_car [email protected] max_speed_to 50.0 
00AF: set_car [email protected] driver_behaviour_to 4 
00AE: set_car [email protected] traffic_behaviour_to 2 
0249: release_model #SANCHEZ 
0249: release_model #SWAT 
0249: release_model #MP5LNG 
if 
00DF:   actor $PLAYER_ACTOR driving 
jf @NONAME_439 
03C0: [email protected] = actor $PLAYER_ACTOR car 
0114: set_actor [email protected] weapon 29 add_ammo 200000 

:NONAME_360
wait 0 
if 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 300.0 300.0 150.0 flag 0 
jf @NONAME_857 
if 
8119:   not car [email protected] wrecked 
jf @NONAME_857 
if 
8118:   not actor [email protected] dead 
jf @NONAME_609 
jump @NONAME_439 

:NONAME_439
wait 0 
if and
80DF:   not actor $PLAYER_ACTOR driving 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 15.0 15.0 150.0 flag 0 
jf @NONAME_360 
0633: AS_actor [email protected] exit_car 
0633: AS_actor [email protected] exit_car 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
jump @NONAME_707 

:NONAME_517
wait 0 
00AA: store_car [email protected] position_to [email protected] [email protected] [email protected] 
if and
80DF:   not actor $PLAYER_ACTOR driving 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 15.0 15.0 150.0 flag 0 
jf @NONAME_628 
0633: AS_actor [email protected] exit_car 
0633: AS_actor [email protected] exit_car 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
jump @NONAME_707 

:NONAME_609
wait 0 
0676: AS_actor [email protected] in_car [email protected] move_from_passengerseat_to_driverseat 
jump @NONAME_628 

:NONAME_628
wait 0 
if 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 300.0 300.0 150.0 flag 0 
jf @NONAME_857 
if 
8119:   not car [email protected] wrecked 
jf @NONAME_857 
if 
8118:   not actor [email protected] dead 
jf @NONAME_857 
jump @NONAME_517 

:NONAME_707
wait 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @NONAME_815 
if and
00F2:   actor [email protected] near_actor $PLAYER_ACTOR radius 300.0 300.0 0 
00F2:   actor [email protected] near_actor $PLAYER_ACTOR radius 300.0 300.0 0 
jf @NONAME_815 
if and
0118:   actor [email protected] dead 
0118:   actor [email protected] dead 
jf @NONAME_707 
if 
0741:   actor $PLAYER_ACTOR busted 
jf @NONAME_707 

:NONAME_815
wait 0 
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 
01C3: remove_references_to_car [email protected] 
0209: [email protected] = random_int_in_ranges 10000 20000 
wait [email protected] 
jump @NONAME_6 

:NONAME_857
wait 0 
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 
01C3: remove_references_to_car [email protected] 
0209: [email protected] = random_int_in_ranges 10000 20000 
wait [email protected] 
jump @NONAME_6 
 

how to fix this script for ped bikers.

Link to comment
Share on other sites

Uchiha Batuhan

Hello By Zaz. Since I'm New To GtaForums, I Can't Assign You Dm. Where Can I Reach You?

Link to comment
Share on other sites

15 minutes ago, MDXNaTioN said:
  Reveal hidden contents

// This file was decompiled using SASCM.ini published by GTAG (http://gtagmodding.com/opcode-database/) on 7.7.2019
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
wait 0 

:NONAME_6
01C0: [email protected] = player $PLAYER_CHAR wanted_level 
wait 1000 
077E: get_active_interior_to [email protected] 
if and
  [email protected] == 5 
  [email protected] == 0 
jf @NONAME_6 
0247: load_model #SANCHEZ 
0247: load_model #MP5LNG 
0247: load_model #SWAT 
038B: load_requested_models 

:NONAME_66
wait 300 
if and
0248:   model #SANCHEZ available 
0248:   model #MP5LNG available 
0248:   model #SWAT available 
jf @NONAME_66 
wait 0 
0209: [email protected] = random_int_in_ranges 50.0 100.0 
0209: [email protected] = random_int_in_ranges 50.0 100.0 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset [email protected] [email protected] 1.0 
02C1: store_to [email protected] [email protected] [email protected] car_path_coords_closest_to [email protected] [email protected] [email protected] 
00A5: [email protected] = create_car #SANCHEZ at [email protected] [email protected] [email protected] 
0129: [email protected] = create_actor_pedtype 6 model #SWAT in_car [email protected] driverseat 
01C8: [email protected] = create_actor_pedtype 6 model #SWAT in_car [email protected] passenger_seat 0 
0223: set_actor [email protected] health_to 250 
0223: set_actor [email protected] health_to 250 
02E2: set_actor [email protected] weapon_accuracy_to 75 
02E2: set_actor [email protected] weapon_accuracy_to 75 
01B2: give_actor [email protected] weapon 29 ammo 99999 // Load the weapon model before using this 
01B2: give_actor [email protected] weapon 29 ammo 99999 // Load the weapon model before using this 
0423: set_car [email protected] improved_handling_to 2.0 // (float) 
00AD: set_car [email protected] max_speed_to 50.0 
00AF: set_car [email protected] driver_behaviour_to 4 
00AE: set_car [email protected] traffic_behaviour_to 2 
0249: release_model #SANCHEZ 
0249: release_model #SWAT 
0249: release_model #MP5LNG 
if 
00DF:   actor $PLAYER_ACTOR driving 
jf @NONAME_439 
03C0: [email protected] = actor $PLAYER_ACTOR car 
0114: set_actor [email protected] weapon 29 add_ammo 200000 

:NONAME_360
wait 0 
if 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 300.0 300.0 150.0 flag 0 
jf @NONAME_857 
if 
8119:   not car [email protected] wrecked 
jf @NONAME_857 
if 
8118:   not actor [email protected] dead 
jf @NONAME_609 
jump @NONAME_439 

:NONAME_439
wait 0 
if and
80DF:   not actor $PLAYER_ACTOR driving 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 15.0 15.0 150.0 flag 0 
jf @NONAME_360 
0633: AS_actor [email protected] exit_car 
0633: AS_actor [email protected] exit_car 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
jump @NONAME_707 

:NONAME_517
wait 0 
00AA: store_car [email protected] position_to [email protected] [email protected] [email protected] 
if and
80DF:   not actor $PLAYER_ACTOR driving 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 15.0 15.0 150.0 flag 0 
jf @NONAME_628 
0633: AS_actor [email protected] exit_car 
0633: AS_actor [email protected] exit_car 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
05E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR 
jump @NONAME_707 

:NONAME_609
wait 0 
0676: AS_actor [email protected] in_car [email protected] move_from_passengerseat_to_driverseat 
jump @NONAME_628 

:NONAME_628
wait 0 
if 
0205:   actor $PLAYER_ACTOR near_car [email protected] radius 300.0 300.0 150.0 flag 0 
jf @NONAME_857 
if 
8119:   not car [email protected] wrecked 
jf @NONAME_857 
if 
8118:   not actor [email protected] dead 
jf @NONAME_857 
jump @NONAME_517 

:NONAME_707
wait 0 
if 
8118:   not actor $PLAYER_ACTOR dead 
jf @NONAME_815 
if and
00F2:   actor [email protected] near_actor $PLAYER_ACTOR radius 300.0 300.0 0 
00F2:   actor [email protected] near_actor $PLAYER_ACTOR radius 300.0 300.0 0 
jf @NONAME_815 
if and
0118:   actor [email protected] dead 
0118:   actor [email protected] dead 
jf @NONAME_707 
if 
0741:   actor $PLAYER_ACTOR busted 
jf @NONAME_707 

:NONAME_815
wait 0 
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 
01C3: remove_references_to_car [email protected] 
0209: [email protected] = random_int_in_ranges 10000 20000 
wait [email protected] 
jump @NONAME_6 

:NONAME_857
wait 0 
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 
01C3: remove_references_to_car [email protected] 
0209: [email protected] = random_int_in_ranges 10000 20000 
wait [email protected] 
jump @NONAME_6 
 

how to fix this script for ped bikers.

Your script is big sh*t

You need to start as beginner and gain experience by writing small and simple scripts

1. it needs allways to check if $PLAYER_CHAR is defined before running any code depending to $PLAYER_CHAR or $PLAYER_ACTOR

2. start your script with a condition that activates the mod, check by key_press or a location check

 

read more here

 

check out the template below (press backace to spawn actor infront of CJ)

{$CLEO .cs}
:Actor_1
thread 'Actor'

:Actor_2
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Actor_2
if
0AB0:   key_pressed 8//-----------------------------press Backspace
jf @Actor_2

0247: request_model #BALLAS1
0247: request_model #AK47

:Load_models_check
wait  0
00D6: if  and
0248:   model #BALLAS1 available
0248:   model #AK47 available
jf @Load_models_check
04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 5.0  0.5
009A: 1@ = create_actor  7 #BALLAS1 at  11@ 12@ 13@
01B2: give_actor 1@ weapon  30 ammo  99999  // Load the weapon model before using this
02E2: set_actor 1@ weapon_accuracy_to  100
0249: release_model #BALLAS1

:Loop_1
wait  0
if
0256:   player $PLAYER_CHAR defined
jf @Cleanup_1
if
8118:   NOT   actor 1@ dead
jf @Cleanup_1
if
0104:   actor $PLAYER_ACTOR near_actor 1@ radius  80.0  80.0  10.0 sphere  0
jf @Cleanup_1
jump @Loop_1

:Cleanup_1
01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian
jump @Actor_2

 

11 minutes ago, Uchiha Batuhan said:

Hello By Zaz. Since I'm New To GtaForums, I Can't Assign You Dm. Where Can I Reach You?

here

Link to comment
Share on other sites

Uchiha Batuhan

I Want An Effect To Go Until It Hit Anywhere On The Key. How Can I Do That?

Link to comment
Share on other sites

  • 4 months later...
greenops011

so, just curious, what syntax language should I use in Notepad++ to make cleo code easier to read? C++? or something else

Link to comment
Share on other sites

Posted (edited)
On 3/30/2021 at 4:10 PM, greenops011 said:

so, just curious, what syntax language should I use in Notepad++ to make cleo code easier to read? C++? or something else

 

There isn't any syntax language in Notepad++ that looks good for scm. VisualBasic maybe, but i think it needs a new own one.

 

I recommand to use Sannybuilder, it has a good highlightning feature. It is stored in Sannybuilder\data\settings.ini

I can share the content of my settings.ini (open spoiler)

Sannybuilder version 3.7.0

Spoiler

[SA]
GamePath=R:\Grand Theft Auto San Andreas
OpcodesPath=F:\GTA mod\Mission\Sanny Builder 3\data\sa\SASCM.ini
[Main]
EditMode=sa
Window::Left=590
Window::Top=139
Window::Width=1024
Window::Height=760
Window::Maximized=1
Editor::ShowPanel=1
Editor::ShowOpcodeInfo=1
Editor::ShowGutterBorder=0
Editor::IdentifiersListAuto=1
Editor::OpenLastFile=0
Editor::OpenAllClosedFiles=0
Editor::NumberOfClosedFiles=4
Editor::ShowLineNumbers=1
Editor::ConfirmExit=0
Editor::LookingDepth=250
Editor::ToolbarDock=0
Editor::HintWindowWidth=566
Editor::HintWindownLines=84
Engine::ShowReport=1
Engine::ShowProgress=1
Engine::EditMode=2
CustomNames::UseCustomLabels=1
CustomNames::UseCustomVariables=1
CustomNames::UseCustomArrays=0
CustomNames::CustomNamesFormat=0
Compiler::ShowIMGWarning=1
Compiler::CheckConditions=1
Compiler::CheckLocalVariables=1
Compiler::AddExtraInfo=0
Decompiler::OverwriteOutputFile=0
Decompiler::AlwaysWriteOpcodes=1
Decompiler::ReplaceMissionNumbers=0
Decompiler::ManualIMGOpening=0
Decompiler::InsertOriginalMissionNames=1
Colors::ActiveLineColor=536870911
Colors::GutterColor=16777215
Colors::EditorColor=16777215
AlwaysSearchFromCaret=0
QuickGameLoading=1
AutoCheckForUpdates=0
Editor::Font=-16777208|-13|Courier New|0|96|10|nnnn
Editor::LanguageService=1
[Lang]
Lang=1031
[Console]
Window::Left=1460
Window::Top=594
Window::Width=460
Window::Height=456
[Formats]
Formats::HexadimalOffsets=0
Formats::LabelsFormat=2
N1=$dir\$name.txt
N2=$dir\$name.scm
N3=$dir\script.img
[Hotkeys]
hkCoordMan=49201
hkOST=49202
hkInsPlayerCoord=24643
hkInsPlayerAngle=24645
hkGoto=16455
hkComment=16465
hkConvertNumber=16456
hkConvertModel=49224
[UserTools]
ToolName1=
ToolPath1=
ToolParams1=
ToolShortCut1=
ToolName2=
ToolPath2=
ToolParams2=
ToolShortCut2=
ToolName3=
ToolPath3=
ToolParams3=
ToolShortCut3=
ToolName4=
ToolPath4=
ToolParams4=
ToolShortCut4=
ToolName5=
ToolPath5=
ToolParams5=
ToolShortCut5=
ToolName6=
ToolPath6=
ToolParams6=
ToolShortCut6=
ToolName7=
ToolPath7=
ToolParams7=
ToolShortCut7=
ToolName8=
ToolPath8=
ToolParams8=
ToolShortCut8=
ToolName9=
ToolPath9=
ToolParams9=
ToolShortCut9=
[Class]
Background=536870911
Foreground=32896
Style=1
[Command]
Background=536870911
Foreground=8421376
Style=1
[Comment]
Background=536870911
Foreground=8388608
Style=2
[Directive]
Background=536870911
Foreground=32768
Style=0
[Label]
Background=536870911
Foreground=32768
Style=1
[Model]
Background=536870911
Foreground=128
Style=1
[Number]
Background=536870911
Foreground=128
Style=0
[Reserved Word]
Background=536870911
Foreground=536870911
Style=1
[Space]
Background=536870911
Foreground=536870911
Style=0
[String]
Background=536870911
Foreground=255
Style=0
[Symbol]
Background=536870911
Foreground=-16777208
Style=0
[Variable]
Background=536870911
Foreground=16711680
Style=0
[MRUFiles]
MRUFile1=F:\GTA mod\Mission\SAnnySCript\01_Best scripts\000_SASCM_Opcodes.txt
MRUMarks1=5,6773;
MRUFile2=F:\GTA mod\Mission\SAnnySCript\Tut\Object_spawn.txt
MRUMarks2=1,1;
MRUFile3=F:\GTA mod\Mission\SAnnySCript\Tut\Objectspawner.txt
MRUMarks3=52,11;
MRUFile4=F:\GTA mod\Mission\SAnnySCript\Tut\INT_2_STRING.txt
MRUMarks4=1,1;
MRUFile5=F:\GTA mod\Mission\SAnnySCript\Tut\Explosion-tests.txt
MRUMarks5=139,14;
MRUFile6=F:\GTA mod\Mission\SAnnySCript\01_Best scripts\00_3_GangWarZone_Strippedmain.txt
MRUMarks6=97,146;
MRUFile7=F:\GTA mod\Mission\SAnnySCript\FanHelp\V_GROUP as_leader-N1.txt
MRUMarks7=33,55;
MRUFile8=F:\GTA mod\Mission\SAnnySCript\01_Best scripts\Gangspawn_big.txt
MRUMarks8=17,1224;
MRUModes1=sa
MRUModes2=sa
MRUModes3=sa
MRUModes4=sa
MRUModes5=sa
MRUModes6=sa
MRUModes7=sa
MRUModes8=sa
[OST]
yPos=231
xPos=505
fW=910
fH=618
extra_search=0
delay=300
[VC]
GamePath=M:\Games\Grand Theft Auto Vice City
OpcodesPath=F:\GTA mod\Mission\Sanny Builder 3\data\vc\VCSCM.ini
[SA Mobile]
GamePath=
OpcodesPath=F:\GTA mod\Mission\Sanny Builder 3\data\sa_mobile\SASCM.ini
[GTA3]
GamePath=L:\GTAIII
OpcodesPath=F:\GTA mod\Mission\Sanny Builder 3\data\gta3\SCM.ini

[GTA SA SCR]
GamePath=R:\Grand Theft Auto San Andreas
OpcodesPath=F:\GTA mod\Mission\Sanny Builder 3\data\sa_scr\SASCM.ini
[Identifier]
Background=536870911
Foreground=536870911
Style=0
Smart=1

 

 

Note: the sections you need for highlightning are these below

 

[Class]
Background=536870911
Foreground=32896
Style=1
[Command]
Background=536870911
Foreground=8421376
Style=1
[Comment]
Background=536870911
Foreground=8388608
Style=2
[Directive]
Background=536870911
Foreground=32768
Style=0
[Label]
Background=536870911
Foreground=32768
Style=1
[Model]
Background=536870911
Foreground=128
Style=1
[Number]
Background=536870911
Foreground=128
Style=0
[Reserved Word]
Background=536870911
Foreground=536870911
Style=1
[Space]
Background=536870911
Foreground=536870911
Style=0
[String]
Background=536870911
Foreground=255
Style=0
[Symbol]
Background=536870911
Foreground=-16777208
Style=0
[Variable]
Background=536870911
Foreground=16711680
Style=0

 

 

 

Edited by ZAZ
Link to comment
Share on other sites

No name 1990

Anyone know? How to change colour Cleo master spark gta sa?

Link to comment
Share on other sites

  • 4 months later...
Brad4869

Hello @ZAZ I need Help, I don't know how to make Script about How to Other Actors like CivMale and CivFemale aggresive or helping Player Actor (CJ) toward Enemies Actors like Gang1 (Ballas), Gang3 (Vagos), Gang5(Da Nang Boys), Gang6(Mafia) and Criminal. Can you tell me @ZAZ please ?

 

Link to comment
Share on other sites

suraj_singh_thugesh

Hello @ZAZ

I need a help in one of the collision script.

I saw one of your movable collision tutorial which was awesome but I don't know the concept of multiple or repeated collision of the object. I'm making a "Captain America shield mod" in which I need the object to collide at least 2 times and then return back to player's hand. I made the script for first collision but find hard to make the script for second collision. Please help me !!!!

 

I want to make the collision script like this one: 

 

The author(IN45DO) is pretty famous for his marvel mods and most probably u already know him, but now he left modding and won't release this mod. Please help us.

 

Source code:

 

:Shield_throw

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.4 0.0
0107: [email protected] = create_object 3065 at [email protected] [email protected] [email protected]
0750: set_object [email protected] visibility 0 
0107: [email protected] = create_object 331 at 0.0 0.0 0.0
0172: [email protected] = actor $PLAYER_ACTOR Z_angle
[email protected] += 270.0
0177: set_object [email protected] Z_angle_to [email protected]
0177: set_object [email protected] Z_angle_to [email protected]
069A: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 270.0 0.0 0.0
0382: set_object [email protected] collision_detection 0
04D9: object [email protected] set_scripted_collision_check 1
0382: set_object [email protected] collision_detection 1
0906: set_object [email protected] mass_to 30000.0 // float
0908: set_object [email protected] turn_mass_to 30000.0 // float
0172: [email protected] = actor $PLAYER_ACTOR Z_angle
02F6: [email protected] = cosine [email protected] // (float)
02F7: [email protected] = sine [email protected] // (float)
0013: [email protected] *= 100.1               
0013: [email protected] *= 100.1
0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground
[email protected] *= -1.0
[email protected] += 1.0
0392: make_object [email protected] moveable 1
0381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]
[email protected] = 0

:If_Collide
wait 0
0992: set_player $PLAYER_CHAR weapons_scrollable 0
094E: set_actor $PLAYER_ACTOR mute_pain_audio 1
0226: [email protected] = actor $PLAYER_ACTOR health
[email protected] += 1
0223: set_actor $PLAYER_ACTOR health_to [email protected]
if or
04DA:   has_object [email protected] collided
[email protected] > 3000
jf @Collided
0188: [email protected] = create_marker_above_object [email protected] 
[email protected] = 0

:Collided
0177: set_object [email protected] Z_angle_to [email protected]
0177: set_object [email protected] Z_angle_to [email protected]
0172: [email protected] = actor $PLAYER_ACTOR Z_angle
02F6: [email protected] = cosine [email protected] // (float)
02F7: [email protected] = sine [email protected] // (float)
0013: [email protected] *= 100.1               
0013: [email protected] *= 100.1
0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground
[email protected] *= -1.0
[email protected] += 1.0
Object.CollisionDetection([email protected]) = False
object.StorePos([email protected], [email protected], [email protected], [email protected])
Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])
0392: make_object [email protected] moveable 1
0381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]

Link to comment
Share on other sites

  • 4 weeks later...
BilinmeyenBey
On 7/2/2009 at 11:01 PM, ZAZ said:

 

use google translater click me

 

_____________________________________________________________________________________

 

 

Catch random actor

 

 

There are several opcodes to get random actors at several points :

 

 

089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 5.0 handle_as [email protected] // versionB 08E5: get_actor_in_sphere [email protected] [email protected] [email protected] radius 50.0 handle_as [email protected] 073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected] 
 

 

 

But they couldn't get gang type, drug dealer, and any other actors (especially custom actors in missions!)

 

furthermore there is a cleo opcde :

 

 

0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected]
 

 

 

But, it only get the nearest actor, otherwise you can't!

And also if these opcodes used in a place without any single human, it will gone crash!

 

------------------------------------------------------------------------------------------------------

 

Our member Wesser posted a method to get every actor in the gameworld, also those of missions, extern scripts as well as other cleo script except those of the food stores like burgershop etc.

 

find Wessers original template here: call_func @getActorInSphere

 

He used the opcode 0AB1: call_func which is explained above, in previous theme

furthermore the for-to-step-method which is used in several programming languages and supported in Sannybuilder

The for loop repeats a block of code while a control variable runs through an arithmetic progression.

 

A smaller and faster vaiation was done by Deji. Find the template >here<

 

To make it more clear I composed and recompiled Wessers script into an example for gta praxis

1. script with opcodes

2. script without opcodes

The script catches any random actor, shows his pedtype and let him die

 

1. script with opcodes

 

{$CLEO .cs}:RandomActor_for_to_step_methodthread 'RAFSTEP':RAFSTEP_10001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @RAFSTEP_1 00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] 0AB1: call_scm_func @RAFSTEP_func 4 [email protected] [email protected] [email protected] 5.0 [email protected] 00D6: if 8039:   not  [email protected] == -1 004D: jump_if_false @RAFSTEP_1 00D6: if 8118:   not actor [email protected] dead 004D: jump_if_false @RAFSTEP_1 089F: get_actor [email protected] pedtype_to [email protected] 03F0: enable_text_draw 1 0001: wait 50 ms 03F0: enable_text_draw 0 0001: wait 50 ms 045A: draw_text_1number 250.0 40.0 GXT 'NUMBER' number [email protected]  // ~1~05BE: AS_kill_actor [email protected] 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 0002: jump @RAFSTEP_1 :RAFSTEP_func0006: [email protected] = 0 0006: [email protected] = 0 :RAFSTEP_countLoop00D6: if 056D:   actor [email protected] defined 004D: jump_if_false @RAFSTEP_11 00D6: if and803B:   not  $PLAYER_ACTOR == [email protected] // (int) 00FE:   actor [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius [email protected] [email protected] [email protected] 004D: jump_if_false @RAFSTEP_11 0006: [email protected] = 1 0002: jump @RAFSTEP_12 :RAFSTEP_11000A: [email protected] += 1 00D6: if 0019:   [email protected] > 30000 004D: jump_if_false @RAFSTEP_countLoop :RAFSTEP_1200D6: if 0039:   [email protected] == 0 004D: jump_if_false @RAFSTEP_Result 0006: [email protected] = -1 :RAFSTEP_Result0AB2: ret 1 [email protected] 
 

 

 

2. script without opcodes

 

{$CLEO .cs}:RandomActor_for_to_step_methodthread 'RAFSTEP' :RAFSTEP_1wait 0 if   Player.Defined($PLAYER_CHAR)jf @RAFSTEP_1 Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])0AB1: call_scm_func @RAFSTEP_func 4 [email protected] [email protected] [email protected] 5.0 [email protected] if   not [email protected] == -1 jf @RAFSTEP_1 if   not Actor.Dead([email protected])jf @RAFSTEP_1 089F: get_actor [email protected] pedtype_to [email protected] 03F0: enable_text_draw 1 wait 50 03F0: enable_text_draw 0 wait 50 045A: draw_text_1number 250.0 40.0 GXT 'NUMBER' number [email protected]  // ~1~05BE: AS_kill_actor [email protected] Actor.RemoveReferences([email protected])jump @RAFSTEP_1 :[email protected] = 0 [email protected] = 0 :RAFSTEP_countLoopif   Actor.Defined([email protected])jf @RAFSTEP_11 if and803B:   not  $PLAYER_ACTOR == [email protected] // (int) 00FE:   actor [email protected] sphere 0 in_sphere [email protected] [email protected] [email protected] radius [email protected] [email protected] [email protected] jf @RAFSTEP_11 [email protected] = 1 jump @RAFSTEP_12 :[email protected] += 1if  [email protected] > 30000 jf @RAFSTEP_countLoop :RAFSTEP_12if  [email protected] == 0 jf @RAFSTEP_Result [email protected] = -1 :RAFSTEP_Result0AB2: ret 1 [email protected] 
 

 

 

@ZAZ I'm an bit idiot and noob of coding. But is this the script that allows you to put an actor on map? (I want to add an actor in an coord of San Andreas)

Link to comment
Share on other sites

  • 2 months later...

I wrote a script to throw an object. But I can't solve one problem for a long time. After being thrown, the object disappears after a few seconds. And I need him to stay where he fell.

 

[email protected] = object.Create(3065, 0.0, 0.0, 0.0)
0392: make_object [email protected] moveable 1
Object.SetImmunities([email protected],1,1,1,1,1)

070A: AS_actor $bg attach_to_object [email protected] offset 0.04 0.1 -0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time -1
066E: create_particle "SMOKE_FLARE" attached_to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 flag 1 handle_as $sm
064C: make_particle $sm visible
wait 1500
00AA: store_car $Car1 position_to $bgbgX $bgbgY $bgbgZ
wait 50
01BB: store_object [email protected] position_to $bgX $bgY $bgZ 
0063: $bgbgX -= $bgX
0063: $bgbgY -= $bgY
$bgbgZ += 0.7

0605: actor $bg perform_animation_sequence "WEAPON_throw" from_file "GRENADE" 4.0 loop 0 0 0 0 -1 ms
wait 500
070B: set_actor $bg onbone_attached_object_operation 0
0682: detach_object [email protected] 0.0 0.0 0.0 collision_detection 0
Object.ToggleInMovingList([email protected]) = True
Object.Throw([email protected], $bgbgX, $bgbgY, $bgbgZ)

wait 500
04D9: object [email protected] set_scripted_collision_check 1
0382: set_object [email protected] collision_detection  1
0906: set_object [email protected] mass_to 35.0 // float 
0908: set_object [email protected] turn_mass_to 35.0 // float
wait 3500
01BC: put_object [email protected] at $faerx $faery $faerz
wait 3500

 

After this code, there is no mention of this object in the script.

 

Link to comment
Share on other sites

19 hours ago, ED9M said:

I wrote a script to throw an object. But I can't solve one problem for a long time. After being thrown, the object disappears after a few seconds. And I need him to stay where he fell.

After this code, there is no mention of this object in the script.

 

Sorry, i can't test your codes because

1. it's not a complete script

2. it's full of gloabal vars
you should not use globals in cleo scripts, because they can cause bugs and crashes

 

 


The values for opcode 0381: throw_object, are something like a thrust

with these values:

0381: throw_object 1@ velocity_in_direction 0.0 2.2  7.5

the beachball makes a hopp like a frog, in direction north

 

test the script below

{$CLEO .cs}
thread 'TRWOBJ'

while true
    wait 0
    if  and
        0256:   player $PLAYER_CHAR defined
        0AB0:   key_pressed 8//-----------------------------press backspace
    then
        0247: request_model 1598
        038B: load_requested_models
        04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 2.0  0.5
        0107: 1@ = create_object 1598	 at  11@ 12@ 13@
        0392: make_object 1@ moveable 1 
        0381: throw_object 1@ velocity_in_direction 0.0 2.2  7.5        
        wait 3000
        0108: destroy_object 1@
        0249: release_model 1598
    end
end

 


with these values:

0381: throw_object 1@ velocity_in_direction 0.0 20.2  12.5

the beachball will be thrown like a basketball, in direction north

 

with these values:

0381: throw_object 1@ velocity_in_direction 0.0 205.2  7.5

the beachball flies like a rocket, in direction north

 

But how to give a direction to the thrust?

If you know the z_angle for the throw direction
Then you can calculate basics xy values by sin/cosin of the z_angle
And then a multiplier can be used to increase the basics xy values till the object has enough thrust

 

To get the z value another calculation is needed, this depends to the purpose of the object

 

Note: the sin/cosin calculation give different results, depending to the quater of the coords system
you know, coords of west/north quater are minus/plus, east/north are plus/plus, west/south are minus/minus, east/south are plus/minus
This can be fixed by a multiplier of -1.0 for one of the xy values

 

test the script below

{$CLEO .cs}
thread 'TRWOBJ'

while true
    wait 0
    if  and
        0256:   player $PLAYER_CHAR defined
        0AB0:   key_pressed 8//-----------------------------press backspace
    then
        0247: request_model 1598
        038B: load_requested_models
        04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset  0.0 2.0  0.5
        0107: 1@ = create_object 1598	 at  11@ 12@ 13@
        
        0172: 19@ = actor $PLAYER_ACTOR Z_angle 
        02F6: 15@ = sine 19@ // (float) 
        02F7: 16@ = cosine 19@ // (float) 
        15@ *= 20.0 // (float) 
        16@ *= 20.0 // (float) 
        15@ *= -1.0                
        
        0392: make_object 1@ moveable 1 
        0381: throw_object 1@ velocity_in_direction 15@ 16@  7.5        
        wait 3000
        0108: destroy_object 1@
        0249: release_model 1598
    end
end

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

2 hours ago, ZAZ said:

you should not use globals in cleo scripts, because they can cause bugs and crashes

Thanks. I will replace all globals with local ones.

 

2 hours ago, ZAZ said:

But how to give a direction to the thrust?

If you know the z_angle for the throw direction
Then you can calculate basics xy values by sin/cosin of the z_angle
And then a multiplier can be used to increase the basics xy values till the object has enough thrust

 

To get the z value another calculation is needed, this depends to the purpose of the object

 

Note: the sin/cosin calculation give different results, depending to the quater of the coords system
you know, coords of west/north quater are minus/plus, east/north are plus/plus, west/south are minus/minus, east/south are plus/minus
This can be fixed by a multiplier of -1.0 for one of the xy values

Thanks also for this information. I found another way to get the right direction as well. It is comparable to the method that I use when writing scripts for GTA 4 and GTA 5. The scheme is as follows: target position - starting position. In this case it is:

0063: $bgbgX -= $bgX
0063: $bgbgY -= $bgY

Of course, I will replace these globals with locals. But the object is flying in the right direction. The actor throws the object into the car, as I wanted to implement.

 

 

Link to comment
Share on other sites

On 11/2/2021 at 1:00 PM, ED9M said:

I wrote a script to throw an object. But I can't solve one problem for a long time. After being thrown, the object disappears after a few seconds. And I need him to stay where he fell.

 

you want to lock the object position in the moment when it collidies?

Link to comment
Share on other sites

18 hours ago, ZAZ said:

you want to lock the object position in the moment when it collidies?

I want the object to stay in place and not disappear.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.