-
Notifications
You must be signed in to change notification settings - Fork 20
/
status.qc
1114 lines (1017 loc) · 40.8 KB
/
status.qc
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
float (float tno) TeamFortress_TeamGetScore;
float () TeamFortress_TeamGetWinner;
float () TeamFortress_TeamGetSecond;
string(float num) NumberToString1000;
string(float num) BlueScoreToString;
string(float num) RedScoreToString;
string(float num) YellowScoreToString;
string(float num) GreenScoreToString;
string(entity pl) ClipSizeToString;
float(entity pl) GetClipSize;
string(entity pl) SniperPowerToString;
string(entity pl) DetpackToString;
string(entity pl) AuraToString;
string(entity pl) AssaultCannonToString;
string(entity pl) RangeToString;
string(entity pl) ScannerToString;
string(entity pl) DisguiseToString;
string(entity pl) SentryDetailsToString;
string(entity pl) BuildingToString;
string(float pc) TeamFortress_GetClassName;
string (float class) CF_GetRandomClassTip {
local string tiptype = "";
local string line1 = "";
local string line2 = "";
local string line3 = "";
local string result = "";
local float showtips;
local float rand;
if (!self.tip_type) {
rand = random();
if (rand >= 0.8)
self.tip_type = 1;
else
self.tip_type = 2;
}
if (self.tip_type == 1) {
// general tip
tiptype = "Çåîåòáì ôéð:\n";
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 14);
if (self.display_tip == 1) {
line1 = "Team work is the key to victory.";
} else if (self.display_tip == 2) {
line1 = "Bunny hopping is easy to learn but hard";
line2 = "to master. It is vital for success.";
} else if (self.display_tip == 3) {
line1 = "Have a grenade (mouse2 & f) ready to";
line2 = "throw before entering combat. Timing is";
line3 = "key.";
} else if (self.display_tip == 4) {
line1 = "Jump as a hand grenade (mouse2) explodes";
line2 = "in your hand to perform a grenade jump.";
} else if (self.display_tip == 5) {
line1 = "Reload your current weapon (r) and";
line2 = "secondary weapons (g) whenever you get";
line3 = "the chance.";
} else if (self.display_tip == 6) {
line1 = "Swing your melee weapon (4) to show your";
line2 = "teammates that you're not a spy.";
} else if (self.display_tip == 7) {
line1 = "Kill the enemy demolitions man to";
line2 = "destroy his pipe trap.";
} else if (self.display_tip == 8) {
line1 = "Discard (x) unneeded ammo to reduce the";
line2 = "damage taken from EMP grenades.";
} else if (self.display_tip == 9) {
line1 = "Call your medic (v) for health or your";
line2 = "engineer for armor.";
} else if (self.display_tip == 10) {
line1 = "Learn your class special (e) and class";
line2 = "menu (5).";
} else if (self.display_tip == 11) {
line1 = "Type /classhelp in the console at any";
line2 = "time to get help with your class.";
} else if (self.display_tip == 12) {
line1 = "Throw the flag (z) to teammates or a";
line2 = "better position.";
} else if (self.display_tip == 13) {
line1 = "When your flag is about to get captured,";
line2 = "reset your defence to stop chain";
line3 = "captures.";
} else if (self.display_tip == 14) {
line1 = "Throw the flag (c) to give it to a team";
line2 = "mate or gain valuable meters before";
line3 = "you're fragged.";
}
}
} else {
// class tip
tiptype = "Ãìáóó Ôéð:\n";
if (class == PC_SCOUT) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 19);
if (self.display_tip == 1) {
line1 = "The scout is an excellent attacking";
line2 = "class due to his speed and";
line3 = "manoeuvrability.";
} else if (self.display_tip == 2) {
line1 = "Expose enemy spies by touching them.";
} else if (self.display_tip == 3) {
line1 = "Disarm detpacks by standing on them.";
} else if (self.display_tip == 4) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (2)";
line3 = "is more useful over long distances.";
} else if (self.display_tip == 5) {
line1 = "Drop caltrops (mouse2) to slow the";
line2 = "enemy down.";
} else if (self.display_tip == 6) {
line1 = "The caltrop canister's (mouse2) slowing";
line2 = "effect can be reversed by a medic or by";
line3 = "picking up health.";
} else if (self.display_tip == 7) {
line1 = "Use concussion grenades (f) to blast";
line2 = "enemies away from you and to slow them";
line3 = "down.";
} else if (self.display_tip == 8) {
line1 = "The concussion grenade (f) effect is";
line2 = "active for up to 19 seconds.";
} else if (self.display_tip == 9) {
line1 = "The concussion grenade (f) blast";
line2 = "effect is stronger toward the outside";
line3 = "of its blast radius.";
} else if (self.display_tip == 10) {
line1 = "Concussion grenade (f) blasts will";
line2 = "penetrate walls. Use this to your";
line3 = "advantage.";
} else if (self.display_tip == 11) {
line1 = "The medic recovers from concussion";
line2 = "grenade (f) effect twice as fast as";
line3 = "other classes.";
} else if (self.display_tip == 12) {
line1 = "Throw a concussion grenade (f) then";
line2 = "position yourself for the perfect";
line3 = "concussion grenade jump.";
} else if (self.display_tip == 13) {
line1 = "Concussion grenade (f) jumps can be";
line2 = "chained for great distances.";
} else if (self.display_tip == 14) {
if (scoutdash) {
line1 = "The scout can perform a speed jump (e).";
line2 = "This is great for initiating a bunny";
line3 = "hop.";
} else {
self.display_tip = 0;
}
} else if (self.display_tip == 15) {
if (scoutdash) {
line1 = "To maintain the speed from dash (e), use";
line2 = "strafe buttons and keep jumping.";
} else {
self.display_tip = 0;
}
} else if (self.display_tip == 16) {
line1 = "The scanner (5) can reveal the";
line2 = "location of other players and the flag.";
} else if (self.display_tip == 17) {
line1 = "Use the scanner menu (5) to choose from";
line2 = "which team to scan for players.";
} else if (self.display_tip == 18) {
line1 = "The scanner (5) can detect items and";
line2 = "players through walls.";
} else if (self.display_tip == 19) {
line1 = "The scanner (5) consumes 2 cells every";
line2 = "other second while active.";
}
}
} else if (class == PC_SNIPER) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 9);
if (self.display_tip == 1) {
line1 = "Position yourself strategically so you";
line2 = "can easily take cover from incoming";
line3 = "fire.";
} else if (self.display_tip == 2) {
line1 = "The sniper rifle (1) does more damage";
line2 = "the longer you hold down fire (mouse1).";
} else if (self.display_tip == 3) {
line1 = "Use full auto mode sniper rifle (2) to";
line2 = "pick off a weak enemy.";
} else if (self.display_tip == 4) {
line1 = "Head shots with the sniper rifle (1)";
line2 = "deal double damage.";
} else if (self.display_tip == 5) {
line1 = "Leg shots with the sniper rifle (1)";
line2 = "slow your enemy.";
} else if (self.display_tip == 6) {
line1 = "Throw flares (f) to illuminate a dark";
line2 = "area.";
} else if (self.display_tip == 7) {
line1 = "Zoom in (e) to get a better view of";
line2 = "your enemies.";
} else if (self.display_tip == 8) {
line1 = "Use the mouse wheel to adjust zoom";
line2 = "while zoomed in.";
} else if (self.display_tip == 9) {
line1 = "Your mouse sensitivity will";
line2 = "automatically adjust to your zoom level.";
}
}
} else if (class == PC_SOLDIER) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 7);
if (self.display_tip == 1) {
line1 = "Use cover to take out a sentry gun with";
line2 = "your rockets from distance.";
} else if (self.display_tip == 2) {
line1 = "Add a rocket jump to your grenade jump";
line2 = "for even more distance and speed.";
} else if (self.display_tip == 3) {
line1 = "Rocket jump off surfaces for a big";
line2 = "bunny hopping boost.";
} else if (self.display_tip == 4) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 5) {
line1 = "Use the super shotgun (2) to slow an";
line2 = "incoming enemy and the rocket launcher";
line3 = "to finish them off.";
} else if (self.display_tip == 6) {
line1 = "Use the super shotgun (2) at very close";
line2 = "range to avoid splash damage.";
} else if (self.display_tip == 7) {
line1 = "Use a nail grenade (f) to clear a small";
line2 = "room or block a bottle neck.";
}
}
} else if (class == PC_DEMOMAN) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 6);
if (self.display_tip == 1) {
line1 = "When your flag is out, cover it in pipe";
line2 = "grenades (2). Detonate (e) before the";
line3 = "enemy touches it.";
} else if (self.display_tip == 2) {
line1 = "Your grenade launcher (1) and pipe";
line2 = "launcher (2) share a clip. Reload (r)";
line3 = "often.";
} else if (self.display_tip == 3) {
line1 = "Lay your pipe grenades (2) in a";
line2 = "bottleneck and keep out of the way.";
line3 = "Detonate them with (e).";
} else if (self.display_tip == 4) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 5) {
line1 = "Use your MIRV grenades (f) to clear a";
line2 = "room or block a bottleneck.";
} else if (self.display_tip == 6) {
line1 = "On some maps, lay your detonation";
line2 = "pack (5) near areas blocked by grates";
line3 = "to open them.";
}
}
} else if (class == PC_MEDIC) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 12);
if (self.display_tip == 1) {
line1 = "The medic recovers from the effects of a";
line2 = "concussion grenade (f) twice as fast as";
line3 = "other classes.";
} else if (self.display_tip == 2) {
line1 = "The medic recovers from status effects";
line2 = "twice as fast as other classes.";
} else if (self.display_tip == 3) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 4) {
line1 = "The super shotgun (2) does the most";
line2 = "damage at close ranges.";
} else if (self.display_tip == 5) {
line1 = "Use your medikit (4) on teammates to";
line2 = "heal status effects and give them super";
line3 = "health.";
} else if (self.display_tip == 6) {
line1 = "Use your medikit (4) on enemies to";
line2 = "infect them with a deadly and contagious";
line3 = "virus.";
} else if (self.display_tip == 7) {
line1 = "Use concussion grenades (f) to blast";
line2 = "enemies away from you and to slow them";
line3 = "down.";
} else if (self.display_tip == 8) {
line1 = "The concussion grenade (f) blast effect";
line2 = "is stronger toward the outside of its";
line3 = "blast radius.";
} else if (self.display_tip == 9) {
line1 = "Concussion grenade (f) blasts will";
line2 = "penetrate walls. Use this to your";
line3 = "advantage.";
} else if (self.display_tip == 10) {
line1 = "Throw a concussion grenade (f) then";
line2 = "position yourself for the perfect";
line3 = "concussion grenade jump.";
} else if (self.display_tip == 11) {
line1 = "Concussion jumps can be chained for";
line2 = "great distances.";
} else if (self.display_tip == 12) {
line1 = "Use your healing aura (e) to slowly";
line2 = "heal nearby teammates over time.";
}
}
} else if (class == PC_HVYWEAP) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 8);
if (self.display_tip == 1) {
line1 = "A bunny hopping heavy weapons guy is";
line2 = "very tough to stop with weapons.";
} else if (self.display_tip == 2) {
line1 = "The heavy weapons guy is too heavy to";
line2 = "grenade jump very far.";
} else if (self.display_tip == 3) {
line1 = "Avoid concussion grenades, they stop you";
line2 = "from standing still, reducing your";
line3 = "accuracy.";
} else if (self.display_tip == 4) {
line1 = "The assault cannon takes (1) a while to";
line2 = "spin up, use your class special (e) to";
line3 = "keep it spinning.";
} else if (self.display_tip == 5) {
line1 = "Stand still to increase the accuracy of";
line2 = "your assault cannon (1).";
} else if (self.display_tip == 6) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 7) {
line1 = "The super shotgun (2) does the most";
line2 = "damage at close ranges.";
} else if (self.display_tip == 8) {
line1 = "MIRV grenades (f) are a powerful way to";
line2 = "clear a room or block a bottleneck.";
}
}
} else if (class == PC_PYRO) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 6);
if (self.display_tip == 1) {
line1 = "Use the flame thrower (1) to set your";
line2 = "enemies on fire, causing them to lose";
line3 = "health over time.";
} else if (self.display_tip == 2) {
line1 = "Use the flame thrower (1) to knock back";
line2 = "your enemies.";
} else if (self.display_tip == 3) {
line1 = "The flame thrower (1) does not work";
line2 = "underwater.";
} else if (self.display_tip == 4) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 5) {
line1 = "Napalm grenades (f) are useful for";
line2 = "clearing a small room or blocking off a";
line3 = "bottleneck.";
} else if (self.display_tip == 6) {
line1 = "The pyro's kevlar armor makes him immune";
line2 = "to being burned.";
}
}
} else if (class == PC_SPY) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 11);
if (self.display_tip == 1) {
line1 = "Watch out for scouts, they will reveal";
line2 = "your true identity if they touch you.";
} else if (self.display_tip == 2) {
line1 = "Using your weapon or picking up the flag";
line2 = "will reveal your true identity.";
} else if (self.display_tip == 3) {
line1 = "The spy can throw grenades (mouse2 & f)";
line2 = "without revealing his true identity.";
} else if (self.display_tip == 4) {
line1 = "The tranquiliser gun (1) slows your";
line2 = "enemies down.";
} else if (self.display_tip == 5) {
line1 = "The super shotgun (2) does the most";
line2 = "damage at close ranges.";
} else if (self.display_tip == 6) {
line1 = "With its faster rate of fire, and";
line2 = "greater accuracy, the shotgun (3) is";
line3 = "more useful over long distances.";
} else if (self.display_tip == 7) {
line1 = "Knife (4) your enemy in the back for";
line2 = "3x damage.";
} else if (self.display_tip == 8) {
line1 = "The gas grenade (f) will annoy your";
line2 = "enemies, causing them to hallucinate.";
} else if (self.display_tip == 9) {
line1 = "The spy can disguise (5) his team and";
line2 = "class. Sneak past the enemy defences.";
} else if (self.display_tip == 10) {
line1 = "An enemy sentry gun won't shoot you";
line2 = "while you are disguised (5).";
} else if (self.display_tip == 11) {
line1 = "Use feign death (e) to fool your";
line2 = "enemies of your demise.";
}
}
} else if (class == PC_ENGINEER) {
while (strlen(line1) == 0) {
if (!self.display_tip)
self.display_tip = ceil(random() * 11);
if (self.display_tip == 1) {
line1 = "Watch out for spies. A sentry gun will";
line2 = "not shoot an enemy spy disguised as a";
line3 = "teammate.";
} else if (self.display_tip == 2) {
line1 = "The railgun (1) is accurate on long";
line2 = "distances. Use it on stationary objects.";
} else if (self.display_tip == 3) {
line1 = "The super shotgun (2) does the most";
line2 = "damage at close ranges.";
} else if (self.display_tip == 4) {
line1 = "Use the spanner (4) on your sentry guns";
line2 = "to upgrade, repair, restock or rotate";
line3 = "them.";
} else if (self.display_tip == 5) {
line1 = "Use the spanner (4) on your teammates";
line2 = "to repair their armor.";
} else if (self.display_tip == 6) {
line1 = "Use the spanner (4) on your dispensers";
line2 = "to add ammo and armor.";
} else if (self.display_tip == 7) {
line1 = "The EMP grenade (f) will explode any";
line2 = "nearby ammo including pipebombs on the";
line3 = "ground.";
} else if (self.display_tip == 8) {
line1 = "The engineer can build (5) sentry guns";
line2 = "and ammo / armor dispensers.";
} else if (self.display_tip == 9) {
line1 = "Build (5) your dispenser in a defensive";
line2 = "position and detonate (e) it when an";
line3 = "enemy is nearby.";
} else if (self.display_tip == 10) {
line1 = "The more ammo in your dispenser, the";
line2 = "more damage it does when it is";
line3 = "detonated (e).";
} else if (self.display_tip == 11) {
line1 = "Rockets and cells will give the most";
line2 = "blast damage from a detonated (e)";
line3 = "dispenser.";
} else if (self.display_tip == 12) {
line1 = "A sentry gun can be upgraded to level 3,";
line2 = "giving it the ability to fire rockets.";
} else if (self.display_tip == 13) {
line1 = "A sentry gun cannot be built on a moving";
line2 = "platform.";
}
}
}
}
showtips = !stof(infokey(self, "dt"));
if (showtips && classtips && self.display_tip) {
result = strcat(tiptype, line1);
result = strcat(result, "\n");
result = strcat(result, line2);
result = strcat(result, "\n");
result = strcat(result, line3);
result = strcat(result, "\n\n\n");
} else {
result = "\n\n\n\n\n\n";
}
return strzone(result);
};
void (entity pl, string...count) Status_Print =
{
local float i, lines, len;
local string s;
// no printing while menu open
if (pl.menu_input)
return;
s = "";
for (i = 0; i < count; i++) {
s = strcat(s, ...(i, string));
}
len = strlen(s);
if (pl.StatusString)
strunzone(pl.StatusString);
pl.StatusString = strzone(s);
lines = 0;
for (i = 0; i < len; i++)
if (substr(pl.StatusString, i, 1) == "\n")
lines++;
pl.StatusStringLines = lines;
pl.StatusStringTime = time + 1.5;
pl.StatusRefreshTime = time;
};
void (entity pl, f_void_float func, string...count) Status_Menu =
{
local float i, lines, len;
local string s;
s = "";
for (i = 0; i < count; i++) {
s = strcat(s, ...(i, string));
}
len = strlen(s);
if (pl.StatusString)
strunzone(pl.StatusString);
pl.StatusString = strzone(s);
lines = 0;
for (i = 0; i < len; i++)
if (substr(pl.StatusString, i, 1) == "\n")
lines++;
pl.StatusStringLines = lines;
pl.StatusStringTime = time + 1.5;
pl.StatusRefreshTime = time;
pl.menu_input = func;
pl.impulse = 0;
};
void (entity pl) Status_Refresh =
{
if (pl.StatusRefreshTime == time)
return;
pl.StatusRefreshTime = time;
};
void (entity pl, string s1) CenterPrint = {
Status_Print(pl, s1);
};
void (entity pl, string s1, string s2) CenterPrint2 = {
Status_Print(pl, s1, s2);
};
void (entity pl, string s1, string s2, string s3) CenterPrint3 = {
Status_Print(pl, s1, s2, s3);
};
void (entity pl) RefreshStatusBar = {
local string pad;
local string s1; // will be used for grenade timers
local string s2; // class line
local string s3; // score & clip
local string ct; // class tip
local string st1, st2, st3, st4; // status bar columns 1-4
local string ident;
local float height;
local float i;
local float win, sec;
pad = "";
if (pl.StatusStringLines > 0 && pl.StatusStringTime <= time && !pl.menu_input) {
if (pl.StatusString)
strunzone(pl.StatusString);
pl.StatusString = string_null;
pl.StatusStringLines = 0;
}
height = floor(stof(infokey(pl, "sb")));
if (height > 300)
height = 300;
height = height - pl.StatusStringLines - 13;
// no sbar can be displayed
if (height <= 0 || pl.playerclass == PC_UNDEFINED) {
centerprint(pl, pl.StatusString);
pl.StatusRefreshTime = time + 1.5;
return;
}
for (i = 0; i < height; i++)
pad = strcat(pad, "\n");
pad = strzone(pad);
// class tip
if (((time - 6) < pl.spawn_time) || ((time - 6) < pl.tip_time)) {
ct = CF_GetRandomClassTip(pl.playerclass);
} else {
pl.display_tip = 0;
ct = strzone("\n\n\n\n\n\n");
}
// status line 1 column 1 - grenade timer
if (pl.StatusGrenTime > 0) {
st1 = strcat("Çòåîáäå: ", ftos(pl.StatusGrenTime));
if (pl.fragstreak > 1 && pl.caps)
st1 = strcat(st1, " sec");
else
st1 = strcat(st1, " seconds");
} else
st1 = "";
// status line 1 column 3 - kill streak & caps
if (pl.fragstreak > 1) {
st2 = "Ëéìì óôòåáë: ";
st2 = strcat(st2, strpadl(ftos(pl.fragstreak),2));
} else
st2 = "";
if (pl.caps) {
if (pl.fragstreak > 1)
st2 = strcat(st2, " ");
st3 = "Ãáðó: ";
st3 = strcat(st3, strpadl(ftos(pl.caps),2));
} else
st3 = "";
st2 = strcat(st2, st3);
// status line 1
if (pl.fragstreak > 1 && pl.caps) {
st2 = strpadl(st2, 25);
s1 = strpadr(st1, 15);
} else {
st2 = strpadl(st2, 20);
s1 = strpadr(st1, 20);
}
s1 = strcat(s1, st2);
s1 = strcat(s1, "\n");
s1 = strzone(s1);
// status line 2 column 1 - class specific information
st1 = "";
if (pl.playerclass == PC_SCOUT)
st1 = ScannerToString(pl);
else if (pl.playerclass == PC_SNIPER && (pl.tfstate & TFSTATE_AIMING))
st1 = SniperPowerToString(pl);
else if (pl.playerclass == PC_DEMOMAN && pl.detpack_left)
st1 = DetpackToString(pl);
else if (pl.playerclass == PC_MEDIC)
st1 = AuraToString(pl);
else if (pl.playerclass == PC_HVYWEAP)
st1 = AssaultCannonToString(pl);
else if (pl.playerclass == PC_SPY)
st1 = DisguiseToString(pl);
else if (pl.playerclass == PC_ENGINEER && pl.has_sentry)
st1 = SentryDetailsToString(pl);
if (pl.playerclass == PC_ENGINEER && pl.is_building)
st1 = BuildingToString(pl);
// status line 2
s2 = strpadr(st1, 40);
s2 = strcat(s2, "\n");
s2 = strzone(s2);
// status line 3 column 1 - team 1 score
win = TeamFortress_TeamGetWinner();
sec = TeamFortress_TeamGetSecond();
if (win == 0)
st1 = BlueScoreToString(team1score);
else if (win == 1)
st1 = BlueScoreToString(team1score);
else if (win == 2)
st1 = RedScoreToString(team2score);
else if (win == 3)
st1 = YellowScoreToString(team3score);
else
st1 = GreenScoreToString(team4score);
st1 = strcat(st1, " ");
// status line 3 column 2 - team 2 score
if (sec == 0) {
if (win < 2)
st2 = RedScoreToString(team2score);
else
st2 = BlueScoreToString(team1score);
}
else if (sec == 1)
st2 = BlueScoreToString(team1score);
else if (sec == 2)
st2 = RedScoreToString(team2score);
else if (sec == 3)
st2 = YellowScoreToString(team3score);
else
st2 = GreenScoreToString(team4score);
// status line 3 column 3 - clip size
if (pl.tfstate & TFSTATE_RELOADING) {
st3 = "Ãìéð: ";
if ((sniperreloadpercent) && (reload_cliptick) && (pl.playerclass == PC_SNIPER)) {
st3 = strcat(st3, strpadl(ftos(25 * pl.reload_sniper_ticks), 3));
st3 = strcat(st3, "% ");
} else {
if (reload_cliptick)
st3 = strcat(st3, strpadl(ftos(pl.reload_clipsize), 2));
else
st3 = strcat(st3, " 0");
st3 = strcat(st3, "/");
st3 = strcat(st3, strpadr(ftos(GetClipSize(pl)), 3));
}
} else {
st3 = ClipSizeToString(pl);
}
// status line 3 column 4 - grenade count
st4 = strcat("Çòåî: ", strcat(strcat(ftos(pl.no_grenades_1), "+"), ftos(pl.no_grenades_2)));
// status line 3
s3 = strcat(st1, st2);
s3 = strpadr(s3, 19);
s3 = strcat(s3, strpadl(strcat(st3, st4), 21));
s3 = strcat(s3, "\n");
s3 = strzone(s3);
// identify
if (pl.ident_string != string_null && time < pl.ident_time) {
ident = strcat(pl.ident_string, "\n\n");
} else {
ident = "\n\n\n\n";
}
centerprint(pl, pl.StatusString, pad, ident, ct, s1, s2, s3);
pl.StatusRefreshTime = time + 1.5;
strunzone(pad); strunzone(ct); strunzone(s1); strunzone(s2); strunzone(s3);
};
string(float num) NumberToString1000 =
{
if (num > 999)
return "999";
return strpadl(ftos(floor(num)), 3);
};
string(float num) BlueScoreToString =
{
if (num > 999)
num = 999;
return strcat("Âìõå:", strpadl(ftos(floor(num)), 3));
};
string(float num) RedScoreToString =
{
if (num > 999)
num = 999;
return strcat("Òåä :", strpadl(ftos(floor(num)), 3));
};
string(float num) YellowScoreToString =
{
if (num > 999)
num = 999;
return strcat("Ùåìì:", strpadl(ftos(floor(num)), 3));
};
string(float num) GreenScoreToString =
{
if (num > 999)
num = 999;
return strcat("Çòåî:", strpadl(ftos(floor(num)), 3));
};
string(entity pl) ClipSizeToString =
{
local string st;
local float num, max;
max = GetClipSize(pl);
if (pl.current_weapon == WEAP_SHOTGUN) {
if ((max - pl.reload_shotgun) > pl.ammo_shells)
pl.reload_shotgun = max - pl.ammo_shells;
num = max - pl.reload_shotgun;
} else if (pl.current_weapon == WEAP_SUPER_SHOTGUN) {
if ((max - pl.reload_super_shotgun) > pl.ammo_shells)
pl.reload_super_shotgun = max - pl.ammo_shells;
num = (max - pl.reload_super_shotgun);
} else if (pl.current_weapon == WEAP_SNIPER_RIFLE) {
if (!sniperreload)
return ("");
if ((max - pl.reload_sniper_rifle) > pl.ammo_shells)
pl.reload_sniper_rifle = max - pl.ammo_shells;
num = (max - pl.reload_sniper_rifle);
} else if (pl.current_weapon == WEAP_GRENADE_LAUNCHER) {
if ((max - pl.reload_grenade_launcher) > pl.ammo_rockets)
pl.reload_grenade_launcher = (max - pl.ammo_rockets);
num = (max - pl.reload_grenade_launcher);
} else if (pl.current_weapon == WEAP_ROCKET_LAUNCHER) {
if ((max - pl.reload_rocket_launcher) > pl.ammo_rockets)
pl.reload_rocket_launcher = (max - pl.ammo_rockets);
num = (max - pl.reload_rocket_launcher);
} else
return ("");
if (num > 99)
num = 99;
st = "Ãìéð: ";
st = strcat(st, strpadl(ftos(floor(num)), 2));
st = strcat(st, "/");
st = strcat(st, strpadr(ftos(max), 3));
return st;
};
float(entity pl) GetClipSize =
{
if (pl.current_weapon == WEAP_SHOTGUN)
return 8;
else if (pl.current_weapon == WEAP_SUPER_SHOTGUN)
return 16;
else if (pl.current_weapon == WEAP_SNIPER_RIFLE)
return 1;
else if (pl.current_weapon == WEAP_GRENADE_LAUNCHER)
return 6;
else if (pl.current_weapon == WEAP_ROCKET_LAUNCHER)
return 4;
else
return 0;
};
string(float num) TeamToString =
{
if (num == 1) return "Blue";
if (num == 2) return "Red";
if (num == 3) return "Yellow";
if (num == 4) return "Green";
return " ";
};
string(float num) ClassToString =
{
if (num == 1) return "Scout";
if (num == 2) return "Sniper";
if (num == 3) return "Soldier";
if (num == 4) return "Demoman";
if (num == 5) return "Medic";
if (num == 6) return "HWGuy";
if (num == 7) return "Pyro";
if (num == 8) return "Spy";
if (num == 9) return "Engineer";
if (num == 11) return "Civilian";
if (num == 13) return "Sentry Gun";
if (num == 14) return "Goal Item";
return "";
};
string(entity pl) DisguiseToString =
{
local string st = "";
local string skin = "";
local string team = "";
if (pl.is_undercover == 1) {
if (self.items & IT_INVISIBILITY) {
st = "Éîöéóéâìå";
} else {
st = "Õîäåòãïöåò: ";
if (pl.undercover_team) {
st = strcat(st, TeamToString(pl.undercover_team));
st = strcat(st, " ");
}
if (pl.undercover_skin)
st = strcat(st, ClassToString(pl.undercover_skin));
}
} else if (pl.is_undercover == 2) {
if (invis_only) {
st = "Éîöéóéâìå in ";
st = strcat(st, ftos(pl.undercover_timer));
st = strcat(st, " seconds");
} else {
if (pl.disguise_team) {
team = strcat(team, "(");
team = strcat(team, TeamToString(pl.disguise_team));
if (!pl.queue_skin)
team = strcat(team, ") ");
} else if (pl.queue_team) {
team = strcat(team, "(");
team = strcat(team, TeamToString(pl.queue_team));
team = strcat(team, " ");
} else if (pl.undercover_team) {
team = strcat(team, TeamToString(pl.undercover_team));
team = strcat(team, " ");
}
if (pl.disguise_skin) {
if (!pl.queue_team)
skin = strcat(skin, "(");
skin = strcat(skin, ClassToString(pl.disguise_skin));
skin = strcat(skin, ")");
} else if (pl.queue_skin) {
skin = strcat(skin, " ");
skin = strcat(skin, ClassToString(pl.queue_skin));
skin = strcat(skin, ")");
} else if (pl.undercover_skin) {
skin = strcat(skin, ClassToString(pl.undercover_skin));
}
st = "Õîäåòãïöåò: ";
st = strcat(st, team);
st = strcat(st, skin);
}
}
return st;
};
string(entity pl) SniperPowerToString =
{
local string st = "";
if (!sniperpower)
return st;
if (pl.heat) {
st = "Ðï÷åò: ";
st = strcat(st, ftos(pl.heat));
st = strcat(st, " dmg");
if (pl.power_full) {
st = strcat(st, " (max)");
}
}
return st;
};
string(entity pl) DetpackToString =
{
local string st = "";
if (pl.is_detpacking) {
st = "Äåôðáãë: ";
st = strcat(st, ftos(pl.detpack_left));
st = strcat(st, " (");
st = strcat(st, ftos(pl.is_detpacking));
st = strcat(st, ")");
st = strcat(st, " seconds left");
} else if (pl.detpack_left) {
st = "Äåôðáãë: ";
st = strcat(st, ftos(pl.detpack_left));
st = strcat(st, " seconds left");
}
return st;
};
string(entity pl) AuraToString =
{
local string st;
if (medicaura) {
st = "Èåáìéîç Áõòá: ";
if (pl.aura_active) {
if (time < pl.aura_healtime && pl.aura_healcount) {
st = strcat(st, ftos(pl.aura_healcount));
st = strcat(st, " players healed for ");
st = strcat(st, ftos(pl.aura_healamount));
st = strcat(st, " hp");
}
else if (pl.ammo_cells < 50)
st = strcat(st, "out of power");
else if (pl.ammo_cells < 95)
st = strcat(st, "recharging");
else
st = strcat(st, "on");
} else {
st = strcat(st, "off");
}
} else {
st = "";
}
return st;
};
string(entity pl) AssaultCannonToString =
{
if (pl.current_weapon == WEAP_ASSAULT_CANNON && (pl.tfstate & TFSTATE_LOCK))
return "Áóóáõìô Ãáîîïî Ìïãëåä";
else
return "";
};
string(entity pl) RangeToString =
{
local entity te;
local float num;
if (!pl.ScannerOn) {
return "";