Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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. Grand Theft Auto Series

      1. Bugs*
      2. 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. GTA San Andreas

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

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

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. 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

    2. Support

    3. Suggestions

attach peds to cars


cosme
 Share

Recommended Posts

yes, it's called "put_actor into_turret_on_car"

2 different opcodes
 

0464: put_actor $PLAYER_ACTOR into_turret_on_car 6@ at_car_offset -0.2 0.5 0.0 position 0 shooting_angle_limit 0.0 with_weapon 0
06A7: put_actor $PLAYER_ACTOR into_turret_on_car 6@ at_car_offset -0.2 0.5 0.0 position 1 shooting_angle 110.0 70.0 with_weapon 43

 

Link to comment
Share on other sites

hello again, sorry for so many questions but that OPCODE where should I write it? I recently downloaded a script that you shared in a post (NPC CAR ON CARREC) and wanted to spawn a car next to an npc that shoots me while driving

 

// This file was decompiled using SASCM.ini published on 2021-07-05
{$CLEO .cs}

script_name 'NPCAREC' 
[email protected] = 411 
[email protected] = 234 
[email protected] = 900 

:NPCAREC_35
wait 0 
if 
   Player.Defined($PLAYER_CHAR)
jf @NPCAREC_175 
077E: get_active_interior_to [email protected] 
if and
  [email protected] == 0 
is_key_pressed 9 
is_key_pressed 81 
jf @NPCAREC_175 
gosub @NPCAREC_182 
wait 500 
05EB: assign_car [email protected] to_path [email protected] 
TIMERB = 0 

:NPCAREC_113
   Player.Defined($PLAYER_CHAR)
jf @NPCAREC_163 
wait 0 
if or
is_key_pressed 48 
860E:   not car [email protected] assigned_to_path 
jf @NPCAREC_156 
jump @NPCAREC_163 

:NPCAREC_156
jump @NPCAREC_113 

:NPCAREC_163
gosub @NPCAREC_293 
wait 1000 

:NPCAREC_175
jump @NPCAREC_35 

:NPCAREC_182
Model.Load([email protected])
Model.Load([email protected])
07C0: load_path [email protected] 
038B: load_requested_models 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 8.0 1.2 
Car.Create([email protected], [email protected], [email protected], [email protected], [email protected])
Car.Health([email protected]) = 20000
Actor.CreateAsDriver([email protected], PedType.Mission1, [email protected], [email protected])
Marker.CreateAboveCar([email protected], [email protected])
018B: set_marker [email protected] radar_mode 2 
Model.Destroy([email protected])
Model.Destroy([email protected])
return 

:NPCAREC_293
0873: release_path [email protected] 
Marker.Disable([email protected])
Actor.DestroyInstantly([email protected])
Car.Destroy([email protected])
return 
Link to comment
Share on other sites

19 hours ago, cosme said:

I  wanted to spawn a car next to an npc that shoots me while driving

 

in this case you should know that there's another code that let npc do driveby action when he's placed on passenger seat or driver seat

0713: actor 5@ driveby_actor $PLAYER_ACTOR car -1 point 0.0  0.0  0.0 radius 300.0  8  0 firing_rate 100

 

it looks better, but then he can only use pistol or micro_uzi

 

using other weapons needs to put_actor into_turret_on_car

 

 

 

Link to comment
Share on other sites

Hello, thanks for answering, I was testing what you said but put "put_actor into_turret_on_car" press tab + q the car appears only with its driver (remember I am doing a mission with dyom and its path cleo). I don't know what I'm doing wrong, I'll need to see more tutorials

 

:NPCAREC_190
Model.Load([email protected])
Model.Load([email protected])
Model.Load([email protected])
0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset [email protected] [email protected] [email protected] position 0 shooting_angle_limit 0.0 with_weapon 0 
07C0: load_path [email protected] 
038B: load_requested_models 
04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 8.0 1.2 
Car.Create([email protected], [email protected], [email protected], [email protected], [email protected])
Car.Health([email protected]) = 20000
Actor.CreateAsDriver([email protected], PedType.Mission1, [email protected], [email protected])
Marker.CreateAboveCar([email protected], [email protected])
018B: set_marker [email protected] radar_mode 2 
Model.Destroy([email protected])
Model.Destroy([email protected])
Model.Destroy([email protected])
return 
Link to comment
Share on other sites

 

It needs to create the actor first and also it needs to give him a weapon

I made 2 scripts

1. first one spawns actor and put him into_turret_on_car with AK47

2. the other script place actor on passenger seat and let him do driveby action with micro_uzi

 

Spoiler

actor into_turret_on_car with AK47

{$CLEO .cs}
:NPC_CAR_ON_CARREC_PATH
thread 'NPCAREC'

1@ = 411// 	infernus // < --- vehicle model ID
2@ = 234// SWMOCD // < --- ped model ID
3@ = 900 // < --- carrec path

while true
wait 0
    if
        0256:   player $PLAYER_CHAR defined
    then
        077E: get_active_interior_to 0@
        if  and
            0@ == 0
            0AB0:   key_pressed 9// 	tab key
            0AB0:   key_pressed 81// 	q key
        then
            gosub @carspawn
            wait 500 
            05EB: assign_car 4@ to_path 3@        
            33@ = 0
            


            while Player.Defined($PLAYER_CHAR)
            wait 0
                if  or
                    0AB0:   key_pressed 48// 	0 key  (ZERO)
                    860E:  not car 4@ assigned_to_path
                then 
                    break
                end                        

            end


            //00BA: show_text_styled GXT 'fem_off' time 1000 style 4
            gosub @cleanup
            wait 1000        
        end
    end
end



:carspawn
0247: request_model 1@
0247: request_model 2@
0247: request_model #AK47
07C0: load_path 3@
038B: load_requested_models
04C4: store_coords_to 11@ 12@ 13@  from_actor $PLAYER_ACTOR with_offset 0.0 8.0 1.2
00A5: 4@ = create_car 1@ at 11@ 12@ 13@
0224: set_car 4@ health_to 20000
0129: 5@ = create_actor  24 2@ in_car 4@ driverseat
0186: 6@ = create_marker_above_car 4@
018B: set_marker 6@ radar_mode 2
009A: 7@ = create_actor  24 2@ at  11@ 12@  -53.5
01B2: give_actor 7@ weapon 30 ammo 9999
02E2: set_actor 7@ weapon_accuracy_to 100
0464: put_actor 7@ into_turret_on_car 4@ at_car_offset 0.0 -2.5 1.0 position 0 shooting_angle_limit 360.0 with_weapon 30
05E2: AS_actor 7@ kill_actor $PLAYER_ACTOR
0249: release_model 1@
0249: release_model 2@
return

:cleanup
0873: release_path 3@
0164: disable_marker 6@
009B: destroy_actor 7@
009B: destroy_actor 5@
00A6: destroy_car 4@
return

 

 

 

Spoiler

 

actor on passenger seat does driveby action with micro_uzi

{$CLEO .cs}
:NPC_CAR_ON_CARREC_PATH
thread 'NPCAREC'

1@ = 411// 	infernus // < --- vehicle model ID
2@ = 234// SWMOCD // < --- ped model ID
3@ = 900 // < --- carrec path

while true
wait 0
    if
        0256:   player $PLAYER_CHAR defined
    then
        077E: get_active_interior_to 0@
        if  and
            0@ == 0
            0AB0:   key_pressed 9// 	tab key
            0AB0:   key_pressed 81// 	q key
        then
            gosub @carspawn
            wait 500 
            05EB: assign_car 4@ to_path 3@        
            33@ = 0
            


            while Player.Defined($PLAYER_CHAR)
            wait 0
                if  or
                    0AB0:   key_pressed 48// 	0 key  (ZERO)
                    860E:  not car 4@ assigned_to_path
                then 
                    break
                end                        

            end


            //00BA: show_text_styled GXT 'fem_off' time 1000 style 4
            gosub @cleanup
            wait 1000        
        end
    end
end



:carspawn
0247: request_model 1@
0247: request_model 2@
0247: request_model #MICRO_UZI
07C0: load_path 3@
038B: load_requested_models
04C4: store_coords_to 11@ 12@ 13@  from_actor $PLAYER_ACTOR with_offset 0.0 8.0 1.2
00A5: 4@ = create_car 1@ at 11@ 12@ 13@
0224: set_car 4@ health_to 20000
0129: 5@ = create_actor  24 2@ in_car 4@ driverseat
0186: 6@ = create_marker_above_car 4@
018B: set_marker 6@ radar_mode 2
01C8: 7@ = create_actor_pedtype 24 model 2@ in_car 4@ passenger_seat 0
01B2: give_actor 7@ weapon 28 ammo 9999
02E2: set_actor 7@ weapon_accuracy_to 100
0713: actor 7@ driveby_actor $PLAYER_ACTOR car -1 point 0.0  0.0  0.0 radius 300.0  8  0 firing_rate 100
0249: release_model 1@
0249: release_model 2@
return

:cleanup
0873: release_path 3@
0164: disable_marker 6@
009B: destroy_actor 7@
009B: destroy_actor 5@
00A6: destroy_car 4@
return

 

 

 

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

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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