mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-08 19:03:21 +00:00
Troll changes
This commit is contained in:
parent
2013d0c7bc
commit
71889d6788
7 changed files with 149 additions and 45 deletions
|
@ -4,7 +4,7 @@
|
||||||
//Allow MAX_TROLLS to be defined elsewhere
|
//Allow MAX_TROLLS to be defined elsewhere
|
||||||
#if defined MAX_TROLLS
|
#if defined MAX_TROLLS
|
||||||
#else
|
#else
|
||||||
#define MAX_TROLLS 38
|
#define MAX_TROLLS 40
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum trollModifier {
|
enum trollModifier {
|
||||||
|
@ -362,6 +362,17 @@ void ApplyTroll(int victim, const char[] name, int activator, trollModifier modi
|
||||||
LogAction(activator, victim, "\"%L\" deactivated \"%s\" on \"%L\"", activator, troll.name, victim);
|
LogAction(activator, victim, "\"%L\" deactivated \"%s\" on \"%L\"", activator, troll.name, victim);
|
||||||
} else {
|
} else {
|
||||||
static char flagName[MAX_TROLL_FLAG_LENGTH];
|
static char flagName[MAX_TROLL_FLAG_LENGTH];
|
||||||
|
flagName[0] = '\0';
|
||||||
|
for(int i = 0; i < 32; i++) {
|
||||||
|
if(flags & (1 << i)) {
|
||||||
|
// If at least one flag already, reset to none:
|
||||||
|
if(flagName[0] != '\0') {
|
||||||
|
flagName[0] = '\0';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
troll.GetFlagName(i, flagName, sizeof(flagName));
|
||||||
|
}
|
||||||
|
}
|
||||||
if(flags > 0 && flags & flags - 1 == 0 && flags & flags + 1 == 0) {
|
if(flags > 0 && flags & flags - 1 == 0 && flags & flags + 1 == 0) {
|
||||||
// Get the flag name if there is only one flag set
|
// Get the flag name if there is only one flag set
|
||||||
troll.GetFlagName(GetIndexFromPower(flags), flagName, sizeof(flagName));
|
troll.GetFlagName(GetIndexFromPower(flags), flagName, sizeof(flagName));
|
||||||
|
|
|
@ -90,6 +90,11 @@ public void OnClientAuthorized(int client, const char[] auth) {
|
||||||
if(!IsFakeClient(client)) {
|
if(!IsFakeClient(client)) {
|
||||||
strcopy(steamids[client], 64, auth);
|
strcopy(steamids[client], 64, auth);
|
||||||
}
|
}
|
||||||
|
for(int i = 1; i <= MAX_TROLLS; i++) {
|
||||||
|
if(Trolls[i].IsActive(client) && Trolls[i].HasMod(TrollMod_Constant)) { //Add activeFlagClients >= 0 check possibly?
|
||||||
|
ApplyAffect(client, Trolls[i], -1, TrollMod_Constant, Trolls[i].activeFlagClients[client]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
|
public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
|
||||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||||
|
@ -150,17 +155,13 @@ public void Event_CarAlarm(Event event, const char[] name, bool dontBroadcast) {
|
||||||
int client = GetClientOfUserId(user);
|
int client = GetClientOfUserId(user);
|
||||||
if(client) {
|
if(client) {
|
||||||
PrintToChatAll("%N has alerted the horde!", client);
|
PrintToChatAll("%N has alerted the horde!", client);
|
||||||
CreateTimer(0.5, RushPlayer, user);
|
CreateTimer(0.2, RushPlayer, user);
|
||||||
|
CreateTimer(0.6, RushPlayer, user);
|
||||||
|
CreateTimer(1.5, RushPlayer, user);
|
||||||
}
|
}
|
||||||
//Ignore car alarms for autopunish
|
//Ignore car alarms for autopunish
|
||||||
lastButtonUser = -1;
|
lastButtonUser = -1;
|
||||||
}
|
}
|
||||||
public void Event_EnteredSpit(Event event, const char[] name, bool dontBroadcast) {
|
|
||||||
int client = GetClientOfUserId(event.GetInt("userid"));
|
|
||||||
if(client) {
|
|
||||||
g_iInSpit[client] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Action RushPlayer(Handle h, int user) {
|
public Action RushPlayer(Handle h, int user) {
|
||||||
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", user, 15000);
|
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", user, 15000);
|
||||||
}
|
}
|
||||||
|
@ -800,3 +801,22 @@ public Action OnAntiRush(int client, int &type, float distance) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void L4D2_CInsectSwarm_CanHarm_Post(int acid, int spitter, int entity) {
|
||||||
|
if(entity <= MaxClients)
|
||||||
|
iLastInSpit[entity] = GetGameTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Event_EnteredSpit(Event event, const char[] name, bool dontBroadcast) {
|
||||||
|
int client = GetClientOfUserId(event.GetInt("userid"));
|
||||||
|
if(Trolls[stickyGooIndex].IsActive(stickyGooIndex)) {
|
||||||
|
float movement = 0.0;
|
||||||
|
if(Trolls[stickyGooIndex].activeFlagClients[client] & 1) movement = 0.6;
|
||||||
|
else if(Trolls[stickyGooIndex].activeFlagClients[client] & 2) movement = 0.3;
|
||||||
|
|
||||||
|
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", movement);
|
||||||
|
iLastInSpit[client] = GetGameTime();
|
||||||
|
CreateTimer(0.2, Timer_CheckIsInSpit, GetClientUserId(client), TIMER_REPEAT);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -9,19 +9,23 @@ public int Insta_PlayerHandler(Menu menu, MenuAction action, int client, int par
|
||||||
|
|
||||||
int userid = StringToInt(str[0]);
|
int userid = StringToInt(str[0]);
|
||||||
int instaMode = StringToInt(str[1]);
|
int instaMode = StringToInt(str[1]);
|
||||||
|
ShowInstaSpecialChooser(client, userid, instaMode);
|
||||||
Menu spMenu = new Menu(Insta_SpecialHandler);
|
|
||||||
spMenu.SetTitle("Choose a Insta-Special™");
|
|
||||||
for(int i = 1; i <= 8; i++) {
|
|
||||||
Format(info, sizeof(info), "%d|%d|%d", userid, instaMode, i);
|
|
||||||
spMenu.AddItem(info, SPECIAL_NAMES[i-1]);
|
|
||||||
}
|
|
||||||
spMenu.ExitButton = true;
|
|
||||||
spMenu.Display(client, 0);
|
|
||||||
} else if (action == MenuAction_End)
|
} else if (action == MenuAction_End)
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShowInstaSpecialChooser(int activator, int userid, int instaMode) {
|
||||||
|
Menu spMenu = new Menu(Insta_SpecialHandler);
|
||||||
|
spMenu.SetTitle("Choose a Insta-Special™");
|
||||||
|
static char data[16];
|
||||||
|
for(int i = 1; i <= 8; i++) {
|
||||||
|
Format(data, sizeof(data), "%d|%d|%d", userid, instaMode, i);
|
||||||
|
spMenu.AddItem(data, SPECIAL_NAMES[i-1]);
|
||||||
|
}
|
||||||
|
spMenu.ExitButton = true;
|
||||||
|
spMenu.Display(activator, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public int Insta_SpecialHandler(Menu menu, MenuAction action, int client, int param2) {
|
public int Insta_SpecialHandler(Menu menu, MenuAction action, int client, int param2) {
|
||||||
/* If an option was selected, tell the client about the item. */
|
/* If an option was selected, tell the client about the item. */
|
||||||
if (action == MenuAction_Select) {
|
if (action == MenuAction_Select) {
|
||||||
|
@ -29,12 +33,13 @@ public int Insta_SpecialHandler(Menu menu, MenuAction action, int client, int pa
|
||||||
menu.GetItem(param2, info, sizeof(info));
|
menu.GetItem(param2, info, sizeof(info));
|
||||||
static char str[3][8];
|
static char str[3][8];
|
||||||
ExplodeString(info, "|", str, 3, 8, false);
|
ExplodeString(info, "|", str, 3, 8, false);
|
||||||
int target = GetClientOfUserId(StringToInt(str[0]));
|
int userid = StringToInt(str[0]);
|
||||||
|
int target = GetClientOfUserId(userid);
|
||||||
bool inFace = StrEqual(str[1], "1");
|
bool inFace = StrEqual(str[1], "1");
|
||||||
int specialInt = StringToInt(str[2]);
|
int specialInt = StringToInt(str[2]);
|
||||||
if(specialInt < 0 || specialInt > 8) {
|
if(specialInt < 0 || specialInt > 8) {
|
||||||
ReplyToCommand(client, "Invalid special id");
|
ReplyToCommand(client, "Invalid special id");
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
SpecialType special = view_as<SpecialType>(specialInt);
|
SpecialType special = view_as<SpecialType>(specialInt);
|
||||||
if(inFace) {
|
if(inFace) {
|
||||||
|
@ -52,8 +57,10 @@ public int Insta_SpecialHandler(Menu menu, MenuAction action, int client, int pa
|
||||||
ReplyToCommand(client, "Could not spawn special.");
|
ReplyToCommand(client, "Could not spawn special.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ShowInstaSpecialChooser(client, userid, inFace);
|
||||||
} else if (action == MenuAction_End)
|
} else if (action == MenuAction_End)
|
||||||
delete menu;
|
delete menu;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -404,24 +404,50 @@ bool SpawnCarOnPlayer(int target) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
stock int CreateProp(const char[] entClass, const char[] model, const float pos[3], const float ang[3]) {
|
stock int CreateProp(const char[] entClass, const char[] model, const float pos[3], const float ang[3] = { 0.0, 0.0, 0.0 }, const float vel[3] = {0.0, 0.0, 0.0}) {
|
||||||
int entity = CreateEntityByName(entClass);
|
int entity = CreateEntityByName(entClass);
|
||||||
DispatchKeyValue(entity, "model", model);
|
DispatchKeyValue(entity, "model", model);
|
||||||
DispatchKeyValue(entity, "solid", "6");
|
DispatchKeyValue(entity, "solid", "6");
|
||||||
DispatchKeyValue(entity, "targetname", "hsprop");
|
DispatchKeyValue(entity, "targetname", "hsprop");
|
||||||
DispatchKeyValue(entity, "disableshadows", "1");
|
DispatchKeyValue(entity, "disableshadows", "1");
|
||||||
TeleportEntity(entity, pos, ang, NULL_VECTOR);
|
TeleportEntity(entity, pos, ang, vel);
|
||||||
DispatchSpawn(entity);
|
DispatchSpawn(entity);
|
||||||
|
TeleportEntity(entity, pos, ang, vel);
|
||||||
#if defined DEBUG_LOG_MAPSTART
|
#if defined DEBUG_LOG_MAPSTART
|
||||||
PrintToServer("spawn prop %.1f %.1f %.1f model %s", pos[0], pos[1], pos[2], model[7]);
|
PrintToServer("spawn prop %.1f %.1f %.1f model %s", pos[0], pos[1], pos[2], model[7]);
|
||||||
#endif
|
#endif
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool Filter_Solid(int entity, int contentsMask, any data) {
|
public bool Filter_Solid(int entity, int contentsMask, any data) {
|
||||||
return entity <= 0;
|
return entity <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action Timer_Delete(Handle h, int id) {
|
|
||||||
AcceptEntityInput(id, "Kill");
|
float VEH_MIN[3] = { -30.0, -30.0, 2.0};
|
||||||
|
float VEH_MAX[3] = { 30.0, 30.0, 20.0 };
|
||||||
|
|
||||||
|
bool SpawnCarToPlayer(int target, float distance) {
|
||||||
|
float pos[3], ang[3];
|
||||||
|
GetClientAbsOrigin(target, pos);
|
||||||
|
pos[2] += 40.0;
|
||||||
|
GetClientEyeAngles(target, ang);
|
||||||
|
ang[2] = ang[0] = 0.0;
|
||||||
|
|
||||||
|
float endPos[3];
|
||||||
|
GetHorizontalPositionFromOrigin(pos, ang, distance, endPos);
|
||||||
|
|
||||||
|
TR_TraceHullFilter(endPos, pos, VEH_MIN, VEH_MAX, MASK_SOLID, Filter_Solid);
|
||||||
|
if(TR_DidHit()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(distance > 0.0)
|
||||||
|
ang[1] -= 180;
|
||||||
|
float vel[3];
|
||||||
|
vel[0] = Cosine(DegToRad(ang[1])) * 1500.0;
|
||||||
|
vel[1] = Sine(DegToRad(ang[1])) * 1500.0;
|
||||||
|
int id = CreateProp("prop_physics", MODEL_CAR, endPos, ang, vel);
|
||||||
|
CreateTimer(6.0, Timer_Delete, id);
|
||||||
|
return true;
|
||||||
}
|
}
|
|
@ -113,6 +113,10 @@ public Action Timer_KickBot(Handle timer, int client) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action Timer_Delete(Handle h, int id) {
|
||||||
|
AcceptEntityInput(id, "Kill");
|
||||||
|
}
|
||||||
|
|
||||||
public Action Timer_ShootReverse(Handle h, DataPack pack) {
|
public Action Timer_ShootReverse(Handle h, DataPack pack) {
|
||||||
pack.Reset();
|
pack.Reset();
|
||||||
int attacker = pack.ReadCell();
|
int attacker = pack.ReadCell();
|
||||||
|
@ -149,3 +153,12 @@ public Action Timer_CheckSpecialSpawned(Handle h, int id) {
|
||||||
ProcessSpecialQueue();
|
ProcessSpecialQueue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action Timer_CheckIsInSpit(Handle h, int userid) {
|
||||||
|
int client = GetClientOfUserId(userid);
|
||||||
|
if(client && GetGameTime() - iLastInSpit[userid] > 3.0) {
|
||||||
|
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||||
|
return Plugin_Stop;
|
||||||
|
}
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
// UP THE VALUE 'MAX_TROLLS' in base.inc before adding new ones!
|
// UP THE VALUE 'MAX_TROLLS' in base.inc before adding new ones!
|
||||||
|
|
||||||
int slipperyShoesIndex = 0;
|
int slipperyShoesIndex = 0;
|
||||||
|
int stickyGooIndex = 0;
|
||||||
|
|
||||||
void SetupTrolls() {
|
void SetupTrolls() {
|
||||||
trollKV = new StringMap();
|
trollKV = new StringMap();
|
||||||
|
@ -24,14 +25,13 @@ void SetupTrolls() {
|
||||||
SetupTroll("Inface Special", "Shortcut to sm_inface", TrollMod_Instant);
|
SetupTroll("Inface Special", "Shortcut to sm_inface", TrollMod_Instant);
|
||||||
SetupTroll("Insta Special", "Shortcut to sm_insta", TrollMod_Instant);
|
SetupTroll("Insta Special", "Shortcut to sm_insta", TrollMod_Instant);
|
||||||
SetupTroll("Goo", "Spawns a spitter puddle underneath them", TrollMod_Instant);
|
SetupTroll("Goo", "Spawns a spitter puddle underneath them", TrollMod_Instant);
|
||||||
index = SetupTroll("Amazon Special Combo", "Choose multiple different specials to spawn", TrollMod_Instant);
|
index = SetupTroll("Sticky Goo", "Slows player down in goo", TrollMod_Constant);
|
||||||
Trolls[index].AddFlagPrompt(true);
|
|
||||||
for(int i = 0; i < 8; i++) {
|
|
||||||
Trolls[index].AddFlag(SPECIAL_NAMES[i], false); // 1 << 7 max
|
|
||||||
}
|
|
||||||
Trolls[index].AddFlagPrompt(false);
|
Trolls[index].AddFlagPrompt(false);
|
||||||
Trolls[index].AddFlag("Spawn On Face", false); // 1 << 8
|
Trolls[index].AddFlag("60% Movement Speed", true);
|
||||||
Trolls[index].AddFlag("Spawn Near", false); // 1 << 9
|
Trolls[index].AddFlag("30% Movement Speed", false);
|
||||||
|
Trolls[index].AddFlag("0% Movement Speed", false);
|
||||||
|
stickyGooIndex = index;
|
||||||
|
SetupTroll("Instant Commons", "Spawns commons behind or infront", TrollMod_Instant);
|
||||||
|
|
||||||
// CATEGORY: Items
|
// CATEGORY: Items
|
||||||
SetCategory("Items");
|
SetCategory("Items");
|
||||||
|
@ -112,7 +112,11 @@ void SetupTrolls() {
|
||||||
|
|
||||||
/// CATEGORY: Movement
|
/// CATEGORY: Movement
|
||||||
SetCategory("Movement");
|
SetCategory("Movement");
|
||||||
SetupTroll("Slow Speed", "Sets player speed to 0.8x of normal speed", TrollMod_Constant);
|
index = SetupTroll("Slow Speed", "Sets player speed to 0.8x of normal speed", TrollMod_Constant);
|
||||||
|
Trolls[index].AddFlagPrompt(false);
|
||||||
|
Trolls[index].AddFlag("60% Movement Speed", true);
|
||||||
|
Trolls[index].AddFlag("30% Movement Speed", false);
|
||||||
|
Trolls[index].AddFlag("0% Movement Speed", false);
|
||||||
SetupTroll("Higher Gravity", "Sets player gravity to 1.3x of normal gravity", TrollMod_Constant);
|
SetupTroll("Higher Gravity", "Sets player gravity to 1.3x of normal gravity", TrollMod_Constant);
|
||||||
SetupTroll("Inverted Controls", "Well, aint it obvious", TrollMod_Constant);
|
SetupTroll("Inverted Controls", "Well, aint it obvious", TrollMod_Constant);
|
||||||
SetupTroll("Stagger", "Like a slap, but different", TrollMod_Instant);
|
SetupTroll("Stagger", "Like a slap, but different", TrollMod_Instant);
|
||||||
|
@ -131,6 +135,10 @@ void SetupTrolls() {
|
||||||
SetupTroll("No Shove", "Prevents a player from shoving", TrollMod_Constant);
|
SetupTroll("No Shove", "Prevents a player from shoving", TrollMod_Constant);
|
||||||
SetupTroll("CameTooEarly", "When they shoot, random chance they empty whole clip", TrollMod_Constant);
|
SetupTroll("CameTooEarly", "When they shoot, random chance they empty whole clip", TrollMod_Constant);
|
||||||
index = SetupTroll("Car Splat", "Car. splats.", TrollMod_Instant);
|
index = SetupTroll("Car Splat", "Car. splats.", TrollMod_Instant);
|
||||||
|
Trolls[index].AddFlagPrompt(false);
|
||||||
|
Trolls[index].AddFlag("On Top", true);
|
||||||
|
Trolls[index].AddFlag("Into (Infront)", false);
|
||||||
|
Trolls[index].AddFlag("Into (Behind)", false);
|
||||||
index = SetupTroll("Meta: Inverse", "Uhm you are not supposed to see this...", TrollMod_Instant);
|
index = SetupTroll("Meta: Inverse", "Uhm you are not supposed to see this...", TrollMod_Instant);
|
||||||
Trolls[index].hidden = true;
|
Trolls[index].hidden = true;
|
||||||
Trolls[index].AddFlagPrompt(false);
|
Trolls[index].AddFlagPrompt(false);
|
||||||
|
@ -167,9 +175,15 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
||||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||||
SetEntityGravity(victim, 1.0);
|
SetEntityGravity(victim, 1.0);
|
||||||
return false;
|
return false;
|
||||||
} else if(StrEqual(troll.name, "Slow Speed"))
|
} else if(StrEqual(troll.name, "Slow Speed")) {
|
||||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", isActive ? 1.0 : 0.8);
|
float movement = 1.0;
|
||||||
else if(StrEqual(troll.name, "Higher Gravity"))
|
if(isActive) {
|
||||||
|
if(flags & 1) movement = 0.6;
|
||||||
|
else if(flags & 2) movement = 0.3;
|
||||||
|
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", movement);
|
||||||
|
} else
|
||||||
|
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", movement);
|
||||||
|
} else if(StrEqual(troll.name, "Higher Gravity"))
|
||||||
SetEntityGravity(victim, isActive ? 1.0 : 1.3);
|
SetEntityGravity(victim, isActive ? 1.0 : 1.3);
|
||||||
else if(StrEqual(troll.name, "Half Primary Ammo")) {
|
else if(StrEqual(troll.name, "Half Primary Ammo")) {
|
||||||
int current = GetPrimaryReserveAmmo(victim);
|
int current = GetPrimaryReserveAmmo(victim);
|
||||||
|
@ -237,19 +251,30 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
||||||
BaseComm_SetClientMute(victim, !isActive);
|
BaseComm_SetClientMute(victim, !isActive);
|
||||||
} else if(StrEqual(troll.name, "Spicy Gas")) {
|
} else if(StrEqual(troll.name, "Spicy Gas")) {
|
||||||
SDKHook(victim, SDKHook_WeaponCanUse, Event_ItemPickup);
|
SDKHook(victim, SDKHook_WeaponCanUse, Event_ItemPickup);
|
||||||
} else if(StrEqual(troll.name, "Amazon Special Combo")) {
|
|
||||||
SpecialSpawnFlags spawnFlag = Special_Anywhere;
|
|
||||||
if(flags & (1 << 8)) spawnFlag = Special_OnTarget;
|
|
||||||
for(int i = 1; i < 7; i++) {
|
|
||||||
if(flags & (1 << i)) {
|
|
||||||
SpawnSpecialForTarget(view_as<SpecialType>(i), victim, spawnFlag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if(StrEqual(troll.name, "Car Splat")) {
|
} else if(StrEqual(troll.name, "Car Splat")) {
|
||||||
|
if(flags & 1) {
|
||||||
if(!SpawnCarOnPlayer(victim)) {
|
if(!SpawnCarOnPlayer(victim)) {
|
||||||
ReplyToCommand(activator, "Could not find a suitable area to spawn a car");
|
ReplyToCommand(activator, "Could not find a suitable area to spawn a car. Requires vertical space above victim.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if(flags & 2) {
|
||||||
|
if(!SpawnCarToPlayer(victim, 450.0)) {
|
||||||
|
ReplyToCommand(activator, "Could not find a suitable area to spawn a car. Requires space ahead of victim");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if(flags & 4) {
|
||||||
|
if(!SpawnCarToPlayer(victim, -450.0)) {
|
||||||
|
ReplyToCommand(activator, "Could not find a suitable area to spawn a car. Requires space behind victim");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(StrEqual(troll.name, "Instant Commons")) {
|
||||||
|
float pos[3];
|
||||||
|
GetHorizontalPositionFromClient(victim, -40.0, pos);
|
||||||
|
for(int i = 0; i < 30; i++) {
|
||||||
|
L4D_SpawnCommonInfected(pos);
|
||||||
|
}
|
||||||
|
CreateTimer(0.1, RushPlayer, victim);
|
||||||
} else if(modifier != TrollMod_Constant) {
|
} else if(modifier != TrollMod_Constant) {
|
||||||
PrintToServer("[FTT] Warn: Possibly invalid troll, no apply action defined for \"%s\"", troll.name);
|
PrintToServer("[FTT] Warn: Possibly invalid troll, no apply action defined for \"%s\"", troll.name);
|
||||||
#if defined DEBUG
|
#if defined DEBUG
|
||||||
|
@ -258,3 +283,4 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ public void OnPluginStart() {
|
||||||
HookEvent("door_close", Event_DoorToggle);
|
HookEvent("door_close", Event_DoorToggle);
|
||||||
HookEvent("adrenaline_used", Event_SecondaryHealthUsed);
|
HookEvent("adrenaline_used", Event_SecondaryHealthUsed);
|
||||||
HookEvent("pills_used", Event_SecondaryHealthUsed);
|
HookEvent("pills_used", Event_SecondaryHealthUsed);
|
||||||
|
HookEvent("entered_spit", Event_EnteredSpit);
|
||||||
|
|
||||||
AddNormalSoundHook(view_as<NormalSHook>(SoundHook));
|
AddNormalSoundHook(view_as<NormalSHook>(SoundHook));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue