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

    1. GTANet.com

    1. GTA Online

      1. The Contract
      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

On 11/4/2021 at 12:22 PM, ED9M said:

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

stay in which place?

also, you throw the object, how should it stay then?

Link to comment
Share on other sites

On 11/5/2021 at 3:09 PM, ZAZ said:

stay in which place?

also, you throw the object, how should it stay then?

After falling, the object must be in the place where it fell. I want everything to be realistic. In this case, the actor must throw the fire into the car. And the fire must not disappear. I already assume that it is possible to create the same object in its place after the fall. But I haven't tested how this will work yet. I don't understand why objects in GTA San Andreas disappear after being thrown. In GTA 4 and GTA 5, objects do not disappear after being thrown. In this case, fire is an object with red smoke.

Link to comment
Share on other sites

10 hours ago, ED9M said:

I don't understand why objects in GTA San Andreas disappear after being thrown.

The SA objects have different behavior, depending to settings inside object.dat
Many of them doesn't collide with map (ground, buildings)

 

But the object of your script is 3065, BBALL_col
It collides with everything and it's possible to check when it collides
It doesn't disappear
If it disappear, then it's because of your codes after the throwing

 

 

11 hours ago, ED9M said:

After falling, the object must be in the place where it fell. I want everything to be realistic. In this case, the actor must throw the fire into the car. And the fire must not disappear. I already assume that it is possible to create the same object in its place after the fall. But I haven't tested how this will work yet.

 

disable collision, when it collide
then the object freeze at position in the moment of the collision

if
    04DA:   has_object 0@ collided
then
    0382: set_object 0@ collision_detection  0
end

 

or read position and  create explosion or particle effect at the collisions position

if
    04DA:   has_object 0@ collided
then
    01BB: store_object 0@ position_to 14@ 15@ 16@
    064B: 20@ = create_particle "explosion_molotov"  at 14@ 15@ 16@ type 4
   064F: make_temp_particle_visible_and_remove_references 20@
end

 

Try the script below, it contains the codes of your post
But this time it's a complete script

 

Press backspace to spawn actor, car and object infront of player_actor
The actor throws the BBALL_col to the car
The object collision will be disabled for 1500ms, in the moment of collision
and object position will be read
5 seconds later everything disappear, but an explosion effect appears at position of collision

{$CLEO .cs}
thread 'OBJCARA'

while true
    wait 0

    if 
        0256:   player $PLAYER_CHAR defined
    then
        if
            0AB0:   key_pressed 8//--------------------------------- key backspace
        then
            0247: request_model #SWMOCD
            0247: request_model #ALPHA
            0247: request_model 3065
            038B: load_requested_models

            04C4: create_coordinate 21@ 22@ 23@ from_actor $PLAYER_ACTOR offset 8.0  4.0  0.2
            009A: 2@ = create_actor_pedtype 5 model #SWMOCD at 21@ 22@ 23@
            23@ += 2.5
            0107: 0@ = create_object 3065	 at  21@ 22@ 23@
            04C4: create_coordinate 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset -8.0  4.0  0.2
            00A5: 1@ = create_car #ALPHA at 11@ 12@ 13@
            0175: set_car 1@ z_angle_to 90.0
            06BA: AS_actor 2@ turn_to_and_look_at 11@ 12@ 13@
            
            repeat
                wait 0
                04ED: load_animation "GRENADE"            
            until 04EE:   animation "GRENADE" loaded
            

            //wait 1500
            0392: make_object 0@ moveable 1
            Object.SetImmunities(0@,1,1,1,1,1)

            070A: AS_actor 2@ attach_to_object 0@ 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 0@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 flag 1 handle_as 19@
            064C: make_particle 19@ visible
            wait 1500
            00AA: store_car 1@ position_to 11@ 12@ 13@
            wait 50
            01BB: store_object 0@ position_to 14@ 15@ 16@ 
            0063: 11@ -= 14@
            0063: 12@ -= 15@
            13@ += 0.7
            
            0605: actor 2@ perform_animation_sequence "WEAPON_throw" from_file "GRENADE" 4.0 loop 0 0 0 0 -1 ms
            wait 500
            070B: set_actor 2@ onbone_attached_object_operation 0
            0682: detach_object 0@ 0.0 0.0 0.0 collision_detection 0
            Object.ToggleInMovingList(0@) = True
            Object.Throw(0@, 11@, 12@, 10.0)

            wait 500
            04D9: object 0@ set_scripted_collision_check 1
            0382: set_object 0@ collision_detection  1
            0906: set_object 0@ mass_to 35.0 // float 
            0908: set_object 0@ turn_mass_to 35.0 // float
            33@ = 0
            
            while 7000 > 33@
                wait 0
                if
                    04DA:   has_object 0@ collided
                then
                    0382: set_object 0@ collision_detection  0
                    01BB: store_object 0@ position_to 14@ 15@ 16@
                    break
                end
            end
            
            wait 1500
            0382: set_object 0@ collision_detection  1
            wait 5000
            064B: 20@ = create_particle "explosion_molotov"  at 14@ 15@ 16@ type 4
            064F: make_temp_particle_visible_and_remove_references 20@
            0650: destroy_particle 19@            
            0108: destroy_object 0@
            009B: destroy_actor 2@
            00A6: destroy_car 1@
            04EF: release_animation "GRENADE"

            
        end       
    end
end

 

Link to comment
Share on other sites

Maelubiyet

Hey ZAZ. I know this is not the place but can't PM you and it seems you check this topic frequently.

 

I wonder if you could share the source texts for your gta sa stripped main script with externscripts and submissions? The links on your website are dead.

Edited by Maelubiyet
Link to comment
Share on other sites

  • 2 weeks later...
Komandan Z
On 11/5/2021 at 7:09 PM, ZAZ said:

stay in which place?

also, you throw the object, how should it stay then?

hello sir @ZAZ

Edited by Komandan Z
Link to comment
Share on other sites

Komandan Z

Hello sir @ZAZ ,sir...can you help me...how to get X rotation...using opcode store position...? For example, I use this method..

 

:A

wait 0

00AA: store_car [email protected] position_to [email protected] [email protected] [email protected] 
01BB: store_object [email protected] position_to [email protected] [email protected] [email protected]  
0063: [email protected] -= [email protected] // (float) 
0063: [email protected] -= [email protected] // (float) 
0063: [email protected] -= [email protected] // (float) 
0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]

0453: set_object [email protected] xyz_rotation [email protected] 0.0 [email protected]

Jump @A

Link to comment
Share on other sites

Truong Vu

Sorry for bump but is there any way to make traffic in gta agressive and police chase them in cleo code ? 

 

 

Link to comment
Share on other sites

There isn't any code to realize it. It needs to write a script to create such a feature.

Link to comment
Share on other sites

Speaking of traffic, is it possible to write a script that spawns traffic vehicles with specific car parts from Transfender/Loco Low/Arch Angels?

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, 1 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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