-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeaponMenu.gsc
822 lines (785 loc) · 25.5 KB
/
WeaponMenu.gsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
GiveWeapon_NzV(weapon)
{
if ((level.script == "zm_prison") && issubstr(weapon, "tomahawk_zm"))
{
self play_sound_on_ent("purchase");
self notify("tomahawk_picked_up");
level notify("bouncing_tomahawk_zm_aquired");
self notify("player_obtained_tomahawk");
if (weapon == "bouncing_tomahawk_zm")
{
self.tomahawk_upgrade_kills = 0;
self.killed_with_only_tomahawk = 1;
self.killed_something_thq = 0;
}
else
{
self.tomahawk_upgrade_kills = 99;
self.killed_with_only_tomahawk = 1;
self.killed_something_thq = 1;
self notify("tomahawk_upgraded_swap");
}
old_tactical = self get_player_tactical_grenade();
if (isDefined(old_tactical) && old_tactical != "none" )
self takeweapon(old_tactical);
self set_player_tactical_grenade(weapon);
self.current_tomahawk_weapon = weapon;
gun = self getcurrentweapon();
self disable_player_move_states(1);
self giveweapon("zombie_tomahawk_flourish");
self switchtoweapon("zombie_tomahawk_flourish");
self waittill_any("player_downed", "weapon_change_complete");
self switchtoweapon(gun);
self enable_player_move_states();
self takeweapon("zombie_tomahawk_flourish");
self giveweapon(weapon);
self givemaxammo(weapon);
if (gun != "none" && !is_placeable_mine(gun) && !is_equipment(gun))
{
self switchtoweapon(gun);
self waittill("weapon_change_complete");
}
else
{
primaryweapons = self getweaponslistprimaries();
if (isDefined(primaryweapons) && primaryweapons.size > 0)
{
self switchtoweapon(primaryweapons[0]);
self waittill("weapon_change_complete");
}
}
self play_weapon_vo(weapon);
}
else if ((level.script == "zm_prison") && (weapon == "willy_pete_zm"))
{
self play_sound_on_ent("purchase");
gun = self getcurrentweapon();
old_tactical = self get_player_tactical_grenade();
if (isDefined(old_tactical) && old_tactical != "none" )
self takeweapon(old_tactical);
self set_player_tactical_grenade(weapon);
self giveweapon(weapon);
self givemaxammo(weapon);
if (gun != "none" && !is_placeable_mine(gun) && !is_equipment(gun))
{
self switchtoweapon(gun);
self waittill("weapon_change_complete");
}
else
{
primaryweapons = self getweaponslistprimaries();
if (isDefined(primaryweapons) && primaryweapons.size > 0)
{
self switchtoweapon(primaryweapons[0]);
self waittill("weapon_change_complete");
}
}
self play_weapon_vo(weapon);
}
else if ((level.script == "zm_buried") && (weapon == "time_bomb_zm"))
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, undefined, undefined, 0);
else if ((level.script == "zm_tomb") && issubstr(weapon, "one_inch_punch"))
{
self play_sound_on_ent("purchase");
gun = self getcurrentweapon();
self disable_player_move_states(1);
if (weapon == "one_inch_punch_zm")
{
self.b_punch_upgraded = 0;
self giveweapon("zombie_one_inch_punch_flourish");
self switchtoweapon("zombie_one_inch_punch_flourish");
}
else
{
self.b_punch_upgraded = 1;
if (weapon == "one_inch_punch_air_zm")
self.str_punch_element = "air";
else if (weapon == "one_inch_punch_fire_zm")
self.str_punch_element = "fire";
else if (weapon == "one_inch_punch_ice_zm")
self.str_punch_element = "ice";
else if (weapon == "one_inch_punch_lightning_zm")
self.str_punch_element = "lightning";
else if (weapon == "one_inch_punch_upgraded_zm")
self.str_punch_element = "upgraded";
self giveweapon("zombie_one_inch_punch_upgrade_flourish");
self switchtoweapon("zombie_one_inch_punch_upgrade_flourish");
}
self waittill_any("player_downed", "weapon_change_complete");
self enable_player_move_states();
if (weapon == "one_inch_punch_zm")
self takeweapon("zombie_one_inch_punch_flourish");
else
self takeweapon("zombie_one_inch_punch_upgrade_flourish");
gun = self maps/mp/zombies/_zm_melee_weapon::change_melee_weapon(weapon, gun);
self giveweapon(weapon);
if (gun != "none" && !is_placeable_mine(gun) && !is_equipment(gun))
{
self switchtoweapon(gun);
self waittill("weapon_change_complete");
}
else
{
primaryweapons = self getweaponslistprimaries();
if (isDefined(primaryweapons) && primaryweapons.size > 0)
{
self switchtoweapon(primaryweapons[0]);
self waittill("weapon_change_complete");
}
}
self thread maps/mp/zombies/_zm_audio::create_and_play_dialog("perk", "one_inch");
}
else if ((level.script == "zm_tomb") && issubstr(weapon, "staff_") && issubstr(weapon, "_melee_zm"))
{
self play_sound_on_ent("purchase");
gun = self getcurrentweapon();
gun = self maps/mp/zombies/_zm_melee_weapon::change_melee_weapon(weapon, gun);
self giveweapon(weapon);
if (gun != "none" && !is_placeable_mine(gun) && !is_equipment(gun))
{
self switchtoweapon(gun);
self waittill("weapon_change_complete");
}
else
{
primaryweapons = self getweaponslistprimaries();
if (isDefined(primaryweapons) && primaryweapons.size > 0)
{
self switchtoweapon(primaryweapons[0]);
self waittill("weapon_change_complete");
}
}
self play_weapon_vo(weapon);
}
else if ((level.script == "zm_tomb") && issubstr(weapon, "staff_"))
{
if (issubstr(weapon, "_upgraded_zm"))
{
if (!(self hasweapon("staff_revive_zm")))
{
self setactionslot(3, "weapon", "staff_revive_zm");
self giveweapon("staff_revive_zm");
}
self givemaxammo("staff_revive_zm");
}
else if (self hasweapon("staff_revive_zm"))
{
self takeweapon("staff_revive_zm");
self setactionslot(3, "altmode");
}
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, undefined, undefined, 0);
}
else if ((level.script == "zm_tomb") && issubstr(weapon, "equip_dieseldrone_zm"))
{
if (isDefined(level.zombie_custom_equipment_setup))
{
players = getplayers();
for (i = 0; i < players.size; i++)
{
if (players[i] hasweapon(weapon))
{
self stealth_iprintln("^1ERROR: ^7Diesel Drone is already equiped by one player");
return;
}
}
quadrotor = getentarray( "quadrotor_ai", "targetname" );
if ( quadrotor.size >= 1 )
{
self stealth_iprintln("^1ERROR: ^7Diesel Drone is already active, can't spawn another yet");
return;
}
CustomEquipGiver = spawn("script_model", self NormalisedTrace("position"));
CustomEquipGiver setmodel("veh_t6_dlc_zm_quadrotor");
CustomEquipGiver.stub = spawnstruct();
CustomEquipGiver.stub.weaponname = "equip_dieseldrone_zm";
CustomEquipGiver.stub.craftablestub = spawnstruct();
CustomEquipGiver.stub.craftablestub.use_actionslot = 2;
CustomEquipGiver [[level.zombie_custom_equipment_setup]](self);
CustomEquipGiver delete();
}
}
else if (self maps/mp/zombies/_zm_utility::is_melee_weapon(weapon))
{
if((weapon == "tazer_knuckles_zm") || (weapon == "bowie_knife_zm"))
self maps/mp/zombies/_zm_melee_weapon::give_melee_weapon_by_name(weapon);
else
{
self play_sound_on_ent("purchase");
gun = self getcurrentweapon();
gun = self maps/mp/zombies/_zm_melee_weapon::change_melee_weapon(weapon, gun);
self giveweapon(weapon);
if (gun != "none" && !is_placeable_mine(gun) && !is_equipment(gun))
{
self switchtoweapon(gun);
self waittill("weapon_change_complete");
}
else
{
primaryweapons = self getweaponslistprimaries();
if (isDefined(primaryweapons) && primaryweapons.size > 0)
{
self switchtoweapon(primaryweapons[0]);
self waittill("weapon_change_complete");
}
}
self play_weapon_vo(weapon);
}
}
else if (self maps/mp/zombies/_zm_utility::is_equipment(weapon))
{
self play_sound_on_ent("purchase");
if (isDefined(level.destructible_equipment) && (level.destructible_equipment.size > 0))
{
for(i = 0; i < level.destructible_equipment.size; i++)
{
equip = level.destructible_equipment[i];
if (isDefined(equip.owner) && (equip.owner == self) && isDefined(equip.name) && (equip.name == weapon))
{
equip maps/mp/zombies/_zm_equipment::item_damage(9999);
break;
}
else if ((weapon == "jetgun_zm") && isDefined(equip.name) && (equip.name == weapon))
{
equip maps/mp/zombies/_zm_equipment::item_damage(9999);
break;
}
}
}
self maps/mp/zombies/_zm_equipment::equipment_take(weapon);
self maps/mp/zombies/_zm_equipment::equipment_buy(weapon);
self play_weapon_vo(weapon);
}
else if (self maps/mp/zombies/_zm_weapons::is_weapon_upgraded(weapon))
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, 1, undefined, 0);
else
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, undefined, undefined, 0);
self stealth_iprintln("Weapon: " + weapon + " ^2Gived");
}
UnpackCurrentWeapon_NzV()//Unupgrade current weapon
{
gun = self getcurrentweapon();
weapon = gun;
if (self is_weapon_upgraded(weapon))
{
weapon = self maps/mp/zombies/_zm_weapons::get_base_weapon_name(gun, 1);
if (isDefined(weapon) && (weapon != "none"))
{
self play_sound_on_ent("purchase");
self takeweapon(gun);
unacquire_weapon_toggle(gun);
self disable_player_move_states(1);
self giveweapon("zombie_knuckle_crack");
self switchtoweapon("zombie_knuckle_crack");
self waittill_any("player_downed", "weapon_change_complete");
self enable_player_move_states();
self takeweapon("zombie_knuckle_crack");
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, undefined, undefined, 0);
self stealth_iprintln("[^1Unpack A Punch^7] Weapon: " + weapon);
}
else
self stealth_iprintln("^1ERROR: ^7Unknow Weapon");
}
else
self stealth_iprintln("^1ERROR: ^7Current Weapon [" + weapon + "] Is Not Upgraded");
}
PackCurrentWeapon_NzV(get_accessorie)//Upgrade current weapon, get_accessorie = true or false.
{
gun = self getcurrentweapon();
weapon = gun;
if (self can_upgrade_weapon(weapon))
{
if (isDefined(get_accessorie) && get_accessorie)
{
weapon = self maps/mp/zombies/_zm_weapons::get_upgrade_weapon(weapon, 1);
}
else
{
if (self maps/mp/zombies/_zm_weapons::is_weapon_upgraded(weapon))
weapon = self maps/mp/zombies/_zm_weapons::get_base_name(weapon);
else
weapon = self maps/mp/zombies/_zm_weapons::get_upgrade_weapon(weapon, 0);
}
if (isDefined(weapon) && (weapon != "none"))
{
self play_sound_on_ent("purchase");
self takeweapon(gun);
unacquire_weapon_toggle(gun);
self disable_player_move_states(1);
self giveweapon("zombie_knuckle_crack");
self switchtoweapon("zombie_knuckle_crack");
self waittill_any("player_downed", "weapon_change_complete");
self enable_player_move_states();
self takeweapon("zombie_knuckle_crack");
self maps/mp/zombies/_zm_weapons::weapon_give(weapon, 1, undefined, 0);
self stealth_iprintln("[^2Pack A Punch^7] Weapon: " + weapon);
}
else
self stealth_iprintln("^1ERROR: ^7Unknow Weapon");
}
else
{
if (self maps/mp/zombies/_zm_weapons::is_weapon_upgraded(weapon))
self stealth_iprintln("^1ERROR: ^7Current Weapon [" + weapon + "] Cant Be Upgraded Again");
else
self stealth_iprintln("^1ERROR: ^7Current Weapon [" + weapon + "] Cant Be Upgraded");
}
}
Toggle_Ammo_NzV()
{
self notify("StopUnlimitedAmmo");
if(!isDefined(self.UnlimitedAmmo))
self.UnlimitedAmmo = false;
self.UnlimitedAmmo = !self.UnlimitedAmmo;
if(self.UnlimitedAmmo)
self thread doUnlimitedAmmo_NzV();
self stealth_iprintln("Unlimited Ammo " + (self.UnlimitedAmmo ? "^2ON" : "^1OFF"));
}
doUnlimitedAmmo_NzV()
{
self endon("StopUnlimitedAmmo");
self endon("disconnect");
self endon("death");
level endon("game_ended");
while (isDefined(self.UnlimitedAmmo) && self.UnlimitedAmmo)
{
currentWeapon = self getcurrentweapon();
if (isDefined(currentWeapon) && (currentWeapon != "none"))
{
self setweaponammoclip(currentWeapon, weaponclipsize(currentWeapon));
self givemaxammo(currentWeapon);
alt_weap = weaponaltweaponname(currentWeapon);
if (isDefined(alt_weap) && (alt_weap != "none"))
self givemaxammo(alt_weap);
}
//
currenttactical_grenade = self get_player_tactical_grenade();
if (isDefined(currenttactical_grenade) && (currenttactical_grenade != "none"))
self givemaxammo(currenttactical_grenade);
//
currentlethal_grenade = self get_player_lethal_grenade();
if (isDefined(currentlethal_grenade) && (currentlethal_grenade != "none"))
self givemaxammo(currentlethal_grenade);
//
currentoffhand = self getcurrentoffhand();
if (isDefined(currentoffhand) && (currentoffhand != "none"))
self givemaxammo(currentoffhand);
//
currentplaceable_mine = self get_player_placeable_mine();
if (isDefined(currentplaceable_mine) && (currentplaceable_mine != "none"))
self givemaxammo(currentplaceable_mine);
//
currentequipement = self get_player_equipment();
if (isDefined(currentequipement) && (currentequipement != "none"))
self givemaxammo(currentequipement);
//
if ((level.script == "zm_transit" ) || ( level.script == "zm_buried"))
self setweaponoverheating(0, 0);
//
if ((level.script == "zm_prison"))
self.n_tomahawk_cooking_time = getTime() - 9999;
self waittill_any ("weapon_fired", "grenade_fire", "grenade_launcher_fire", "weapon_change_complete");
}
}
Toggle_EquipementStayHealthy_NzV()
{
self notify("StopEquipementStayHealthy");
if(!isDefined(self.StopEquipementStayHealthy))
self.StopEquipementStayHealthy = false;
self.StopEquipementStayHealthy = !self.StopEquipementStayHealthy;
if(self.StopEquipementStayHealthy)
self thread doEquipmentStaysHealthy();
self stealth_iprintln("Equipement Stay Healthy " + (self.StopEquipementStayHealthy ? "^2ON" : "^1OFF"));
}
doEquipmentStaysHealthy()
{
self notify("StopEquipementStayHealthy");
self endon("disconnect");
level endon("game_ended");
self endon("death");
self endon("StopEquipementStayHealthy");
while (isDefined(self.StopEquipementStayHealthy) && self.StopEquipementStayHealthy)
{
self.turbine_health = 1200;
self.equipment_damage = [];
self.shielddamagetaken = 0;
if (isDefined(level.destructible_equipment) && (level.destructible_equipment.size > 0))
{
for(i = 0; i < level.destructible_equipment.size; i++)
{
equip = level.destructible_equipment[i];
if (isDefined(equip.owner) && (equip.owner == self))
{
equip.shielddamagetaken = 0;
equip.damage = 0;
equip.headchopper_kills = 0;
equip.springpad_kills = 0;
equip.subwoofer_kills = 0;
}
}
}
wait 0.1;
}
}
Toggle_LeftGun()
{
self notify("StopLeftGun"); //Stop AdvancedLeftGun
if(getDvarint("cg_gun_y") == 0 && getDvarint("cg_gun_x") == 0)
{
setDvar("cg_gun_y",10);
setDvar("cg_gun_x",4);
}
else
{
setDvar("cg_gun_y",0);
setDvar("cg_gun_x",0);
}
self stealth_iprintln("Left Side Gun " + ((getDvarint("cg_gun_y") != 0) ? "^2ON" : "^1OFF"));
}
Toggle_AdvancedLeftGun()
{
self notify("StopLeftGun");
if(getDvarint("cg_gun_y") == 0 && getDvarint("cg_gun_x") == 0)
{
self thread doAdvancedLeftGun();
}
else
{
setDvar("cg_gun_y",0);
setDvar("cg_gun_x",0);
}
self stealth_iprintln("Advance Left Side Gun " + ((getDvarint("cg_gun_y") != 0) ? "^2ON" : "^1OFF"));
}
doAdvancedLeftGun()
{
self endon("StopLeftGun");
self endon("disconnect");
self endon("death");
level endon("game_ended");
for(;;)
{
if(self adsbuttonpressed())
{
setDvar("cg_gun_y",0);
setDvar("cg_gun_x",0);
}
else
{
setDvar("cg_gun_y",10);
setDvar("cg_gun_x",4);
}
wait .1;
}
}
Toggle_HideWeapon()
{
if(getDvarint("cg_drawGun") == 0)
setDvar("cg_drawGun", "1");
else
setDvar("cg_drawGun", "0");
self stealth_iprintln("No Gun " + ((getDvarint("cg_drawGun") == 0) ? "^2ON" : "^1OFF"));
}
Toggle_HideCrosshair()
{
if(getDvarint("cg_drawCrosshair") == 0)
setDvar("cg_drawCrosshair", "1");
else
setDvar("cg_drawCrosshair", "0");
self stealth_iprintln("Crosshair " + ((getDvarint("cg_drawGun") == 1) ? "^2ON" : "^1OFF"));
}
MySetFOV(fov)
{
self setclientfov(fov);
//setDvar("cg_fov", fov);
self stealth_iprintln("Field of view set to ^1" + fov + "^7");
}
MySetDOF_Weapon(i)
{
self SetViewModelDepthOfField( 2, i ); // 10 default | 20 middle | 40 high | 5 low
self stealth_iprintln("View Model Death of Field Set To ^2"+i+"^7");
}
MySetSpead(i)
{
self SetSpreadOverride( i ); // 30 i shigh | 4 defualt | 0 smallest !
self stealth_iprintln("Spread set To ^1"+i);
}
MySetSpead_R()
{
self ResetSpreadOverride();
}
Toggle_ExplosiveBullets()
{
self notify("StopExplosiveBullets");
if(isDefined(self.telgun) && self.telgun)
self Toggle_TeleportGun();
if(isDefined(self.ricbullets) && self.ricbullets)
self Toggle_RicochetBullet();
if(isDefined(self.fxgun) && self.fxgun)
self Toggle_FxGun();
if(isDefined(self.moddedbullets) && self.moddedbullets)
self Toggle_ModdedWeaponBullets();
if(isDefined(self.doFlameTrowher) && self.doFlameTrowher)
self Toggle_FlameTrowher();
if(!isDefined(self.expbullets))
self.expbullets = false;
if(!self.expbullets)
self thread doExplosiveBullets();
self.expbullets = !self.expbullets;
self stealth_iprintln("Explosive Bullets " + (self.expbullets ? "^2ON" : "^1OFF"));
}
doExplosiveBullets()
{
self endon("StopExplosiveBullets");
self endon("disconnect");
self endon("death");
level endon("game_ended");
for(;;)
{
self waittill ("weapon_fired");
Earthquake(0.5,1,self.origin,90);
forward = self getTagOrigin("j_head");
end = self thread vector_scale(anglestoforward(self getPlayerAngles()),1000000);
SPLOSIONlocation = BulletTrace(forward, end, 0, self)["position"];
RadiusDamage(SPLOSIONlocation, 500, 1000, 500, self);
playsoundatposition("evt_nuke_flash", SPLOSIONlocation);
Earthquake(2.5, 2, SPLOSIONlocation, 300);
playfx(loadfx("explosions/fx_default_explosion"), SPLOSIONlocation);
wait 0.1;
}
}
Toggle_TeleportGun()
{
self notify("StopTeleportGun");
if(isDefined(self.fxbullets) && self.fxbullets)
self ListfxGuns();
if(isDefined(self.expbullets) && self.expbullets)
self Toggle_ExplosiveBullets();
if(isDefined(self.ricbullets) && self.ricbullets)
self Toggle_RicochetBullet();
if(isDefined(self.fxgun) && self.fxgun)
self Toggle_FxGun();
if(isDefined(self.moddedbullets) && self.moddedbullets)
self Toggle_ModdedWeaponBullets();
if(isDefined(self.doFlameTrowher) && self.doFlameTrowher)
self Toggle_FlameTrowher();
if(!isDefined(self.telgun))
self.telgun = false;
if(!self.telgun)
self thread doTeleportGun();
self.telgun = !self.telgun;
self stealth_iprintln("Teleport Gun " + (self.telgun ? "^2ON" : "^1OFF"));
}
doTeleportGun()
{
self endon("disconnect");
self endon("death");
level endon("game_ended");
self endon ("StopTeleportGun");
for(;;)
{
self waittill ("weapon_fired");
self setorigin(BulletTrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglestoforward(self getplayerangles()) * 1000000, 0, self)["position"]);
wait 0.1;
}
}
Toggle_RicochetBullet()
{
self notify("StopRicochetBullet");
if(isDefined(self.fxbullets) && self.fxbullets)
self ListfxGuns();
if(isDefined(self.expbullets) && self.expbullets)
self Toggle_ExplosiveBullets();
if(isDefined(self.telgun) && self.telgun)
self Toggle_TeleportGun();
if(isDefined(self.fxgun) && self.fxgun)
self Toggle_FxGun();
if(isDefined(self.moddedbullets) && self.moddedbullets)
self Toggle_ModdedWeaponBullets();
if(isDefined(self.doFlameTrowher) && self.doFlameTrowher)
self Toggle_FlameTrowher();
if(!isDefined(self.ricbullets))
self.ricbullets = false;
if(!self.ricbullets)
self thread doRicochetBullet();
self.ricbullets = !self.ricbullets;
self stealth_iprintln("Ricochet Bullets " + (self.ricbullets ? "^2ON" : "^1OFF"));
}
doRicochetBullet()
{
self endon("StopRicochetBullet");
self endon("disconnect");
self endon("death");
level endon("game_ended");
for(;;)
{
self waittill("weapon_fired");
Gun = self GetCurrentWeapon();
Incident = AnglesToForward(self GetPlayerAngles());
Trace = BulletTrace(self GetEye(), self GetEye()+ Incident * 100000, 0, self);
Reflection = Incident - (2 * trace["normal"] * VectorDot(Incident, trace["normal"]));
MagicBullet(Gun, Trace["position"], Trace["position"]+(Reflection * 100000), self);
for(i=0;i<1-1;i++)
{
Trace = BulletTrace(Trace["position"], Trace["position"]+(Reflection * 100000), 0, self);
Incident = Reflection;
Reflection = Incident - (2 * Trace["normal"] * VectorDot(Incident, Trace["normal"]));
MagicBullet(Gun, Trace["position"], Trace["position"] + (Reflection * 100000), self);
wait 0.05;
}
wait 0.1;
}
}
Toggle_FxGun(fx_effect)
{
self notify("StopFxGun");
if(isDefined(self.fxbullets) && self.fxbullets)
self ListfxGuns();
if(isDefined(self.expbullets) && self.expbullets)
self Toggle_ExplosiveBullets();
if(isDefined(self.telgun) && self.telgun)
self Toggle_TeleportGun();
if(isDefined(self.ricbullets) && self.ricbullets)
self Toggle_RicochetBullet();
if(isDefined(self.moddedbullets) && self.moddedbullets)
self Toggle_ModdedWeaponBullets();
if(!isDefined(self.fxgun))
self.fxgun = false;
if(isDefined(self.doFlameTrowher) && self.doFlameTrowher)
self Toggle_FlameTrowher();
}
Toggle_ModdedWeaponBullets(weapon)
{
self notify("StopModdedWeaponBullets");
if(isDefined(self.fxbullets) && self.fxbullets)
self ListfxGuns();
if(isDefined(self.expbullets) && self.expbullets)
self Toggle_ExplosiveBullets();
if(isDefined(self.telgun) && self.telgun)
self Toggle_TeleportGun();
if(isDefined(self.ricbullets) && self.ricbullets)
self Toggle_RicochetBullet();
if(isDefined(self.fxgun) && self.fxgun)
self Toggle_FxGun();
if(isDefined(self.doFlameTrowher) && self.doFlameTrowher)
self Toggle_FlameTrowher();
if(!isDefined(self.moddedbullets))
self.moddedbullets = false;
if(isDefined(weapon) && (!self.moddedbullets))
self thread doModdedWeaponBullets(weapon);
self.moddedbullets = !self.moddedbullets;
self stealth_iprintln("Modded Bullets " + (self.moddedbullets ? "(" + weapon + ")^2ON" : "^1OFF"));
}
doModdedWeaponBullets(weapon)
{
self endon("StopModdedWeaponBullets");
self endon("disconnect");
self endon("death");
level endon("game_ended");
for(;;)
{
self waittill("weapon_fired");
B = self getTagOrigin("tag_eye");
C = self NewBullet(anglestoforward(self getPlayerAngles()), 1000000);
D = BulletTrace(B, C, 0, self)["position"];
MagicBullet(weapon, B, D, self);
wait 0.1;
}
}
NewBullet(A, B)
{
return (A[0]*B, A[1]*B, A[2]*B);
}
Toggle_FlameTrowher()
{
self notify("StopFlameTrowher");
if(isDefined(self.fxbullets) && self.fxbullets)
self ListfxGuns();
if(isDefined(self.expbullets) && self.expbullets)
self Toggle_ExplosiveBullets();
if(isDefined(self.telgun) && self.telgun)
self Toggle_TeleportGun();
if(isDefined(self.ricbullets) && self.ricbullets)
self Toggle_RicochetBullet();
if(isDefined(self.fxgun) && self.fxgun)
self Toggle_FxGun();
if(isDefined(self.moddedbullets) && self.moddedbullets)
self Toggle_ModdedWeaponBullets();
if(!isDefined(self.FlameTrowher))
self.FlameTrowher = false;
if(!self.FlameTrowher)
self thread doFlameTrowher();
self.FlameTrowher = !self.FlameTrowher;
self stealth_iprintln("Flame Trowher " + (self.FlameTrowher ? "^2ON" : "^1OFF"));
}
doFlameTrowher()
{
self endon("disconnect");
level endon("game_ended");
self endon("death");
self endon("StopFlameTrowher");
FX = loadfx("env/fire/fx_fire_zombie_torso");
FX2 = loadfx("env/fire/fx_fire_zombie_md");
for(;;)
{
self waittill("weapon_fired");
Crosshair = BulletTrace(self getTagOrigin("j_head") , self vector_Scale(anglestoforward(self getPlayerAngles()),1000000), 0, self)["position"];
MagicBullet(self getcurrentweapon(), self getTagOrigin("j_shouldertwist_le"), Crosshair, self);
playFX(FX, Crosshair);
playFX(FX2, self getTagOrigin("j_hand"));
RadiusDamage(Crosshair, 100, 15, 15, self);
wait 0.1;
}
}
Give_Shovel()
{
if((level.script == "zm_tomb") && isDefined(self.dig_vars))
{
self play_sound_on_ent("purchase");
self.dig_vars["has_shovel"] = 1;
self.dig_vars["n_spots_dug"] = 0;
self.dig_vars["has_upgraded_shovel"] = 0;
n_player = self getentitynumber() + 1;
level setclientfield("shovel_player" + n_player, 1);
self stealth_iprintln("Shovel ^2Gived");
}
else
self stealth_iprintln("^1ERROR: ^7Shovel Not Supported On This Map");
}
Give_GoldenShovel()
{
if((level.script == "zm_tomb") && isDefined(self.dig_vars))
{
self play_sound_on_ent("purchase");
self.dig_vars["has_shovel"] = 1;
self.dig_vars["n_spots_dug"] = 64;
self.dig_vars["has_upgraded_shovel"] = 1;
n_player = self getentitynumber() + 1;
level setclientfield( "shovel_player" + n_player, 2);
self playsoundtoplayer("zmb_squest_golden_anything", self);
self stealth_iprintln("Golden Shovel ^2Gived");
}
else
self stealth_iprintln("^1ERROR: ^7Golden Shovel Not Supported On This Map");
}
Give_Helmet()
{
if((level.script == "zm_tomb") && isDefined(self.dig_vars))
{
self play_sound_on_ent("purchase");
self.dig_vars["has_helmet"] = 1;
n_player = self getentitynumber() + 1;
level setclientfield("helmet_player" + n_player, 1);
self playsoundtoplayer("zmb_squest_golden_anything", self);
self stealth_iprintln("Helmet ^2Gived");
}
else
self stealth_iprintln("^1ERROR: ^7Helmet Not Supported On This Map");
}
WeaponDropp()
{
if(self getcurrentWeapon() == "defaultweapon_mp")
{
self stealth_iprintln("^1You cant drop this Item !");
}
self stealth_iprintln("You droped ^2"+self getcurrentWeapon());
self dropItem(self getcurrentWeapon());
}