SHOW:
|
|
- or go back to the newest paste.
1 | //Code from DaftVader written for COD4! | |
2 | ||
3 | InitSAM() | |
4 | { | |
5 | TurretBox=spawn("script_model",self.origin); | |
6 | TurretBox setmodel("com_plasticcase_beige_big"); | |
7 | TurretBox thread TurretSetUp(self,TurretBox); | |
8 | } | |
9 | TurretSetUp(owner,TurretBox) | |
10 | { | |
11 | wait 2; | |
12 | SAM= spawn("script_model",TurretBox.origin-(0,0,20)); | |
13 | SAM setModel("projectile_hellfire_missile"); | |
14 | SAM.angles=TurretBox.angles; | |
15 | wait 2; | |
16 | self playsound("mp_killstreak_jet"); | |
17 | SAM moveto(TurretBox.origin+(0,0,80),1.5); | |
18 | wait 1.5; | |
19 | self thread Box_Kill(self); | |
20 | SAM thread SamRotate(self,TurretBox); | |
21 | } | |
22 | SamRotate(owner,TurretBox) | |
23 | { | |
24 | self endon("chopper_down"); | |
25 | self endon("disconnect"); | |
26 | sky=VectorToAngles((self.origin+(0,0,1000))-(self.origin)); | |
27 | self playsound("mp_killstreak_jet"); | |
28 | self rotateto(sky,1.5); | |
29 | wait 1.5; | |
30 | self thread SAM_AI(owner,TurretBox); | |
31 | for(;;) | |
32 | { | |
33 | self playsound("ui_mp_suitcasebomb_timer"); | |
34 | self rotateYaw(360,4); //<---- line 2098 | |
35 | wait 4; | |
36 | self rotateYaw(-360,4); | |
37 | wait 4; | |
38 | } | |
39 | } | |
40 | SAM_AI(owner,TurretBox) | |
41 | { | |
42 | self endon("chopper_down"); | |
43 | self endon("disconnect"); | |
44 | team = self.pers["team"] // <--- Fixed | |
45 | for(;;) | |
46 | { | |
47 | if((level.teambased)&&(isDefined(level.chopper))&&(level.chopper.team !=team)) | |
48 | { | |
49 | self thread SAMFire(TurretBox,owner); | |
50 | self notify("chopper_down"); | |
51 | } | |
52 | if((!level.teambased)&&(isDefined(level.chopper))&&(level.chopper.owner !=owner)) | |
53 | { | |
54 | self thread SAMFire(TurretBox,owner); | |
55 | self notify("chopper_down"); | |
56 | } | |
57 | wait 0.1; | |
58 | } | |
59 | } | |
60 | SAMFire(TurretBox,owner) | |
61 | { | |
62 | self endon("chopperboom"); | |
63 | wait 10; | |
64 | earthquake(1,1,self.origin,800); | |
65 | self playsound("weap_hind_missile_fire"); | |
66 | time=Vadercalc(800,self.origin,self.origin+(0,0,1000)); | |
67 | self moveto(self.origin +(0,0,1400),time); | |
68 | self thread fxme(time); | |
69 | wait time; | |
70 | for(;;) | |
71 | { | |
72 | target=VectorToAngles(level.chopper.origin - self.origin); | |
73 | self rotateto(target,0.1); | |
74 | time=Vadercalc(800,self.origin,level.chopper.origin); | |
75 | self thread fxme(time); | |
76 | newtarget=level.chopper.origin; | |
77 | self moveto(newtarget,time); | |
78 | wait time; | |
79 | if(Distance(self.origin,level.chopper.origin)<= 30) | |
80 | { | |
81 | self thread BlowMe(TurretBox,owner); | |
82 | } | |
83 | wait 0.01; | |
84 | } | |
85 | } | |
86 | blowMe(TurretBox,owner) | |
87 | { | |
88 | self notify("chopperboom"); | |
89 | self playsound("hind_helicopter_secondary_exp"); | |
90 | Playfx(level.expbullt,self.origin); | |
91 | self hide(); | |
92 | RadiusDamage(level.chopper.origin,700,9000,8999,owner,"MOD_PROJECTILE_SPLASH","rpg_mp"); | |
93 | wait 0.01; | |
94 | TurretBox notify("finish"); | |
95 | self delete(); | |
96 | } | |
97 | Box_Kill(owner) | |
98 | { | |
99 | self waittill("finish"); | |
100 | owner iprintln("SAM ended"); | |
101 | self delete(); | |
102 | } | |
103 | fxme(time) | |
104 | { | |
105 | for(i=0;i<time;i++) | |
106 | { | |
107 | playFxOnTag(level.rpgeffect,self,"tag_origin"); | |
108 | wait 0.2; | |
109 | } | |
110 | } |