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

//-------------MAIN---------------
thread 'GUN' 
0000: NOP 
:GUN_11
wait 0 
if 
   Actor.DrivingVehicleType($PLAYER_ACTOR, #BMPR)
else_jump @GUN_11 
0@ = Actor.CurrentCar($PLAYER_ACTOR)
Model.Load(1916)
Model.Load(1551)
038B: load_requested_models 
0A97: 1@ = car 0@ struct 
1@ += 2380 
0A97: 2@ = car 0@ struct 
2@ += 2384   
jump @GUN_93 

:GUN_93
wait 0 
if and
   Model.Available(1916)
   Model.Available(1551)
else_jump @GUN_93 
3@ = Object.Create(1916, 0.0, 0.0, 0.0)
4@ = Object.Create(1551, 0.0, 0.0, 0.0)
0750: set_object 4@ visibility 0
0750: set_object 3@ visibility 1 
Object.CollisionDetection(3@) = False
Object.SetImmunities(3@, 1, 1, 1, 1, 1)
Object.CollisionDetection(4@) = False
Object.SetImmunities(4@, 1, 1, 1, 1, 1)
Model.Destroy(1916)
Model.Destroy(1551)
jump @GUN_232 

:GUN_232
wait 0 
0A8D: 5@ = read_memory 1@ size 4 virtual_protect 0 
0A8D: 6@ = read_memory 2@ size 4 virtual_protect 0 
5@ *= 180.0 
5@ /= 3.141593 
6@ *= 180.0 
6@ /= 3.141593  
0681: attach_object 4@ to_car 0@ with_offset 0.0 -0.2 0.0 rotation 0.0 0.0 5@ 
069A: attach_object 3@ to_object 4@ with_offset 0.0 0.0 1.5 rotation 6@ 0.0 0.0 
053F: set_car 0@ tires_vulnerability 0 
Car.SetImmunities(0@, 1, 0, 0, 1, 1)
0224: set_car 0@ health_to 10000
if 
   Actor.Driving($PLAYER_ACTOR)
else_jump @GUN_586 
if 
0AB0:   key_pressed 2
else_jump @GUN_232  
0@ = Actor.CurrentCar($PLAYER_ACTOR)
0208: 7@ = random_float_in_ranges -1.0 1.0 0.0
0208: 8@ = random_float_in_ranges -1.0 1.0 0.0
0400: store_coords_to 9@ 10@ 11@ from_object 3@ with_offset 7@ 500.0 20.0 
Object.StorePos(3@, 12@, 13@, 14@)       
0400: store_coords_to 12@ 13@ 14@ from_object 3@ with_offset 0.0 1.5 0.0
06BC: create_M4_shoot_from 12@ 13@ 14@  target 9@ 10@ 11@ energy 60
066D: 15@ = attach_particle "gunflash" to_object 3@ with_offset 0.0 2.0 0.0 type 1 
095C: create_smoke_at 12@ 13@ 14@ velocity 0.0 0.0 0.0 RGBA 1.0 1.0 1.0 0.5 size 0.1 last_factor 0.125        
064C: make_particle 15@ visible
064F: remove_references_to_particle 15@ 
097B: play_audio_at_object 3@ event 1157 
wait 80
jump @GUN_232 

:GUN_586
Object.Destroy(3@)
Object.Destroy(4@)
Car.RemoveReferences(0@)
wait 0
jump @GUN_11 
