-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjctf.sma
5500 lines (4067 loc) · 142 KB
/
jctf.sma
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
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* --------------------------------------------------------------------------------------------
"Just Capture The Flag" - by Digi (aka Hunter-Digital)
Thread: http://forums.alliedmods.net/showthread.php?t=132115
Change log below.
-------------------------------------------------------------------------------------------- */
new const MOD_TITLE[] = "Pega Bandeira" /* Please don't modify. */
new const MOD_AUTHOR[] = "Jhow Markuz" /* If you make major changes, add " & YourName" at the end */
new const MOD_VERSION[] = "1.0" /* If you make major changes, add "custom" at the end but do not modify the actual versionC number! */
/*
Below you can enable/disable each individual feature of this plugin
NOTE: Remember to compile the plugin again after you modify anything in this file!
-----------------------------------
Description: This uses Orpheu module to make infinite round end and trigger round end on flag captures
If set to false, ophreu will not be used anymore and rounds could end if all players from one team are dead and round can't end upon flag capture.
*/
#define FEATURE_ORPHEU true
/*
Description: This hooks the buy system of the game and changes it, allowing everybody to buy all weapons.
If set to false, it will disable all buy related stuff like: buy menu, spawn weaopns, special weapons, even C4!
Disable this if you want to use another plugin that manages buy or doesn't use buy at all (like GunGame)
*/
#define FEATURE_BUY true
/*
Description: This allows players to buy and use C4 as a weapon, not an objective, it can be defused tough but the defuser gets a usable C4 back. C4 kills everything in it's radius, including teammates.
If set to false, C4 usage will be completly disabled so it can't be bought.
Requirements: FEATURE_BUY must be true
*/
#define FEATURE_BUYC4 false
/*
Description: This allows players to have an adrenaline amount and when it reaches 100, they can use combos.
If set to false, it will disable all adrenaline stuff, including combos, rewards, buying with adrenaline, everything.
*/
#define FEATURE_ADRENALINE true
/* --------------------------------------------------------------------------------------------
Skip this, advanced configuration more below
*/
#if FEATURE_BUY == true && FEATURE_BUYC4 == true
#define FEATURE_C4 true
#else
#define FEATURE_C4 false
#endif
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#if FEATURE_ORPHEU == true
#include <orpheu_memory>
#include <orpheu>
#endif
#include <fakemeta>
#include <cstrike>
#include <engine>
#include <fun>
/* --------------------------------------------------------------------------------------------
CVars for .cfg files:
ctf_flagreturn (default 120) - flag auto-return time
ctf_weaponstay (default 30) - how long do weapons and items stay on ground
ctf_itempercent (default 30) - chance that items spawn when a player is killed, values from 0 to 100
ctf_sound_taken (default 1) - toggles if the "flag taken" sounds can be heard
ctf_sound_dropped (default 1) - toggles if the "flag dropped" sounds can be heard
ctf_sound_returned (default 1) - toggles if the "flag returned" sounds can be heard
ctf_sound_score (default 1) - toggles if the "X team scores" sounds can be heard
ctf_respawntime (default 10) - players respawn time (use -1 to disable respawn)
ctf_spawnmoney (default 1000) - money bonus when spawning (unless it's a suicide)
ctf_protection (default 5) - players spawn protection time (use -1 to disable protection)
ctf_dynamiclights (default 1) - set the default dynamic lights setting, players will still be able to toggle individually using /lights
ctf_glows (default 1) - set if entities can glow, like when players have flag or an adrenaline combo, weapons start to fade, etc.
ctf_nospam_flash (default 20) - delay of rebuying two flashbangs in a life
ctf_nospam_he (default 20) - delay of rebuying a HE grenade in a life
ctf_nospam_smoke (default 20) - delay of rebuying a smoke grenade in a life
ctf_spawn_prim (default "m3") - spawning primary weapon, set to "" to disable
ctf_spawn_sec (default "glock") - spawning secondary weapon, set to "" to disable
ctf_spawn_knife (default 1) - toggle if players spawn with knife or not
ctf_sound_taken (default 1) - toggles if the "flag taken" sounds can be heard
ctf_sound_dropped (default 1) - toggles if the "flag dropped" sounds can be heard
ctf_sound_returned (default 1) - toggles if the "flag returned" sounds can be heard
ctf_sound_score (default 1) - toggles if the "X team scores" sounds can be heard
Primary weapons: m3,xm1014,tmp,mac10,mp5,ump45,p90,galil,ak47,famas,m4a1,aug,sg552,awp,scout,sg550,g3sg1,m249,shield
Secondary weapons: glock,usp,p228,deagle,elites,fiveseven
mp_c4timer (recommended 20) - time before the C4 devices explode
mp_winlimit - first team who reaches this number wins
mp_timelimit - time limit for the map (displayed in the round timer)
mp_startmoney (recommended 3000) - for first spawn money and minimum amount of money
mp_forcecamera - (0/1 - spectate enemies or not) mod fades to black if this is on and player is in free look (no teammates alive)
mp_forcechasecam - (0/1/2 - force chase cammera all/team/firstperson) same as above
mp_autoteambalance - enable/disable auto-team balance (checks at every player death)
Map configurations are made with;
ctf_moveflag red/blue at your position (even if dead/spec)
ctf_save to save flag origins in maps/<mapname>.ctf
Reward configuration, 0 on all values disables reward/penalty.
[REWARD FOR] [MONEY] [FRAGS] [ADRENALINE]
*/
#define REWARD_RETURN 500, 0, 10
#define REWARD_RETURN_ASSIST 500, 0, 10
#define REWARD_CAPTURE 3000, 3, 25
#define REWARD_CAPTURE_ASSIST 3000, 3, 25
#define REWARD_CAPTURE_TEAM 1000, 0, 10
#define REWARD_STEAL 1000, 1, 10
#define REWARD_PICKUP 500, 1, 5
#define PENALTY_DROP -1500, -1, -10
#define REWARD_KILL 0, 0, 5
#define REWARD_KILLCARRIER 500, 1, 10
#define PENALTY_SUICIDE 0, 0, -20
#define PENALTY_TEAMKILL 0, 0, -20
/*
Advanced configuration
*/
const ADMIN_RETURN = ADMIN_RCON // access required for admins to return flags (full list in includes/amxconst.inc)
const ADMIN_RETURNWAIT = 15 // time the flag needs to stay dropped before it can be returned by command
new const bool:CHAT_SHOW_COMMANDS = true // show commands (like /buy) in chat, true or false
const ITEM_MEDKIT_GIVE = 25 // medkit award health for picking up
new const bool:ITEM_DROP_AMMO = true // toggle if killed players drop ammo items
new const bool:ITEM_DROP_MEDKIT = true // toggle if killed players drop medkit items
#if FEATURE_ADRENALINE == true
new const bool:ITEM_DROP_ADRENALINE = true // toggle if killed players drop adrenaline items
const ITEM_ADRENALINE_GIVE = 5 // adrenaline reaward for picking up adrenaline
const Float:SPEED_ADRENALINE = 1.3 // speed while using "speed" adrenaline combo (this and SPEED_FLAG are cumulative)
const Float:BERSERKER_SPEED1 = 0.7 // primary weapon shooting speed percent while in berserk
const Float:BERSERKER_SPEED2 = 0.3 // secondary weapon shooting speed percent while in berserk
const Float:BERSERKER_DAMAGE = 2.0 // weapon damage percent while in berserk
const INSTANTSPAWN_COST = 50 // instant spawn (/spawn) adrenaline cost
#endif // FEATURE_ADRENALINE
const REGENERATE_EXTRAHP = 50 // extra max HP for regeneration and flag healing
const Float:SPEED_FLAG = 0.9 // speed while carying the enemy flag
new const Float:BASE_HEAL_DISTANCE = 96.0 // healing distance for flag
#if FEATURE_C4 == true
new const C4_RADIUS[] = "600" // c4 explosion radius (must be string!)
new const C4_DEFUSETIME = 3 // c4 defuse time
#endif // FEATURE_C4
new const FLAG_SAVELOCATION[] = "maps/%s.ctf" // you can change where .ctf files are saved/loaded from
#define FLAG_IGNORE_BOTS true // set to true if you don't want bots to pick up flags
/*
Change log:
v1.32c:
* Changed files: jctf.sma
- Added ctf_dynamiclights cvar to enable server operators to disable dynamic lights by default, players can still re-enable them individually using /lights
- Added ctf_glows cvar to enable server operators to disable glows on entities for performance, however it will degrade gameplay due to lack of visual information
v1.32b:
* Changed files: jctf.sma
- Fixed rewards beeing default to 0 for steal and capturing flags (my bad).
v1.32:
* Changes files: jctf.sma
- Removed forcing of CVars - if you depended on that, use amxx.cfg to store default values of cvars.
- Added posibility to disable respawn using ctf_respawntime 0.
- Added posibility to disable spawn protection using ctf_protection 0.
- Added posibility to disable dropped weapons fading out using ctf_weaponstay 0.
- Added posibility to disable flag auto-return using ctf_flagreturn 0.
- Fixed GameName printing CS 1.6 for CZ too, now it detects game name, if's unknown it doesn't write anything.
- Fixed player rewards still printing if all rewards are 0.
- Fixed MP3 files printing WAV error messages due to incorrect precaching method.
v1.31:
* Changed files: jctf.sma, jctf_resources.zip
- Fixed issue where plugin wouldn't trigger "Round_End" on ctf_flagendround 1 that caused issues with other plugins.
- Added new orpheu signatures: functions/EndRoundMessage and functions/CHalfLifeMultiplay/UpdateTeamScores.
- Changed "TeamScore" message to emessage, that way it can be hooked by other plugins.
- Added updating team scores internally too.
- Some other minor changes.
v1.3:
* Changed files: jctf.sma, lang/jctf.txt, jctf_resources.zip
- Added CVars: ctf_flagendround, ctf_flagcaptureslay and ctf_infiniteround (see thread for descriptions)
- Changed /help command, it now prints most mod settings and features (which are enabled/disabled)
- Added new orpheu signatures: functions/InstallGameRules and memory/CGameRulesOffsets (they're in jctf_resources.zip)
- Changed feature define FEATURE_INFROUND to FEATURE_ORPHEU because it also disables flag capture ending round
- Changed contents of lang keys: JOIN_NOFEATURES
- Renamed lang keys: HELP_3_* to HELP_4_* and DEAH_NOFREELOOK to DEATH_NOFREELOOK
- Added lang keys: DEATH_FLAGCAPTURED, STARTING_NEWROUND, and HELP_3_*
- Added so that on new round, flags are returned to base (no matter what the reason of new round)
v1.28c:
* Changed files: jctf.sma
- Fixed if you reload map with the plugin disabled the rounds will end normally.
v1.28b:
* Changed files: jctf.sma
- Fixed a compile error when switching FEATURE_ADRENALINE to false.
v1.28:
* Changed files: jctf.sma, jctf.txt
- Fixed buying VGUI issues, plugin now closes buy VGUI and opens custom buy menu without client changes.
- Removed VGUI related ML keys from jctf.txt.
v1.27:
* Changed files: jctf.sma, jctf.txt
- Added FEATURE disabling, you can now toggle individual features from the sma file.
- Added ctf_flagheal cvar which toggles if flag bases heal teammates.
- Changed HUD message to Director HUD messages, nicer and have no channel limit
- Increased char limit for "Freelook mode blocked" ML text from 32 to 48 chars.
- Rearranged sma configuration variables, you can find them easier on top of the file.
- Added hints and adrenaline menu to the ML support.
- Decreased chance that flag gets stuck in a wall (dramatically decreased collision box and added proximity check for pickup)
- Decreased C4's price from $15000 to $12000 and adrenaline cost from 100 to 80
- Some minor optimizations
v1.26:
* Changed files: jctf.sma, jctf.inc(jctf_api.zip), lang/jctf.txt
- Fixed "ED_Alloc: No free edicts" crashes (hopefully).
- Added Multilingual support, natives support it too.
- Added printing of admin commands in chat that obey amx_show_activity.
- Added a check of players spawning HP and Armor so Booster and flags know how much to heal.
- Added configurable extra HP the booster heals.
- Changed armor regeneration from Booster so it no longer sets armor to kevlar+helm if you have kevlar only.
- Added option to ignore bots from taking flags, default OFF (search sma for // CONFIGURABLE).
- Added checking of player's team range when touching flag in case it's a spawned spectator.
- Fixed bots not buying weapons, but be warned, they buy at default prices and without adrenaline.
- Changed default mp_buytime from 0 to 99999999 so bots can always buy, this doesn't affect players.
- Added API natives: jctf_get_flagcarrier(id) and jctf_get_team(id)
- Added FLAG_ADMINRETURN for the jctf_flag() forward, it triggers when an admin returns the flag using command
- Fixed ctf_moveflag command not showing Y axis in the log
v1.25:
- Changed ctf_moveflag to support red and blue inputs
- Fade to black no longer affects spectators
- Added "ctf_returnflag <red/blue>" admin command that returns the specified flag if it was dropped for at least 15 seconds (configurable)
- Optimized some minor stuff
v1.24:
- Changed ctf_weaponstay's default value from 30 to 15 (seconds)
- Changed ctf_itempercent's default value from 30 to 25 (percent)
- Added Scout and G3SG1 as special weapons.
- Added the "configurable" flag in the source for weapon money and adrenaline costs
- Added configurable weapon and zoom-in running speeds
- Added cvars for controling sounds: ctf_sound_taken/dropped/returned/score
- Added how much money/adrenaline you need in the "Not enough money/adrenaline" message
v1.23:
- plugin no longer disables VGUI menu automatically but it notifies VGUI menu users upon spawn
- added new in-source configuration: CHAT_SHOW_COMMANDS
v1.22:
- fixed a bug where you'd get twice the adrenaline when using the jctf_add_adrenaline() native while using a reason
- fixed adrenaline HUD not updating when using jctf_add_adrenaline()
v1.21:
- added FLAG_MANUALDROP for jctf_flag() events
- fixed some example issues in jctf_addon_example.sma
- updated version check to 1.21 since jctf.inc was altered
- added a console print upon plugin load with plugin name and version
- forced to reset jctf_version to the current version if mod is updated while server is running
v1.2:
- added forwards and natives that other plugins could use
- added configurable spawning weapons using CVars, they're also forced to reset to prevent unwanted usage between maps
- minor adjustments in the code to fit the latest modifications
v1.13:
- fixed some issues with the autoteambalance
- fixed spawn protection countdown not stop when prematurely disabling protection
- fixed game name displaying version as number instead of string
- added mod version in quick help and help console message
- added checking of mp_forcechasecam too for the fade to black feature
- fixed the possiblity of not beeing blinded while in freelook after a respawn
v1.12:
- fixed a bug where transfered people (autoteambalance) would actually block the team they left from beeing joined, the "there are too many CTs/Ts" thing.
- added fade to black when mp_fadetoblack is disabled and mp_forcecamera is enabled while player is on free view (no teammates alive)
v1.11:
- fixed a rare bug where players won't respawn after beeing killed
- some optimizations in code
v1.1:
- removed previous round-end blocking and added new round blocking method via Orpheu module
- fixed various possible crashes caused by previous round-end blocking methods
v1.06:
- changed buy menu text so that items you can't afford are in red text
- fixed various speed issues with player zooming, shield and flag taking
- re-done player rendering system and altered some colors and values
- unforced most mod cvars, only two cvars remain forced
v1.05:
- fixed round-blocking player deaths's animations
- changed the sounds of medkit and adrenaline item pickup
- and of course, other small adjustments
v1.04:
- other small adjustments here and there
- removed the spectating bots, now players' deaths are blocked if they'll trigger round end, they wouldn't even notice
- altered C4 plant radio message to a be compatible with client modifications and other hooks
v1.03:
- added /help
- minor adjustments and code moved around
v1.02:
- fixed items not fading out
- fixed the simple auto-team balance
- fixed various possible errors
v1.01:
- minor fixes of typos and checks
-------------------------------------------------------------------------------------------- */
new const INFO_TARGET[] = "info_target"
new const ITEM_CLASSNAME[] = "ctf_item"
new const WEAPONBOX[] = "weaponbox"
#if FEATURE_C4 == true
new const GRENADE[] = "grenade"
#endif // FEATURE_C4
new const Float:ITEM_HULL_MIN[3] = {-1.0, -1.0, 0.0}
new const Float:ITEM_HULL_MAX[3] = {1.0, 1.0, 10.0}
const ITEM_AMMO = 0
const ITEM_MEDKIT = 1
#if FEATURE_ADRENALINE == true
const ITEM_ADRENALINE = 2
#endif // FEATURE_ADRENALINE
new const ITEM_MODEL_AMMO[] = "models/w_chainammo.mdl"
new const ITEM_MODEL_MEDKIT[] = "models/w_medkit.mdl"
#if FEATURE_ADRENALINE == true
new const ITEM_MODEL_ADRENALINE[] = "models/can.mdl"
#endif // FEATURE_ADRENALINE
new const BASE_CLASSNAME[] = "ctf_flagbase"
new const Float:BASE_THINK = 0.25
new const FLAG_CLASSNAME[] = "ctf_flag"
new const FLAG_MODEL[] = "models/onlydead/th_jctf.mdl"
new const Float:FLAG_THINK = 0.1
const FLAG_SKIPTHINK = 20 /* FLAG_THINK * FLAG_SKIPTHINK = 2.0 seconds ! */
new const Float:FLAG_HULL_MIN[3] = {-2.0, -2.0, 0.0}
new const Float:FLAG_HULL_MAX[3] = {2.0, 2.0, 16.0}
new const Float:FLAG_SPAWN_VELOCITY[3] = {0.0, 0.0, -500.0}
new const Float:FLAG_SPAWN_ANGLES[3] = {0.0, 0.0, 0.0}
new const Float:FLAG_DROP_VELOCITY[3] = {0.0, 0.0, 50.0}
new const Float:FLAG_PICKUPDISTANCE = 80.0
const FLAG_LIGHT_RANGE = 12
const FLAG_LIGHT_LIFE = 5
const FLAG_LIGHT_DECAY = 1
const FLAG_ANI_DROPPED = 0
const FLAG_ANI_STAND = 1
const FLAG_ANI_BASE = 2
const FLAG_HOLD_BASE = 33
const FLAG_HOLD_DROPPED = 34
#if FEATURE_ADRENALINE == true
const ADRENALINE_SPEED = 1
const ADRENALINE_BERSERK = 2
const ADRENALINE_REGENERATE = 3
const ADRENALINE_INVISIBILITY = 4
new const MENU_ADRENALINE[] = "menu_adrenaline"
new const MENU_KEYS_ADRENALINE = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9)
#endif // FEATURE_ADRENALINE
#if FEATURE_BUY == true
new const WHITESPACE[] = " "
new const MENU_BUY[] = "menu_buy"
new const MENU_KEYS_BUY = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
new const BUY_ITEM_DISABLED[] = "r"
new const BUY_ITEM_AVAILABLE[] = "w"
#if FEATURE_ADRENALINE == true
new const BUY_ITEM_AVAILABLE2[] = "y"
#endif // FEATURE_ADRENALINE
#endif // FEATURE_BUY
new const SND_GETAMMO[] = "items/9mmclip1.wav"
new const SND_GETMEDKIT[] = "items/smallmedkit1.wav"
#if FEATURE_ADRENALINE == true
new const SND_GETADRENALINE[] = "items/medshot4.wav"
new const SND_ADRENALINE[] = "ambience/des_wind3.wav"
#endif // FEATURE_ADRENALINE
#if FEATURE_C4 == true
new const SND_C4DISARMED[] = "weapons/c4_disarmed.wav"
#endif // FEATURE_C4
new const CHAT_PREFIX[] = "^x03[^x04 Pega Bandeira^x03 ]^x01 "
new const CONSOLE_PREFIX[] = "[ Pega Bandeira ] "
const FADE_OUT = 0x0000
const FADE_IN = 0x0001
const FADE_MODULATE = 0x0002
const FADE_STAY = 0x0004
const m_iUserPrefs = 510
const m_flNextPrimaryAttack = 46
const m_flNextSecondaryAttack = 47
new const PLAYER[] = "player"
new const SEPARATOR[] = " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
#define NULL ""
#define HUD_HINT 255, 255, 255, 0.15, -0.3, 0, 0.0, 10.0, 2.0, 10.0, 4
#define HUD_HELP 255, 255, 0, -1.0, 0.2, 2, 0.1, 2.0, 0.01, 2.0, 2
#define HUD_HELP2 255, 255, 0, -1.0, 0.25, 2, 0.1, 2.0, 0.01, 2.0, 3
#define HUD_ANNOUNCE -1.0, 0.3, 0, 0.0, 3.0, 0.1, 1.0, 4
#define HUD_RESPAWN 0, 255, 0, -1.0, 0.6, 2, 0.5, 0.1, 0.0, 1.0, 1
#define HUD_PROTECTION 255, 255, 0, -1.0, 0.6, 2, 0.5, 0.1, 0.0, 1.0, 1
#define HUD_ADRENALINE 255, 255, 255, -1.0, -0.1, 0, 0.0, 600.0, 0.0, 0.0, 1
#define entity_create(%1) create_entity(%1)
#define entity_spawn(%1) DispatchSpawn(%1)
#define entity_think(%1) call_think(%1)
#define entity_remove(%1) remove_entity(%1)
#define weapon_remove(%1) call_think(%1)
#define task_set(%1) set_task(%1)
#define task_remove(%1) remove_task(%1)
#define player_hasFlag(%1) (g_iFlagHolder[TEAM_RED] == %1 || g_iFlagHolder[TEAM_BLUE] == %1)
#define player_allowChangeTeam(%1) set_pdata_int(%1, 125, get_pdata_int(%1, 125) & ~(1<<8))
#define gen_color(%1,%2) %1 == TEAM_RED ? %2 : 0, 0, %1 == TEAM_RED ? 0 : %2
#define get_opTeam(%1) (%1 == TEAM_BLUE ? TEAM_RED : (%1 == TEAM_RED ? TEAM_BLUE : 0))
enum
{
x,
y,
z
}
enum
{
pitch,
yaw,
roll
}
enum (+= 64)
{
TASK_RESPAWN = 64,
TASK_PROTECTION,
TASK_DAMAGEPROTECTION,
TASK_EQUIPAMENT,
TASK_PUTINSERVER,
TASK_TEAMBALANCE,
TASK_ADRENALINE,
TASK_DEFUSE,
TASK_CHECKHP
}
enum
{
TEAM_NONE = 0,
TEAM_RED,
TEAM_BLUE,
TEAM_SPEC
}
new const g_szCSTeams[][] =
{
NULL,
"TERRORIST",
"CT",
"SPECTATOR"
}
new const g_szTeamName[][] =
{
NULL,
"Red",
"Blue",
"Spectator"
}
new const g_szMLTeamName[][] =
{
NULL,
"TEAM_RED",
"TEAM_BLUE",
"TEAM_SPEC"
}
new const g_szMLFlagTeam[][] =
{
NULL,
"FLAG_RED",
"FLAG_BLUE",
NULL
}
enum
{
FLAG_STOLEN = 0,
FLAG_PICKED,
FLAG_DROPPED,
FLAG_MANUALDROP,
FLAG_RETURNED,
FLAG_CAPTURED,
FLAG_AUTORETURN,
FLAG_ADMINRETURN
}
enum
{
EVENT_TAKEN = 0,
EVENT_DROPPED,
EVENT_RETURNED,
EVENT_SCORE,
}
new const g_szSounds[][][] =
{
{NULL, "red_flag_taken", "blue_flag_taken"},
{NULL, "red_flag_dropped", "blue_flag_dropped"},
{NULL, "red_flag_returned", "blue_flag_returned"},
{NULL, "red_team_scores", "blue_team_scores"}
}
#if FEATURE_ADRENALINE == true
new const g_szAdrenalineUseML[][] =
{
NULL,
"ADR_SPEED",
"ADR_BERSERK",
"ADR_REGENERATE",
"ADR_INVISIBILITY"
}
#endif // FEATURE_ADRENALINE
#if FEATURE_BUY == true
enum
{
no_weapon,
primary,
secondary,
he,
flash,
smoke,
armor,
nvg
}
new const g_szRebuyCommands[][] =
{
NULL,
"PrimaryWeapon",
"SecondaryWeapon",
"HEGrenade",
"Flashbang",
"SmokeGrenade",
"Armor",
"NightVision"
}
#endif // FEATURE_BUY
new const g_szRemoveEntities[][] =
{
"func_buyzone",
"armoury_entity",
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"monster_scientist",
"func_hostage_rescue",
"info_hostage_rescue",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone",
"info_map_parameters",
"player_weaponstrip",
"game_player_equip"
}
enum
{
ZERO = 0,
W_P228,
W_SHIELD,
W_SCOUT,
W_HEGRENADE,
W_XM1014,
W_C4,
W_MAC10,
W_AUG,
W_SMOKEGRENADE,
W_ELITE,
W_FIVESEVEN,
W_UMP45,
W_SG550,
W_GALIL,
W_FAMAS,
W_USP,
W_GLOCK18,
W_AWP,
W_MP5NAVY,
W_M249,
W_M3,
W_M4A1,
W_TMP,
W_G3SG1,
W_FLASHBANG,
W_DEAGLE,
W_SG552,
W_AK47,
W_KNIFE,
W_P90,
W_VEST,
W_VESTHELM,
W_NVG
}
new const g_iClip[] =
{
0, // (unknown)
13, // P228
0, // SHIELD (not used)
10, // SCOUT
0, // HEGRENADE (not used)
7, // XM1014
0, // C4 (not used)
30, // MAC10
30, // AUG
0, // SMOKEGRENADE (not used)
30, // ELITE
20, // FIVESEVEN
25, // UMP45
30, // SG550
35, // GALIL
25, // FAMAS
12, // USP
20, // GLOCK18
10, // AWP
30, // MP5NAVY
100, // M249
8, // M3
30, // M4A1
30, // TMP
20, // G3SG1
0, // FLASHBANG (not used)
7, // DEAGLE
30, // SG552
30, // AK47
0, // KNIFE (not used)
50, // P90
0, // Kevlar (not used)
0, // Kevlar + Helm (not used)
0 // NVG (not used)
}
new const g_iBPAmmo[] =
{
0, // (unknown)
52, // P228
0, // SHIELD
90, // SCOUT
0, // HEGRENADE (not used)
32, // XM1014
0, // C4 (not used)
100, // MAC10
90, // AUG
0, // SMOKEGRENADE (not used)
120, // ELITE
100, // FIVESEVEN
100, // UMP45
90, // SG550
90, // GALIL
90, // FAMAS
100, // USP
120, // GLOCK18
30, // AWP
120, // MP5NAVY
200, // M249
32, // M3
90, // M4A1
120, // TMP
90, // G3SG1
0, // FLASHBANG (not used)
35, // DEAGLE
90, // SG552
90, // AK47
0, // KNIFE (not used)
100, // P90
0, // Kevlar (not used)
0, // Kevlar + Helm (not used)
0 // NVG (not used)
}
#if FEATURE_BUY == true
new const g_iWeaponPrice[] =
{
0, // (unknown)
600, // P228
10000, // SHIELD
6000, // SCOUT
300, // HEGRENADE
3000, // XM1014
60000, // C4
1400, // MAC10
3500, // AUG
100, // SMOKEGRENADE
1000, // ELITE
750, // FIVESEVEN
1700, // UMP45
6000, // SG550
2000, // GALIL
2250, // FAMAS
500, // USP
400, // GLOCK18
8000, // AWP
1500, // MP5NAVY
5000, // M249
1700, // M3
3100, // M4A1
1250, // TMP
7000, // G3SG1
200, // FLASHBANG
650, // DEAGLE
3500, // SG552
2500, // AK47
0, // KNIFE (not used)
2350, // P90
650, // Kevlar
1000, // Kevlar + Helm
1250 // NVG
}
#endif // FEATURE_BUY
#if FEATURE_BUY == true && FEATURE_ADRENALINE == true
new const g_iWeaponAdrenaline[] =
{
0, // (unknown)
0, // P228
50, // SHIELD
50, // SCOUT
0, // HEGRENADE
0, // XM1014
80, // C4
0, // MAC10
0, // AUG
0, // SMOKEGRENADE
0, // ELITE
0, // FIVESEVEN
0, // UMP45
30, // SG550
0, // GALIL
0, // FAMAS
0, // USP
0, // GLOCK18
50, // AWP
0, // MP5NAVY
10, // M249
0, // M3
0, // M4A1
0, // TMP
30, // G3SG1
0, // FLASHBANG
0, // DEAGLE
0, // SG552
0, // AK47
0, // KNIFE (not used)
0, // P90
0, // Kevlar
0, // Kevlar + Helm
0 // NVG
}
#endif // FEATURE_ADRENALINE
new const Float:g_fWeaponRunSpeed[] = // CONFIGURABLE - weapon running speed (edit the numbers in the list)
{
150.0, // Zoomed speed with any weapon
250.0, // P228
0.0, // SHIELD (not used)
260.0, // SCOUT
250.0, // HEGRENADE
240.0, // XM1014
250.0, // C4
250.0, // MAC10
240.0, // AUG
250.0, // SMOKEGRENADE
250.0, // ELITE
250.0, // FIVESEVEN
250.0, // UMP45
210.0, // SG550
240.0, // GALIL
240.0, // FAMAS
250.0, // USP
250.0, // GLOCK18
210.0, // AWP
250.0, // MP5NAVY
220.0, // M249
230.0, // M3
230.0, // M4A1
250.0, // TMP
210.0, // G3SG1
250.0, // FLASHBANG
250.0, // DEAGLE
235.0, // SG552
221.0, // AK47
250.0, // KNIFE
245.0, // P90
0.0, // Kevlar (not used)
0.0, // Kevlar + Helm (not used)
0.0 // NVG (not used)
}
#if FEATURE_BUY == true
new const g_iWeaponSlot[] =
{
0, // none
2, // P228
1, // SHIELD
1, // SCOUT
4, // HEGRENADE
1, // XM1014
5, // C4
1, // MAC10
1, // AUG
4, // SMOKEGRENADE
2, // ELITE
2, // FIVESEVEN
1, // UMP45
1, // SG550
1, // GALIL
1, // FAMAS
2, // USP
2, // GLOCK18
1, // AWP
1, // MP5NAVY
1, // M249
1, // M3
1, // M4A1
1, // TMP
1, // G3SG1
4, // FLASHBANG
2, // DEAGLE
1, // SG552
1, // AK47
3, // KNIFE (not used)
1, // P90
0, // Kevlar
0, // Kevlar + Helm
0 // NVG
}
#endif // FEATURE_BUY
new const g_szWeaponEntity[][24] =
{
NULL,
"weapon_p228",
"weapon_shield",
"weapon_scout",
"weapon_hegrenade",
"weapon_xm1014",
"weapon_c4",
"weapon_mac10",
"weapon_aug",
"weapon_smokegrenade",
"weapon_elite",
"weapon_fiveseven",
"weapon_ump45",
"weapon_sg550",
"weapon_galil",
"weapon_famas",
"weapon_usp",
"weapon_glock18",
"weapon_awp",
"weapon_mp5navy",
"weapon_m249",
"weapon_m3",
"weapon_m4a1",
"weapon_tmp",
"weapon_g3sg1",
"weapon_flashbang",
"weapon_deagle",
"weapon_sg552",
"weapon_ak47",
"weapon_knife",
"weapon_p90",
"item_kevlar",
"item_assaultsuit",
NULL
}
#if FEATURE_BUY == true
new const g_szWeaponCommands[][] =
{
{NULL, NULL},
{"p228", "228compact"},
{"shield", NULL},
{"scout", NULL},
{"hegren", NULL},
{"xm1014", "autoshotgun"},
{NULL, NULL},
{"mac10", NULL},
{"aug", "bullpup"},
{"sgren", NULL},
{"elites", NULL},
{"fiveseven", "fn57"},
{"ump45", "sm"},
{"sg550", "krieg550"},
{"galil", "defender"},
{"famas", "clarion"},
{"usp", "km45"},
{"glock", "9x19mm"},
{"awp", "magnum"},
{"mp5", "mp"},
{"m249", NULL},
{"m3", "12gauge"},