Added support for panic spawn

This commit is contained in:
Jackzie 2020-02-18 19:22:11 -06:00
parent ef4c0ee212
commit aeb263064d
2 changed files with 24 additions and 12 deletions

Binary file not shown.

View file

@ -75,7 +75,11 @@ public Action Command_SpawnSpecial(int client, int args) {
} else if (StrEqual(arg1, "tank", false) && !g_cMdEnableTank.BoolValue) { } else if (StrEqual(arg1, "tank", false) && !g_cMdEnableTank.BoolValue) {
ReplyToCommand(client, "[SM] Spawning tanks has been disabled."); ReplyToCommand(client, "[SM] Spawning tanks has been disabled.");
} else { } else {
CheatCommand(executioner, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1, "auto"); if(StrEqual(arg1,"panic",false)) {
CheatCommand(executioner, "director_force_panic_event", "", "");
}else{
CheatCommand(executioner, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1, "auto");
}
if (g_cMdNotify.BoolValue) { if (g_cMdNotify.BoolValue) {
ReplyToCommand(client, "[SM] Director will now attempt to spawn a %s.", arg1); ReplyToCommand(client, "[SM] Director will now attempt to spawn a %s.", arg1);
} }
@ -92,12 +96,16 @@ public Action Command_SpawnSpecialForceLocal(int client, int args) {
if (args < 1) { if (args < 1) {
ReplyToCommand(client, "[SM] Usage: sm_forcecursor <hunter|smoker|boomer|spitter|charger|jockey|mob> - Requests a special to spawn at cursor", arg1); ReplyToCommand(client, "[SM] Usage: sm_forcecursor <hunter|smoker|boomer|spitter|charger|jockey|mob> - Requests a special to spawn at cursor", arg1);
} else { } else {
int bot = CreateFakeClient("ManualDirectorBot"); if(StrEqual(arg1,"panic",false)) {
if (bot != 0) { CheatCommand(client, "director_force_panic_event", "", "");
ChangeClientTeam(bot, 3); }else{
CreateTimer(0.1, kickbot, bot); int bot = CreateFakeClient("ManualDirectorBot");
} if (bot != 0) {
CheatCommand(client, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1,""); ChangeClientTeam(bot, 3);
CreateTimer(0.1, kickbot, bot);
}
CheatCommand(client, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1,"");
}
if (g_cMdNotify.BoolValue) { if (g_cMdNotify.BoolValue) {
ReplyToCommand(client, "[SM] Spawned a %s.", arg1); ReplyToCommand(client, "[SM] Spawned a %s.", arg1);
} }
@ -117,12 +125,16 @@ public Action Command_SpawnSpecialForce(int client, int args) {
if (executioner <= 0) { if (executioner <= 0) {
ReplyToCommand(client, "[SM] Cannot spawn a %s as there are no players online.", arg1); ReplyToCommand(client, "[SM] Cannot spawn a %s as there are no players online.", arg1);
} else { } else {
int bot = CreateFakeClient("ManualDirectorBot"); if(StrEqual(arg1,"panic",false)) {
if (bot != 0) { CheatCommand(executioner, "director_force_panic_event", "", "");
ChangeClientTeam(bot, 3); }else{
CreateTimer(0.1, kickbot, bot); int bot = CreateFakeClient("ManualDirectorBot");
if (bot != 0) {
ChangeClientTeam(bot, 3);
CreateTimer(0.1, kickbot, bot);
}
CheatCommand(executioner, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1, "auto");
} }
CheatCommand(executioner, g_bMdIsL4D2 ? "z_spawn_old" : "z_spawn", arg1, "auto");
if (g_cMdNotify.BoolValue) { if (g_cMdNotify.BoolValue) {
ReplyToCommand(client, "[SM] Spawned a %s.", arg1); ReplyToCommand(client, "[SM] Spawned a %s.", arg1);
} }