1.1 --- a/plugins/basefuncommands.sp Tue Dec 18 21:03:34 2007 +0000
1.2 +++ b/plugins/basefuncommands.sp Wed Dec 19 01:16:15 2007 +0000
1.3 @@ -49,24 +49,58 @@
1.4
1.5 new Handle:hTopMenu = INVALID_HANDLE;
1.6
1.7 -new g_SlapDamage[MAXPLAYERS+1];
1.8 -new bool:g_cstrike = false;
1.9 +// Sounds
1.10 +#define SOUND_BLIP "buttons/blip1.wav"
1.11 +#define SOUND_BEEP "buttons/button17.wav"
1.12 +#define SOUND_FINAL "weapons/cguard/charging.wav"
1.13 +#define SOUND_BOOM "weapons/explode3.wav"
1.14 +#define SOUND_FREEZE "physics/glass/glass_impact_bullet4.wav"
1.15 +
1.16 +// Following are model indexes for temp entities
1.17 +new g_BeamSprite;
1.18 +new g_BeamSprite2;
1.19 +new g_HaloSprite;
1.20 +new g_GlowSprite;
1.21 +new g_ExplosionSprite;
1.22
1.23 -#include "basefuncommands/slay.sp"
1.24 -#include "basefuncommands/burn.sp"
1.25 -#include "basefuncommands/slap.sp"
1.26 +// Basic color arrays for temp entities
1.27 +new redColor[4] = {255, 75, 75, 255};
1.28 +new orangeColor[4] = {255, 128, 0, 255};
1.29 +new greenColor[4] = {75, 255, 75, 255};
1.30 +new blueColor[4] = {75, 75, 255, 255};
1.31 +new whiteColor[4] = {255, 255, 255, 255};
1.32 +new greyColor[4] = {128, 128, 128, 255};
1.33 +
1.34 +// Used for some trace rays.
1.35 +/*
1.36 +new g_FilteredEntity = -1;
1.37 +public bool:TR_Filter_Client(ent, contentMask)
1.38 +{
1.39 + return (ent == g_FilteredEntity) ? false : true;
1.40 +}
1.41 +*/
1.42 +
1.43 +// Include various commands and supporting functions
1.44 #include "basefuncommands/beacon.sp"
1.45 +#include "basefuncommands/timebomb.sp"
1.46 +#include "basefuncommands/fire.sp"
1.47 +#include "basefuncommands/ice.sp"
1.48
1.49 public OnPluginStart()
1.50 {
1.51 LoadTranslations("common.phrases");
1.52 LoadTranslations("basefuncommands.phrases");
1.53
1.54 - RegAdminCmd("sm_burn", Command_Burn, ADMFLAG_SLAY, "sm_burn <#userid|name> [time]");
1.55 - RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
1.56 - RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
1.57 - RegAdminCmd("sm_beacon", Command_Beacon, ADMFLAG_SLAY, "sm_beacon <#userid|name>");
1.58 RegAdminCmd("sm_play", Command_Play, ADMFLAG_GENERIC, "sm_play <#userid|name> <filename>");
1.59 +
1.60 + HookEvent("round_end", Event_RoundEnd, EventHookMode_PostNoCopy);
1.61 +
1.62 + SetupBeacon(); // sm_beacon
1.63 + SetupTimeBomb(); // sm_timebomb
1.64 + SetupFire(); // sm_burn and sm_firebomb
1.65 + SetupIce(); // sm_freeze and sm_freezebomb
1.66 +
1.67 + AutoExecConfig(true, "funcommands");
1.68
1.69 /* Account for late loading */
1.70 new Handle:topmenu;
1.71 @@ -74,24 +108,39 @@
1.72 {
1.73 OnAdminMenuReady(topmenu);
1.74 }
1.75 -
1.76 - decl String:folder[64];
1.77 - GetGameFolderName(folder, sizeof(folder));
1.78 -
1.79 - if (strcmp(folder, "cstrike") == 0)
1.80 - {
1.81 - g_cstrike = true;
1.82 - }
1.83 }
1.84
1.85 public OnMapStart()
1.86 {
1.87 - SetupBeacon();
1.88 + PrecacheSound(SOUND_BLIP, true);
1.89 + PrecacheSound(SOUND_BEEP, true);
1.90 + PrecacheSound(SOUND_FINAL, true);
1.91 + PrecacheSound(SOUND_BOOM, true);
1.92 + PrecacheSound(SOUND_FREEZE, true);
1.93 +
1.94 + g_BeamSprite = PrecacheModel("materials/sprites/laser.vmt");
1.95 + g_BeamSprite2 = PrecacheModel("sprites/bluelight1.vmt");
1.96 + g_HaloSprite = PrecacheModel("materials/sprites/halo01.vmt");
1.97 + g_GlowSprite = PrecacheModel("sprites/blueglow2.vmt");
1.98 + g_ExplosionSprite = PrecacheModel("sprites/sprite_fire01.vmt");
1.99 }
1.100
1.101 public OnMapEnd()
1.102 {
1.103 KillAllBeacons();
1.104 + KillAllTimeBombs();
1.105 + KillAllFireBombs();
1.106 + KillAllFreezes();
1.107 +}
1.108 +
1.109 +public Action:Event_RoundEnd(Handle:event,const String:name[],bool:dontBroadcast)
1.110 +{
1.111 + KillAllBeacons();
1.112 + KillAllTimeBombs();
1.113 + KillAllFireBombs();
1.114 + KillAllFreezes();
1.115 +
1.116 + return Plugin_Handled;
1.117 }
1.118
1.119 public OnAdminMenuReady(Handle:topmenu)
1.120 @@ -111,13 +160,13 @@
1.121 if (player_commands != INVALID_TOPMENUOBJECT)
1.122 {
1.123 AddToTopMenu(hTopMenu,
1.124 - "sm_slay",
1.125 + "sm_beacon",
1.126 TopMenuObject_Item,
1.127 - AdminMenu_Slay,
1.128 + AdminMenu_Beacon,
1.129 player_commands,
1.130 - "sm_slay",
1.131 + "sm_beacon",
1.132 ADMFLAG_SLAY);
1.133 -
1.134 +
1.135 AddToTopMenu(hTopMenu,
1.136 "sm_burn",
1.137 TopMenuObject_Item,
1.138 @@ -127,20 +176,36 @@
1.139 ADMFLAG_SLAY);
1.140
1.141 AddToTopMenu(hTopMenu,
1.142 - "sm_slap",
1.143 + "sm_freeze",
1.144 TopMenuObject_Item,
1.145 - AdminMenu_Slap,
1.146 + AdminMenu_Freeze,
1.147 player_commands,
1.148 - "sm_slap",
1.149 + "sm_freeze",
1.150 + ADMFLAG_SLAY);
1.151 +
1.152 + AddToTopMenu(hTopMenu,
1.153 + "sm_timebomb",
1.154 + TopMenuObject_Item,
1.155 + AdminMenu_TimeBomb,
1.156 + player_commands,
1.157 + "sm_timebomb",
1.158 ADMFLAG_SLAY);
1.159
1.160 AddToTopMenu(hTopMenu,
1.161 - "sm_beacon",
1.162 + "sm_firebomb",
1.163 TopMenuObject_Item,
1.164 - AdminMenu_Beacon,
1.165 + AdminMenu_FireBomb,
1.166 player_commands,
1.167 - "sm_beacon",
1.168 - ADMFLAG_SLAY);
1.169 + "sm_firebomb",
1.170 + ADMFLAG_SLAY);
1.171 +
1.172 + AddToTopMenu(hTopMenu,
1.173 + "sm_freezebomb",
1.174 + TopMenuObject_Item,
1.175 + AdminMenu_FreezeBomb,
1.176 + player_commands,
1.177 + "sm_freezebomb",
1.178 + ADMFLAG_SLAY);
1.179 }
1.180 }
1.181
1.182 @@ -196,7 +261,7 @@
1.183 for (new i = 0; i < target_count; i++)
1.184 {
1.185 ClientCommand(target_list[i], "playgamesound \"%s\"", Arguments[len]);
1.186 - LogAction(client, target_list[i], "\"%L\" played sound on \"%L\" (file \"%s\")", client, target_list[i], Arguments[len]);
1.187 + LogAction(client, target_list[i], "\"%L\" played sound on \"%L\" (file \"%s\")", client, target_list[i], Arguments[len]);
1.188 }
1.189
1.190 if (tn_is_ml)