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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

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

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
Rogui20

[SA] Actor exiting the vehicle issue

Recommended Posts

Rogui20

I'm trying to make the actor do a driveby to kill CJ, but when i put the code to make the actor kill the player_actor, he exits the vehicle. How to fix this? Here the code:

{$CLEO .cs}
0000: 'Grove Street Survival'
:survival1
wait 1000
if
0AB0: key_pressed 90
004D: jump_if_false @survival1 
07A7: put_jetpack_on_actor $PLAYER_ACTOR
model.Load(#FAM1)
model.Load(#BALLAS1)
model.Load(#MP5LNG)
model.Load(#REMINGTN)
model.Load(#HUNTLEY)
038B: load_requested_models
 
:survival2

0248:  model #FAM1 available 
0248:  model #BALLAS1 available 
0248:  model #MP5LNG available 
0248:  model #REMINGTN available 
004D: jump_if_false @survival2
00A5: $Car1 = create_car #REMINGTN at 2482.1038 -1678.6437 13.3339
0175: set_car $Car1 Z_angle_to 175.735
0224: set_car $Car1 health_to 10000 
00A5: $Car2 = create_car #REMINGTN at 2488.3481 -1659.6324 13.3359
0175: set_car $Car2 Z_angle_to 357.76
0224: set_car $Car2 health_to 10000  
00A5: $BCar1 = create_car #REMINGTN at 2442.7988 -1659.9312 13.3088
0175: set_car $BCar1 Z_angle_to 181.7349
0224: set_car $BCar1 health_to 10000  

009A: $Actor1 = create_actor_pedtype 8 model #FAM1 at 2494.1746 -1692.8381 23.6477
0173: set_actor $Actor1 Z_angle_to 357.8067
01B2: give_actor $Actor1 weapon 29 ammo 9999
0223: set_actor $Actor1 health_to 100 
02E2: set_actor $Actor1 weapon_accuracy_to 50 
0631: put_actor $Actor1 in_group $PLAYER_GROUP
009A: $Actor2 = create_actor_pedtype 8 model #FAM1 at 2502.1443 -1667.2227 13.3596
0173: set_actor $Actor2 Z_angle_to 89.8809
01B2: give_actor $Actor2 weapon 29 ammo 9999 
0223: set_actor $Actor2 health_to 100 
02E2: set_actor $Actor2 weapon_accuracy_to 50 
0631: put_actor $Actor2 in_group $PLAYER_GROUP 
009A: $Actor3 = create_actor_pedtype 8 model #FAM1 at 2486.9563 -1678.322 13.3366
0173: set_actor $Actor3 Z_angle_to 88.3142
01B2: give_actor $Actor3 weapon 29 ammo 9999 
0223: set_actor $Actor3 health_to 100 
02E2: set_actor $Actor3 weapon_accuracy_to 50 
0631: put_actor $Actor3 in_group $PLAYER_GROUP 
 
009A: $Balla1 = create_actor_pedtype 7 model #BALLAS1 at 2435.1963 -1662.2817 13.3828
0173: set_actor $Balla1 Z_angle_to 272.2192
01B2: give_actor $Balla1 weapon 29 ammo 9999 
0223: set_actor $Balla1 health_to 100 
02E2: set_actor $Balla1 weapon_accuracy_to 50 
07A5: AS_actor $Balla1 attack_actor $Actor1 150000 ms 

009A: $Balla2 = create_actor_pedtype 7 model #BALLAS1 at 2434.8538 -1658.0133 13.3828
0173: set_actor $Balla2 Z_angle_to 272.9158
01B2: give_actor $Balla2 weapon 29 ammo 9999 
0223: set_actor $Balla2 health_to 100 
02E2: set_actor $Balla2 weapon_accuracy_to 50 
07A5: AS_actor $Balla2 attack_actor $Actor2 150000 ms 

009A: $Balla3 = create_actor_pedtype 7 model #BALLAS1 at 2443.8667 -1658.9528 13.3047
0173: set_actor $Balla3 Z_angle_to 271.6392
01B2: give_actor $Balla3 weapon 29 ammo 9999 
0223: set_actor $Balla3 health_to 100 
02E2: set_actor $Balla3 weapon_accuracy_to 50 
07A5: AS_actor $Balla3 attack_actor $Actor3 150000 ms 

009A: $Balla4 = create_actor_pedtype 7 model #BALLAS1 at 2460.3035 -1645.4681 13.4597
0173: set_actor $Balla4 Z_angle_to 181.7117
01B2: give_actor $Balla4 weapon 29 ammo 9999 
0223: set_actor $Balla4 health_to 100 
02E2: set_actor $Balla4 weapon_accuracy_to 50 
07A5: AS_actor $Balla4 attack_actor $Actor1 150000 ms 

009A: $Balla5 = create_actor_pedtype 7 model #BALLAS1 at 2455.1709 -1680.2748 13.506
0173: set_actor $Balla5 Z_angle_to 275.7126
01B2: give_actor $Balla5 weapon 29 ammo 9999 
0223: set_actor $Balla5 health_to 100 
02E2: set_actor $Balla5 weapon_accuracy_to 50 
07A5: AS_actor $Balla5 attack_actor $Actor2 150000 ms 

:survival3
wait 0
if and
Actor.Dead($Balla1)
Actor.Dead($Balla2)
Actor.Dead($Balla3)
Actor.Dead($Balla4)
Actor.Dead($Balla5)
004D: jump_if_false @survival3
jump @survival4


:survival4
Actor.DestroyWithFade($Balla1)
Actor.DestroyWithFade($Balla2)
Actor.DestroyWithFade($Balla3)
Actor.DestroyWithFade($Balla4)
Actor.DestroyWithFade($Balla5)
00A5: $BCar2 = create_car #HUNTLEY at 2422.3303 -1658.8351 13.3828
0175: set_car $BCar2 Z_angle_to 274.1692
0224: set_car $BCar2 health_to 10000 
0129: $Balla6 = create_actor_pedtype 7 model #BALLAS1 in_car $BCar2 driverseat 
0173: set_actor $Balla6 Z_angle_to 275.7126
01B2: give_actor $Balla6 weapon 29 ammo 9999 
0223: set_actor $Balla6 health_to 100 
02E2: set_actor $Balla6 weapon_accuracy_to 50 

01C8: $Balla7 = create_actor_pedtype 7 model #BALLAS1 in_car $BCar2 passenger_seat 0 
0173: set_actor $Balla7 Z_angle_to 275.7126
01B2: give_actor $Balla7 weapon 29 ammo 9999 
0223: set_actor $Balla7 health_to 100 
02E2: set_actor $Balla7 weapon_accuracy_to 50 

01C8: $Balla8 = create_actor_pedtype 7 model #BALLAS1 in_car $BCar2 passenger_seat 1
0173: set_actor $Balla8 Z_angle_to 275.7126
01B2: give_actor $Balla8 weapon 29 ammo 9999 
0223: set_actor $Balla8 health_to 100 
02E2: set_actor $Balla8 weapon_accuracy_to 50 

01C8: $Balla9 = create_actor_pedtype 7 model #BALLAS1 in_car $BCar2 passenger_seat 2
0173: set_actor $Balla9 Z_angle_to 275.7126
01B2: give_actor $Balla9 weapon 29 ammo 9999 
0223: set_actor $Balla9 health_to 100 
02E2: set_actor $Balla9 weapon_accuracy_to 50 




01B9: set_actor $Balla6 armed_weapon_to 5 
01B9: set_actor $Balla7 armed_weapon_to 5 
01B9: set_actor $Balla8 armed_weapon_to 5 
01B9: set_actor $Balla9 armed_weapon_to 5 

020A: set_car $BCar2 door_status_to 4 
039E: set_actor $Balla6 locked 1 while_in_car 
039E: set_actor $Balla7 locked 1 while_in_car
039E: set_actor $Balla8 locked 1 while_in_car
039E: set_actor $Balla9 locked 1 while_in_car
00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected] 


00A7: car $BCar2 drive_to [email protected] [email protected] [email protected]
04BA: set_car $BCar2 speed_to 10.0 

0526: set_actor $Balla6 stay_in_car 1 
0526: set_actor $Balla7 stay_in_car 1
0526: set_actor $Balla8 stay_in_car 1
0526: set_actor $Balla9 stay_in_car 1
0713: actor $Balla6 driveby_actor $Balla6 car -1 point 0.0 0.0 0.0 radius 1000.0 4 1 firing_rate 90
0713: actor $Balla7 driveby_actor $Balla7 car -1 point 0.0 0.0 0.0 radius 1000.0 4 1 firing_rate 90
0713: actor $Balla8 driveby_actor $Balla8 car -1 point 0.0 0.0 0.0 radius 1000.0 4 1 firing_rate 90
0713: actor $Balla9 driveby_actor $Balla9 car -1 point 0.0 0.0 0.0 radius 1000.0 4 1 firing_rate 90
05E2: AS_actor $Balla6 kill_actor $PLAYER_ACTOR 
05E2: AS_actor $Balla7 kill_actor $PLAYER_ACTOR
05E2: AS_actor $Balla8 kill_actor $PLAYER_ACTOR
05E2: AS_actor $Balla9 kill_actor $PLAYER_ACTOR

:survival5
 
//0633: AS_actor $Balla6 exit_car 
//0633: AS_actor $Balla7 exit_car 
//0633: AS_actor $Balla8 exit_car 
//0633: AS_actor $Balla9 exit_car 
 

004E: end_thread 

 
 

 

Share this post


Link to post
Share on other sites
ZAZ

 

 

Remove the opcodes 05E2:  kill_actor

give $PLAYER_ACTOR for target parameter to opcode 0713:

 

0247: load_model #VBMYCR
0247: load_model #MP5LNG
038B: load_requested_models
01C8: 0@ = create_actor_pedtype 7 model #VBMYCR in_car 1@ passenger_seat 0
01B2: give_actor 0@ weapon 29 ammo 99999
02E2: set_actor 0@ weapon_accuracy_to 100
0713: actor 0@ driveby_actor $PLAYER_ACTOR car -1 point 0.0 0.0 0.0 radius 5000.0 4 1 firing_rate 40

 

 

 

In addition:

 

Don't use global variabels like $Balla6 !!

it can cause bugs and crashes

use locals instead

 

and make first a small script that works fine, only 1 car and 2 actors

 

 

also, you have to fit in a clean up section for removing the references of all the stuff that was spawned

 

and it needs to integrate conditional check to make shure that actor not dead, cars not wrecked, player_char is defined before giving commands

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.