-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathl4d2_custom_commands.sp
5117 lines (4544 loc) · 158 KB
/
l4d2_custom_commands.sp
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
/***********************************************************************************************
* NAVIGATION (Search For: Do not allow caps)
*
* -EVENTS - Events.
*
* -COMMANDS - For commands code
* -Vomit Player
* -Incap Player
* -Change Speed Player
* -Set Health Player
* -Change Color Player
* -
*
* -MENU RELATED - For menus code
* -Show Categories
* -Display menus
* -Sub Menus Needed
* -Do Action
*
* -FUNCTIONS - For functions code (They do every action)
*
*
*
*
************************************************************************************************/
//Include data
#pragma newdecls required
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
//#include <sdktools_functions>
//#include <sdkhooks>
#include <adminmenu>
#define PLUGIN_NAME "自定义管理命令"
#define PLUGIN_AUTHOR "honorcode23, Shadowysn (improvements)"
#define PLUGIN_DESC "Allow admins to use new administrative or fun commands"
#define PLUGIN_VERSION "1.3.7"
#define PLUGIN_URL "https://forums.alliedmods.net/showthread.php?t=133475"
#define PLUGIN_NAME_SHORT "Custom admin commands"
#define PLUGIN_NAME_TECH "l4d2_custom_commands"
//Definitions needed for plugin functionality
#define DEBUG 1
#define DESIRED_FLAGS ADMFLAG_UNBAN
#define ARRAY_SIZE 5000
//Colors
#define RED "189 9 13 255"
#define BLUE "34 22 173 255"
#define GREEN "34 120 24 255"
#define YELLOW "231 220 24 255"
#define BLACK "0 0 0 255"
#define WHITE "255 255 255 255"
#define TRANSPARENT "255 255 255 0"
#define HALFTRANSPARENT "255 255 255 180"
//Sounds
#define EXPLOSION_SOUND "ambient/explosions/explode_1.wav"
#define EXPLOSION_SOUND2 "ambient/explosions/explode_2.wav"
#define EXPLOSION_SOUND3 "ambient/explosions/explode_3.wav"
//#define EXPLOSION_DEBRIS "animation/van_inside_debris.wav"
#define EXPLOSION_DEBRIS "animation/plantation_exlposion.wav"
//#define EXPLOSION_DEBRIS "weapons/grenade_launcher/grenadefire/grenade_launcher_explode_1.wav"
//Particles
#define FIRE_PARTICLE "gas_explosion_ground_fire"
#define EXPLOSION_PARTICLE "FluidExplosion_fps"
#define EXPLOSION_PARTICLE2 "weapon_grenade_explosion"
#define EXPLOSION_PARTICLE3 "explosion_huge_b"
#define BURN_IGNITE_PARTICLE "fire_small_01"
#define BLEED_PARTICLE "blood_chainsaw_constant_tp"
//Models
#define ZOEY_MODEL "models/survivors/survivor_teenangst.mdl"
#define FRANCIS_MODEL "models/survivors/survivor_biker.mdl"
#define LOUIS_MODEL "models/survivors/survivor_manager.mdl"
//Command Returns
#define CMD_INVALID_CL "[SM] Invalid client!"
#define CMD_DEAD_CL "[SM] Client is not a living player!"
#define CMD_NOT_SURVIVOR_CL "[SM] Client is not a survivor!"
#define CMD_NOT_INFECTED_CL "[SM] Client is not an infected!"
#define CMD_INVALID_ENT "[SM] Invalid entity!"
//SDKCall Stuff
#define GAMEDATA "l4d2customcmds"
static Handle hConf = null;
// Handles for SDKCalls
static Handle sdkCallPushPlayer = null;
#define NAME_CallPushPlayer "CTerrorPlayer_Fling"
#define SIG_CallPushPlayer_LINUX "@_ZN13CTerrorPlayer5FlingERK6Vector17PlayerAnimEvent_tP20CBaseCombatCharacterf"
#define SIG_CallPushPlayer_WINDOWS "\\x53\\x8B\\xDC\\x83\\xEC\\x08\\x83\\xE4\\xF0\\x83\\xC4\\x04\\x55\\x8B\\x6B\\x04\\x89\\x6C\\x24\\x04\\x8B\\xEC\\x81\\xEC\\xA8\\x00\\x00\\x00\\\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x8B\\x43\\x10"
//static Handle sdkDetonateAcid = null;
#define NAME_DetonateAcid "CSpitterProjectile_Detonate"
#define SIG_DetonateAcid_LINUX "@_ZN18CSpitterProjectile8DetonateEv"
#define SIG_DetonateAcid_WINDOWS "\\x55\\x8B\\xEC\\x81\\xEC\\x94\\x00\\x00\\x00\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x2A\\x53\\x8B\\xD9"
// Handles for SDKCalls (unused)
//static Handle sdkVomitInfected = null;
//#define NAME_VomitInfected "CTerrorPlayer_OnHitByVomitJar"
//#define SIG_VomitInfected_LINUX "@_ZN13CTerrorPlayer15OnHitByVomitJarEP20CBaseCombatCharacter"
//#define SIG_VomitInfected_WINDOWS "\\x55\\x8B\\xEC\\x83\\xEC\\x2A\\x56\\x8B\\xF1\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x74\\x2A\\x8B\\x06\\x8B\\x90\\x2A\\x2A\\x2A\\x2A\\x8B\\xCE\\xFF\\xD2\\x84\\xC0\\x0F"
//static Handle sdkVomitSurvivor = null;
//#define NAME_VomitSurvivor "CTerrorPlayer_OnVomitedUpon"
//#define SIG_VomitSurvivor_LINUX "@_ZN13CTerrorPlayer13OnVomitedUponEPS_b"
//#define SIG_VomitSurvivor_WINDOWS "\\x55\\x8B\\xEC\\x83\\xEC\\x2A\\x53\\x56\\x57\\x8B\\xF1\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x74\\x2A\\x8B\\x06\\x8B"
//static Handle sdkShoveSurv = null;
#define NAME_ShoveSurv "CTerrorPlayer_OnStaggered"
#define SIG_ShoveSurv_LINUX "@_ZN13CTerrorPlayer11OnStaggeredEP11CBaseEntityPK6Vector"
#define SIG_ShoveSurv_WINDOWS "\\x53\\x8B\\xDC\\x83\\xEC\\x2A\\x83\\xE4\\xF0\\x83\\xC4\\x04\\x55\\x8B\\x6B\\x04\\x89\\x6C\\x24\\x04\\x8B\\xEC\\x83\\xEC\\x2A\\x56\\x57\\x8B\\xF1\\xE8\\x2A\\x2A\\x2A\\x2A\\x84\\xC0\\x0F\\x85\\x6E\\x08"
//static Handle sdkShoveInf = null;
#define NAME_ShoveInf "CTerrorPlayer_OnShovedBySurvivor"
#define SIG_ShoveInf_LINUX "@_ZN13CTerrorPlayer18OnShovedBySurvivorEPS_RK6Vector"
#define SIG_ShoveInf_WINDOWS "\\x55\\x8B\\xEC\\x81\\xEC\\x2A\\x2A\\x2A\\x2A\\xA1\\x2A\\x2A\\x2A\\x2A\\x33\\xC5\\x89\\x45\\xFC\\x53\\x8B\\x5D\\x08\\x56\\x57\\x8B\\x7D\\x0C\\x8B\\xF1"
//Cvars
#define CVAR_INCAPMAX "survivor_max_incapacitated_count"
TopMenu hTopMenu;
/*
*Offsets, Handles, Bools, Floats, Integers, Strings, Vecs and everything needed for the commands
*/
//Strings
//Integers
/* Refers to the last selected userid by the admin client index. Doesn't matter if the admins leaves and another using the same index gets in
* because if this admin uses the same menu item, the last userid will be reset.
*/
static int g_iCurrentUserId[MAXPLAYERS+1] = 0;
static int g_iLastGrabbedEntity[ARRAY_SIZE+1] = -1;
//Bools
static bool g_bVehicleReady = false;
static bool g_bStrike = false;
static bool g_bGnomeRain = false;
static bool g_bGrab[MAXPLAYERS+1] = false;
static bool g_bGrabbed[ARRAY_SIZE+1] = false;
//Floats
//Handles (old)
//static Handle sdkVomitInfected = null;
//static Handle sdkVomitSurvivor = null;
//static Handle sdkCallPushPlayer = null;
//static Handle sdkDetonateAcid = null;
//static Handle sdkAdrenaline = null;
//static Handle sdkSetBuffer = null;
//static Handle sdkRevive = null;
//static Handle sdkShoveSurv = null;
//static Handle sdkShoveInf = null;
//Vectors
//CVARS
static Handle g_cvarRadius = null;
static Handle g_cvarPower = null;
static Handle g_cvarDuration = null;
static Handle g_cvarRainDur = null;
static Handle g_cvarRainRadius = null;
static Handle g_cvarLog = null;
static Handle g_cvarAddType = null;
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
if (GetEngineVersion() == Engine_Left4Dead2)
{
return APLRes_Success;
}
strcopy(error, err_max, "Plugin only supports Left 4 Dead 2.");
return APLRes_SilentFailure;
}
//Plugin Info
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESC,
version = PLUGIN_VERSION,
url = PLUGIN_URL
}
public void OnPluginStart()
{
LogDebug("####### Initializing Plugin... #######");
LogDebug("Creating necessary ConVars...");
//Cvars
CreateConVar("l4d2_custom_commands_version", PLUGIN_VERSION, "Version of Custom Admin Commands Plugin", FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
g_cvarRadius = CreateConVar("l4d2_custom_commands_explosion_radius", "350", "创建爆炸命令的爆炸范围");
g_cvarPower = CreateConVar("l4d2_custom_commands_explosion_power", "350", "创建爆炸命令的爆炸推力");
g_cvarDuration = CreateConVar("l4d2_custom_commands_explosion_duration", "15", "创建爆炸命令的火焰持续时间");
g_cvarRainDur = CreateConVar("l4d2_custom_commands_rain_duration", "10", "侏儒雨命令的持续时间");
g_cvarRainRadius = CreateConVar("l4d2_custom_commands_rain_radius", "300", "侏儒雨/下雨命令的范围");
g_cvarLog = CreateConVar("l4d2_custom_commands_log", "1", "是否记录命令使用情况");
g_cvarAddType = CreateConVar("l4d2_custom_commands_menutype", "0", "命令菜单放在哪里.0=创建新的分组.1=附加到默认分组");
LogDebug("Registering all admin and console commands...");
//Commands
RegAdminCmd("sm_vomitplayer", CmdVomitPlayer, DESIRED_FLAGS, "Vomits the desired player");
RegAdminCmd("sm_incapplayer", CmdIncapPlayer, DESIRED_FLAGS, "Incapacitates a survivor or tank");
RegAdminCmd("sm_smackillplayer", CmdSmackillPlayer, DESIRED_FLAGS, "Smacks a player to death, sending their body flying.");
RegAdminCmd("sm_speedplayer", CmdSpeedPlayer, DESIRED_FLAGS, "Set a player's speed");
RegAdminCmd("sm_sethpplayer", CmdSetHpPlayer, DESIRED_FLAGS, "Set a player's health");
RegAdminCmd("sm_colorplayer", CmdColorPlayer, DESIRED_FLAGS, "Set a player's model color");
RegAdminCmd("sm_setexplosion", CmdSetExplosion, DESIRED_FLAGS, "Creates an explosion on your feet or where you are looking at");
RegAdminCmd("sm_pipeexplosion", CmdPipeExplosion, DESIRED_FLAGS, "Creates a pipebomb explosion on your feet or where you are looking at");
RegAdminCmd("sm_sizeplayer", CmdSizePlayer, DESIRED_FLAGS, "Resize a player's model (Most likely, their pants)");
RegAdminCmd("sm_norescue", CmdNoRescue, DESIRED_FLAGS, "Forces the rescue vehicle to leave");
RegAdminCmd("sm_dontrush", CmdDontRush, DESIRED_FLAGS, "Forces a player to re-appear in the starting safe zone");
RegAdminCmd("sm_changehp", CmdChangeHp, DESIRED_FLAGS, "Will switch a player's health between temporal or permanent");
RegAdminCmd("sm_airstrike", CmdAirstrike, DESIRED_FLAGS, "Will set an airstrike attack in the player's face");
RegAdminCmd("sm_gnomerain", CmdGnomeRain, DESIRED_FLAGS, "Will rain gnomes within your position");
RegAdminCmd("sm_gnomewipe", CmdGnomeWipe, DESIRED_FLAGS, "Will delete all the gnomes in the map");
RegAdminCmd("sm_godmode", CmdGodMode, DESIRED_FLAGS, "Will activate or deactivate godmode from player");
RegAdminCmd("sm_l4drain", CmdL4dRain, DESIRED_FLAGS, "Will rain left 4 dead 1 survivors");
RegAdminCmd("sm_colortarget", CmdColorTarget, DESIRED_FLAGS, "Will color the aiming target entity");
RegAdminCmd("sm_sizetarget", CmdSizeTarget, DESIRED_FLAGS, "Will size the aiming target entity");
RegAdminCmd("sm_shakeplayer", CmdShakePlayer, DESIRED_FLAGS, "Will shake a player screen during the desired amount of time");
RegAdminCmd("sm_charge", CmdCharge, DESIRED_FLAGS, "Will launch a survivor far away");
RegAdminCmd("sm_weaponrain", CmdWeaponRain, DESIRED_FLAGS, "Will rain the specified weapon");
RegAdminCmd("sm_cmdplayer", CmdConsolePlayer, DESIRED_FLAGS, "Will control a player's console");
RegAdminCmd("sm_bleedplayer", CmdBleedPlayer, DESIRED_FLAGS, "Will force a player to bleed");
//RegAdminCmd("sm_callrescue", CmdCallRescue, DESIRED_FLAGS, "Will call the rescue vehicle");
RegAdminCmd("sm_hinttext", CmdHintText, DESIRED_FLAGS, "Prints an instructor hint to all players");
RegAdminCmd("sm_cheat", CmdCheat, DESIRED_FLAGS, "Bypass any command and executes it. Rule: [command] [argument] EX: z_spawn tank");
RegAdminCmd("sm_wipeentity", CmdWipeEntity, DESIRED_FLAGS, "Wipe all entities with the given name");
RegAdminCmd("sm_setmodel", CmdSetModel, DESIRED_FLAGS, "Sets a player's model relavite to the models folder");
RegAdminCmd("sm_setmodelentity", CmdSetModelEntity, DESIRED_FLAGS, "Sets all entities model that match the given classname");
RegAdminCmd("sm_createparticle", CmdCreateParticle, DESIRED_FLAGS, "Creates a particle with the option to parent it");
RegAdminCmd("sm_ignite", CmdIgnite, DESIRED_FLAGS, "Ignites a survivor player");
RegAdminCmd("sm_teleport", CmdTeleport, DESIRED_FLAGS, "Teleports a player to your cursor position");
RegAdminCmd("sm_teleportent", CmdTeleportEnt, DESIRED_FLAGS, "Teleports all entities with the given classname to your cursor position");
RegAdminCmd("sm_rcheat", CmdCheatRcon, DESIRED_FLAGS, "Bypass any command and executes it on the server console");
RegAdminCmd("sm_scanmodel", CmdScanModel, DESIRED_FLAGS, "Scans the model of an entity, if possible");
RegAdminCmd("sm_grabentity", CmdGrabEntity, DESIRED_FLAGS, "Grabs any entity, if possible");
RegAdminCmd("sm_acidspill", CmdAcidSpill, DESIRED_FLAGS, "Spawns a spitter's acid spill on your the desired player");
RegAdminCmd("sm_adren", CmdAdren, DESIRED_FLAGS, "Gives a player the adrenaline effect");
RegAdminCmd("sm_temphp", CmdTempHp, DESIRED_FLAGS, "Sets a player temporary health into the desired value");
RegAdminCmd("sm_revive", CmdRevive, DESIRED_FLAGS, "Revives an incapacitated player");
RegAdminCmd("sm_oldmovie", CmdOldMovie, DESIRED_FLAGS, "Sets a player into black and white");
RegAdminCmd("sm_panic", CmdPanic, DESIRED_FLAGS, "Forces a panic event");
RegAdminCmd("sm_shove", CmdShove, DESIRED_FLAGS, "Shoves a player");
//Development
RegAdminCmd("sm_entityinfo", CmdEntityInfo, DESIRED_FLAGS, "Returns the aiming entity classname");
RegAdminCmd("sm_ccrefresh", CmdCCRefresh, DESIRED_FLAGS, "Refreshes the menu items");
RegAdminCmd("sm_cchelp", CmdHelp, DESIRED_FLAGS, "Prints the entire list of commands");
LogDebug("Hooking events...");
//Events
HookEvent("round_end", OnRoundEnd);
HookEvent("finale_vehicle_ready", OnVehicleReady);
LogDebug("Loading Translations");
//Translations
LoadTranslations("common.phrases");
LogDebug("Preparing necessary calls...");
//SDKCalls
GetGamedata();
/*g_hGameConf = LoadGameConfigFile("l4d2customcmds");
if (g_hGameConf == null)
{
SetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
}*/
LogDebug("Addin commands to the topmenu (Admin Menu)");
TopMenu topmenu;
if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != null))
{
OnAdminMenuReady(topmenu);
}
LogDebug("####### Plugin is ready #######");
}
public void OnMapStart()
{
LogDebug("Map started, precaching sounds and particles");
PrecacheSound(EXPLOSION_SOUND);
PrecacheSound(EXPLOSION_SOUND2);
PrecacheSound(EXPLOSION_SOUND3);
PrecacheModel(ZOEY_MODEL);
PrecacheModel(LOUIS_MODEL);
PrecacheModel(FRANCIS_MODEL);
PrecacheModel("sprites/muzzleflash4.vmt");
PrefetchSound(EXPLOSION_SOUND);
PrefetchSound(EXPLOSION_SOUND2);
PrefetchSound(EXPLOSION_SOUND3);
PrecacheParticle(FIRE_PARTICLE);
PrecacheParticle(EXPLOSION_PARTICLE);
PrecacheParticle(EXPLOSION_PARTICLE2);
PrecacheParticle(EXPLOSION_PARTICLE3);
PrecacheParticle(BURN_IGNITE_PARTICLE);
LogDebug("Done precaching sounds and particles");
}
public void OnMapEnd()
{
LogDebug("Map end, resetting variables");
g_bVehicleReady = false;
for (int i = 1; i <= MaxClients; i++)
{
g_bGrab[i] = false;
}
for (int i = MaxClients+1; i < ARRAY_SIZE; i++)
{
g_iLastGrabbedEntity[i] = -1;
g_bGrabbed[i] = false;
}
}
Action CmdCCRefresh(int client, any args)
{
LogDebug("Refreshing the admin menu");
PrintToChat(client, "[SM] Refreshing the admin menu...");
TopMenu topmenu = GetAdminTopMenu();
AddMenuItems(topmenu);
return Plugin_Handled;
}
Action CmdHelp(int client, any args)
{
PrintToChat(client, "\x03********************** Custom Commands List **********************");
PrintToChat(client, "- \"sm_vomitplayer\": Vomits the desired player (Usage: sm_vomitplayer <#userid|name>) | Example: !vomitplayer @me");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_incapplayer\": Incapacitates a survivor or tank (Usage: sm_incapplayer <#userid|name> | Example: !incapplayer @me)");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_speedplayer\": Set a player's speed (Usage: sm_speedplayer <#userid|name> <value>) | Example: !speedplayer @me 1.5");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_sethpplayer\": Set a player's health (Usage: sm_sethpplayer <#userid|name> <amount>) | Example: !sethpplayer @me 50");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_colorplayer\": Set a player's model color (Usage: sm_colorplayer <#userid|name> <R G B A>) | Example: !colorplayer @me \"24 34 38 0\"");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_setexplosion\": Creates an explosion on your feet or where you are looking at (Usage: sm_setexplosion <position |cursor>) | Example: !setexplosion position");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_sizeplayer\": Resize a player's model scale (Usage: sm_sizeplayer <#userid|name> <value>) | Example: !sizeplayer @me 0.1");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_norescue\": Forces the rescue vehicle to leave | Example: !norescue");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_dontrush\": Forces a player to re-appear in the starting safe zone (Usage: sm_dontrush <#userid|name>) | Example: !dontrush RusherName");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_changehp\": Will switch a player's health between temporal or permanent (Usage: sm_changehp <#userid|name> <perm|temp>) | Example: !changehp @me perm");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_airstrike\": Will send an airstrike attack to the target (Usage: sm_airstrike <#userid|name>) | Example: !airstrike @me");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_gnomerain\": Will rain gnomes within your position | Example: !gnomerain");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_gnomewipe\": Will delete all the gnomes in the map | Example: !gnomewipe");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_godmode\": Will activate or deactivate godmode from player (Usage: sm_godmode <#userid|name>) | Example: !godmode @me");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_l4drain\": Will rain left 4 dead 1 survivors | Example: !l4drain");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_colortarget\": Will change the color of the aiming target entity (Usage: sm_colortarget <R G B A>) | Example: !colortarget \"43 55 255 179\"");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_sizetarget\": Will re-size the aiming target entity (Usage: sm_sizetarget <value>) | Example: !sizetarget 5.0");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_shakeplayer\": Will shake a player screen during the desired amount of time (Usage: sm_shake <#userid|name> <duration>) | Example: !shakeplayer @me 5");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_charge\": Will launch a survivor far away (Usage: sm_charge <#userid|name>) | Example: !charge Coach");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_weaponrain\": Will rain the specified weapon (Usage: sm_weaponrain <weapon name>) | Example: !weaponrain adrenaline");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_cmdplayer\": Will control a player's console (Usage: sm_cmdplayer <#userid|name> <command>) | Example: !cmdplayer PlayerName \"+forward\"");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_bleedplayer\": Will force a player to bleed (Usage: sm_bleedplayer <#userid|name> <duration>) | Example: !bleedplayer @me 7");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_hinttext\": Prints an instructor hint to all players (Usage: sm_hinttext <hint>) | Example: !hinttext \"This is a hint text message\"");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_cheat\": Bypass any command and executes it (Usage: sm_cheat <command> <arguments>*) | Example: !cheat z_spawn \"tank auto\"");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_wipeentity\": Wipe all entities with the given classname (Usage: !wipeentity <classname>) | Example: !wipeentity infected");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_setmodel\": Sets a player's model relative to the models folder (Usage: sm_setmodel <#userid|name> <model>) | Example: !setmodel @me models/props_interiors/table_bedside.mdl");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_setmodelentity\": Sets all entities model that match the given classname (Usage: sm_setmodelentity <classname> <model>) | Example: !setmodelentity infected models/props_interiors/table_bedside.mdl");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_createparticle\": Creates a particle with the option to parent it (Usage: sm_createparticle <#userid|name> <particle> <parent: yes|no> <duration> Example: !createparticle @me ParticleName no 5");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_ignite\": Ignites a survivor player (Usage: sm_ignite <#userid|name> <duration>) | Example: !ignite @me 4");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_teleport\": Teleports a player to your cursor position (Usage: sm_teleport <#userid|name>) | Example: !teleport Coach");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_teleportent\": Teleports all entities with the given classname to your cursor position (Usage: sm_teleportent <classname>) | Example: !teleportent weapon_adrenaline");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_rcheat\": Bypass any command and executes it on the server console (Usage: sm_rcheat <command>) | Example: !rcheat director_stop");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_scanmodel\": Scans the model of an aiming entity, if possible | Example: !scanmodel");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_grabentity\": Grabs an aiming entity, if possible | Example: !grabentity");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_acidspill\": Spawns a spitter's acid spill on your the desired player (Usage: sm_acidspill <#userid|name>) | Example: !acidspill @me");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_adren\": Gives a player the adrenaline effect (Usage: sm_adren <#userid|name>) | Example: !adren Nick");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_temphp\": Sets a player temporary health into the desired value (Usage: sm_temphp <#userid|name> <amount>) | Example: !temphp Rochelle 50");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_revive\": Revives an incapacitated player (Usage: sm_revive <#userid|name>) | Example: !revive Coach");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_oldmovie\": Sets a player into black and white (Usage: sm_oldmovie <#userid|name>) | Example: !oldmovie @me");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_panic\": Forces a panic event, ignoring the director | Example: !panic");
PrintToChat(client, " ");
PrintToChat(client, "- \"sm_shove\": Shoves a player (Usage: sm_shove <#userid|name>) | Example: !shove @all");
PrintToChat(client, " ");
PrintToChat(client, " ");
PrintToChat(client, "\x04*: Optional argument");
PrintToChat(client, "\x03[SM] Open your console to check the command list");
return Plugin_Handled;
}
//**********************************EVENTS*******************************************
void OnVehicleReady(Handle event, const char[] event_name, bool dontBroadcast)
{
g_bVehicleReady = true;
}
void OnRoundEnd(Handle event, const char[] event_name, bool dontBroadcast)
{
g_bVehicleReady = false;
}
//*********************************COMMANDS*******************************************
Action CmdVomitPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_vomitplayer <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
/*char target_name[MAX_TARGET_LENGTH];
int target_list[MAXPLAYERS], target_count; bool tn_is_ml;
if ((target_count = ProcessTargetString(
arg,
client,
target_list,
MAXPLAYERS,
COMMAND_FILTER_ALIVE,
target_name,
sizeof(target_name),
tn_is_ml)) <= 0)
{
ReplyToTargetError(client, target_count);
return Plugin_Handled;
}*/
//int target_list[MAXPLAYERS], target_count;
//Cmd_GetTargets(client, arg, target_list, target_count);
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
VomitPlayer(target_list[i], client);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Vomit Player' command on '%s'", name, arg);
return Plugin_Handled;
}
Action CmdIncapPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_incapplayer <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
IncapPlayer(target_list[i], client);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Incap Player' command on '%s'", name, arg);
return Plugin_Handled;
}
Action CmdSmackillPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_smackillplayer <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
SmackillPlayer(target_list[i], client);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Smackill Player' command on '%s'", name, arg);
return Plugin_Handled;
}
Action CmdSpeedPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 2)
{ PrintToChat(client, "[SM] Usage: sm_speedplayer <#userid|name> [value]"); return Plugin_Handled; }
char arg[65], arg2[65]; float speed;
GetCmdArg(1, arg, sizeof(arg));
GetCmdArg(2, arg2, sizeof(arg2));
speed = StringToFloat(arg2);
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
ChangeSpeed(target_list[i], client, speed);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Speed Player' command on '%s' with value <%f>", name, arg, speed);
return Plugin_Handled;
}
Action CmdSetHpPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 2)
{ PrintToChat(client, "[SM] Usage: sm_sethpplayer <#userid|name> [amount]"); return Plugin_Handled; }
char arg[65], arg2[65];
GetCmdArg(1, arg, sizeof(arg));
GetCmdArg(2, arg2, sizeof(arg2));
int health = StringToInt(arg2);
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
SetHealth(target_list[i], client, health);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Set Heealth' command on '%s' with value <%i>", name, arg, health);
return Plugin_Handled;
}
Action CmdColorPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 2)
{ PrintToChat(client, "[SM] Usage: sm_colorplayer <#userid|name> [R G B A]"); return Plugin_Handled; }
char arg[65], arg2[65];
GetCmdArg(1, arg, sizeof(arg));
GetCmdArg(2, arg2, sizeof(arg2));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
ChangeColor(target_list[i], client, arg2);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Speed Player' command on '%s' with value '%s'", name, arg, arg2);
return Plugin_Handled;
}
Action CmdColorTarget(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_colortarget [R G B A]"); return Plugin_Handled; }
int target = GetClientAimTarget(client, false);
if (!IsValidEntity(target))
{ PrintToChat(client, "[SM] Invalid entity or looking to nothing"); }
char arg[256];
GetCmdArg(1, arg, sizeof(arg));
DispatchKeyValue(target, "rendercolor", arg);
DispatchKeyValue(target, "color", arg);
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Colot Target' command", name);
return Plugin_Handled;
}
Action CmdSizeTarget(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_sizetarget [scale]"); return Plugin_Handled; }
int target = GetClientAimTarget(client, false);
if (!IsValidEntity(target))
{ PrintToChat(client, "[SM] Invalid entity or looking to nothing"); return Plugin_Handled; }
char arg[256];
GetCmdArg(1, arg, sizeof(arg));
float scale = StringToFloat(arg);
SetEntPropFloat(target, Prop_Send, "m_flModelScale", scale);
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Size Target' command", name);
return Plugin_Handled;
}
Action CmdSetExplosion(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1 || args > 1)
{ PrintToChat(client, "[SM] Usage: sm_setexplosion [position | cursor]"); return Plugin_Handled; }
bool isSuccessful = false;
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
if (StrContains(arg, "position", false) != -1)
{
float pos[3];
GetClientAbsOrigin(client, pos);
CreateExplosion(pos);
isSuccessful = true;
}
else if (StrContains(arg, "cursor", false) != -1)
{
/*float VecOrigin[3], VecAngles[3];
GetClientEyePosition(client, VecOrigin);
GetClientEyeAngles(client, VecAngles);
TR_TraceRayFilter(VecOrigin, VecAngles, MASK_OPAQUE, RayType_Infinite, TraceRayDontHitSelf, client);
if (TR_DidHit(null))
{ TR_GetEndPosition(VecOrigin); }
else
{ PrintToChat(client, "Vector out of world geometry. Exploding on origin instead"); }*/
float VecOrigin[3];
DoClientTrace(client, MASK_OPAQUE, true, VecOrigin);
CreateExplosion(VecOrigin);
isSuccessful = true;
}
if (isSuccessful)
{ LogCommand("'%N' used the 'Set Explosion' command", client); }
else
{ PrintToChat(client, "[SM] Specify the explosion position"); }
return Plugin_Handled;
}
Action CmdPipeExplosion(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1 || args > 1)
{ PrintToChat(client, "[SM] Usage: sm_pipeexplosion [position | cursor]"); return Plugin_Handled; }
bool isSuccessful = false;
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
if (StrContains(arg, "position", false) != -1)
{
float pos[3];
GetClientAbsOrigin(client, pos);
PipeExplosion(client, pos);
isSuccessful = true;
}
else if (StrContains(arg, "cursor", false) != -1)
{
/*float VecOrigin[3], VecAngles[3];
GetClientEyePosition(client, VecOrigin);
GetClientEyeAngles(client, VecAngles);
TR_TraceRayFilter(VecOrigin, VecAngles, MASK_OPAQUE, RayType_Infinite, TraceRayDontHitSelf, client);
if (TR_DidHit(null))
{ TR_GetEndPosition(VecOrigin); }
else
{ PrintToChat(client, "Vector out of world geometry. Exploding on origin instead"); }*/
float VecOrigin[3];
DoClientTrace(client, MASK_OPAQUE, true, VecOrigin);
PipeExplosion(client, VecOrigin);
isSuccessful = true;
}
if (isSuccessful)
{ LogCommand("'%N' used the 'Pipe Explosion' command", client); }
else
{ PrintToChat(client, "[SM] Specify the explosion position"); }
return Plugin_Handled;
}
Action CmdSizePlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 2)
{ PrintToChat(client, "[SM] Usage: sm_sizeplayer <#userid|name> [value]"); return Plugin_Handled; }
char arg[65], arg2[65]; float scale;
GetCmdArg(1, arg, sizeof(arg));
GetCmdArg(2, arg2, sizeof(arg2));
scale = StringToFloat(arg2);
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
ChangeScale(target_list[i], client, scale);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Scale Player' command on '%s' with value <%f>", name, arg, scale);
return Plugin_Handled;
}
Action CmdNoRescue(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (g_bVehicleReady)
{
char map[32];
GetCurrentMap(map, sizeof(map));
if (StrEqual(map, "c1m4_atrium"))
{
CheatCommand(client, "ent_fire", "relay_car_escape trigger");
CheatCommand(client, "ent_fire", "car_camera enable");
EndGame();
}
else if (StrEqual(map, "c2m5_concert"))
{
CheatCommand(client, "ent_fire", "stadium_exit_left_chopper_prop setanimation exit2");
CheatCommand(client, "ent_fire", "stadium_exit_left_outro_camera enable");
EndGame();
}
else if (StrEqual(map, "c3m4_plantation"))
{
CheatCommand(client, "ent_fire", "camera_outro setparentattachment attachment_cam");
CheatCommand(client, "ent_fire", "escape_boat_prop setanimation c3m4_outro_boat");
CheatCommand(client, "ent_fire", "camera_outro enable");
EndGame();
}
else if (StrEqual(map, "c4m5_milltown_escape"))
{
CheatCommand(client, "ent_fire", "model_boat setanimation c4m5_outro_boat");
CheatCommand(client, "ent_fire", "camera_outro setparent model_boat");
CheatCommand(client, "ent_fire", "camera_outro setparentattachment attachment_cam");
EndGame();
}
else if (StrEqual(map, "c5m5_bridge"))
{
CheatCommand(client, "ent_fire", "heli_rescue setanimation 4lift");
CheatCommand(client, "ent_fire", "camera_outro enable");
EndGame();
}
else if (StrEqual(map, "c6m3_port"))
{
CheatCommand(client, "ent_fire", "outro_camera_1 setparentattachment Attachment_1");
CheatCommand(client, "ent_fire", "car_dynamic Disable");
CheatCommand(client, "ent_fire", "car_outro_dynamic enable");
CheatCommand(client, "ent_fire", "ghostanim_outro enable");
CheatCommand(client, "ent_fire", "ghostanim_outro setanimation c6m3_outro");
CheatCommand(client, "ent_fire", "car_outro_dynamic setanimation c6m3_outro_charger");
CheatCommand(client, "ent_fire", "outro_camera_1 enable");
CheatCommand(client, "ent_fire", "c6m3_escape_music playsound");
EndGame();
}
else
{
PrintToChat(client, "[SM] This map doesn't have a rescue vehicle or is not supported!");
}
}
else
{ PrintToChat(client, "[SM] Wait for the rescue vehicle to be ready first!"); }
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%N' used the 'No Rescue' command", client);
return Plugin_Handled;
}
Action CmdDontRush(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_dontrush <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
TeleportBack(target_list[i], client);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Anti Rush' command on '%s'", name, arg);
return Plugin_Handled;
}
/*Action CmdBugPlayer(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_bugplayer <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
AcceptEntityInput(target_list[i], "becomeragdoll");
}
return Plugin_Handled;
}*/
/*Action CmdDestroyPlayer(int client, any args)
{
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_destroyplayer <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
LaunchMissile(target_list[i], client);
}
char name[256];
int target;
for(int i = 1; i <= MaxClients; i++)
{
if (Cmd_CheckClient(i, -1, false, -1, false))
{
GetClientName(i, name, sizeof(name));
if (StrEqual(name, arg))
{
target = i;
}
}
}
LaunchMissile(target, client);
return Plugin_Handled;
}
*/
Action CmdAirstrike(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_airstrike <#userid|name>"); return Plugin_Handled; }
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
Airstrike(target_list[i]);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Airstrike' command on '%s'", name, arg);
return Plugin_Handled;
}
Action CmdOldMovie(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{
PrintToChat(client, "[SM] Usage: sm_oldmovie <#userid|name>");
return Plugin_Handled;
}
char arg[65];
GetCmdArg(1, arg, sizeof(arg));
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
BlackAndWhite(target_list[i], client);
SetEntityHealth(target_list[i], 1);
SetTempHealth(target_list[i], 50.0);
}
return Plugin_Handled;
}
Action CmdChangeHp(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
if (args < 1)
{ PrintToChat(client, "[SM] Usage: sm_changehp <#userid|name> [perm | temp]"); return Plugin_Handled; }
char arg[65], arg2[65];
int type = 0;
GetCmdArg(1, arg, sizeof(arg));
GetCmdArg(2, arg2, sizeof(arg2));
if (StrEqual(arg2, "perm"))
{ type = 1; }
else if (StrEqual(arg2, "temp"))
{ type = 2; }
if (type <= 0 || type > 2)
{ PrintToChat(client, "[SM] Specify the health style you want"); return Plugin_Handled; }
int target_list[MAXPLAYERS];
int target_count = Cmd_GetTargets(client, arg, target_list);
for (int i = 0; i < target_count; i++)
{
SwitchHealth(target_list[i], client, type);
}
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Change Health Type' command on '%s' with value <%s>", name, arg, arg2);
return Plugin_Handled;
}
Action CmdGnomeRain(int client, any args)
{
if (!Cmd_CheckClient(client, client, false, -1, true)) return Plugin_Handled;
char name[256];
GetClientName(client, name, sizeof(name));
LogCommand("'%s' used the 'Gnome Rain' command");
StartGnomeRain(client);
return Plugin_Handled;
}
Action CmdL4dRain(int client, any args)
{