mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-08 10:43:21 +00:00
update
This commit is contained in:
parent
078b7c4bf6
commit
cb66da2ca2
50 changed files with 3176 additions and 383 deletions
|
@ -240,6 +240,7 @@ void ResetClient(int victim, bool wipe = true) {
|
|||
Trolls[i].activeFlagClients[victim] = -1;
|
||||
}
|
||||
}
|
||||
noRushingUsSpeed[victim] = 1.0;
|
||||
BaseComm_SetClientMute(victim, false);
|
||||
SetEntityGravity(victim, 1.0);
|
||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
|
@ -368,8 +369,8 @@ void ApplyTroll(int victim, const char[] name, int activator, trollModifier modi
|
|||
// Log all actions, indicating if constant or single-fire, and if any flags
|
||||
if(!silent) {
|
||||
if(isActive) {
|
||||
CShowActivityEx(activator, "[FTT] ", "deactivated {yellow}\"%s\"{default} on %N. ", troll.name, victim);
|
||||
LogAction(activator, victim, "\"%L\" deactivated {yellow}\"%s\"{default} on \"%L\"", activator, troll.name, victim);
|
||||
CShowActivityEx(activator, "[FTT] ", "deactivated {yellow}%s{default} on %N. ", troll.name, victim);
|
||||
LogAction(activator, victim, "\"%L\" deactivated \"%s\" on \"%L\"", activator, troll.name, victim);
|
||||
} else {
|
||||
static char flagName[MAX_TROLL_FLAG_LENGTH];
|
||||
// strcopy(flagName, sizeof(flagName), troll.name)
|
||||
|
|
|
@ -46,6 +46,19 @@ void SetupsTrollCombos() {
|
|||
combo.AddTroll("Witch Magnet");
|
||||
#endif
|
||||
|
||||
SetupCombo(combo, "Rush Stopper");
|
||||
combo.AddTroll("Special Magnet");
|
||||
combo.AddTroll("Tank Magnet");
|
||||
#if defined _behavior_included
|
||||
combo.AddTroll("Witch Magnet");
|
||||
#endif
|
||||
combo.AddTroll("No Button Touchie", TrollMod_Constant, 17);
|
||||
combo.AddTroll("Slow Speed", TrollMod_Constant, 2);
|
||||
combo.AddTroll("Instant Commons", TrollMod_Instant, 1);
|
||||
// combo.AddTroll("Swarm", TrollMod_Instant);
|
||||
combo.AddTroll("Vomit Player");
|
||||
combo.AddTroll("Dull Melee", .flags=2);
|
||||
|
||||
SetupCombo(combo, "Tank Run Noob");
|
||||
combo.AddTroll("Slow Speed");
|
||||
combo.AddTroll("Tank Magnet");
|
||||
|
|
|
@ -57,7 +57,7 @@ public Action Command_InstaSpecial(int client, int args) {
|
|||
}
|
||||
}
|
||||
if(successes > 0)
|
||||
ShowActivityEx(client, "[FTT] ", "spawned Insta-%s™ near %s", arg2, target_name);
|
||||
CShowActivityEx(client, "[FTT] ", "spawned {green}Insta-%s™{default} near {green}%s", arg2, target_name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,7 +123,7 @@ public Action Command_InstaSpecialFace(int client, int args) {
|
|||
}
|
||||
}
|
||||
if(successes > 0)
|
||||
ShowActivityEx(client, "[FTT] ", "spawned Insta-%s™ on %s", arg2, target_name);
|
||||
CShowActivityEx(client, "[FTT] ", "spawned {green}Insta-%s™{default} on {green}%s", arg2, target_name);
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
|
|
@ -223,9 +223,27 @@ public Action Event_ButtonPress(const char[] output, int entity, int client, flo
|
|||
if(!noButtonPressIndex) noButtonPressIndex = GetTrollID("No Button Touchie");
|
||||
if(client > 0 && client <= MaxClients) {
|
||||
if(Trolls[noButtonPressIndex].IsActive(client)) {
|
||||
AcceptEntityInput(entity, "Lock");
|
||||
RequestFrame(Frame_ResetButton, entity);
|
||||
return Plugin_Handled;
|
||||
if(Trolls[noButtonPressIndex].activeFlagClients[client] & 1) {
|
||||
AcceptEntityInput(entity, "Lock");
|
||||
RequestFrame(Frame_ResetButton, entity);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
if(Trolls[noButtonPressIndex].activeFlagClients[client] & 2) {
|
||||
L4D_CTerrorPlayer_OnVomitedUpon(client, client);
|
||||
}
|
||||
if(Trolls[noButtonPressIndex].activeFlagClients[client] & 4) {
|
||||
L4D_SetPlayerIncapacitatedState(client, true);
|
||||
}
|
||||
if(Trolls[noButtonPressIndex].activeFlagClients[client] & 8) {
|
||||
ServerCommand("sm_slay #%d", GetClientUserId(client));
|
||||
}
|
||||
if(Trolls[noButtonPressIndex].activeFlagClients[client] & 16) {
|
||||
float speed = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
|
||||
if(speed > 0.9) speed = 0.80;
|
||||
speed -= 5.0;
|
||||
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", speed);
|
||||
PrintToConsoleAdmins("[FTT] NoButtonTouchie: %N speed is now %f", speed);
|
||||
}
|
||||
}
|
||||
lastButtonUser = client;
|
||||
}
|
||||
|
@ -776,12 +794,12 @@ public Action OnVocalizeCommand(int client, const char[] vocalize, int initiator
|
|||
if(vocalGagID == 0) vocalGagID = GetTrollID("Vocalize Gag");
|
||||
if(noRushingUsID == 0) noRushingUsID = GetTrollID("No Rushing Us");
|
||||
if(Trolls[noRushingUsID].IsActive(client) && (StrEqual(vocalize, "PlayerHurryUp") || StrEqual(vocalize, "PlayerYellRun") || StrEqual(vocalize, "PlayerMoveOn") || StrEqual(vocalize, "PlayerLeadOn"))) {
|
||||
float speed = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
|
||||
speed -= 0.01;
|
||||
if(speed < 0.0) SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 0.0);
|
||||
else if(speed > 0.05)
|
||||
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", speed);
|
||||
PrintToConsoleAdmins("[FTT] NoRushingUs: Dropping speed for %N (now %.1f%)", client, speed * 100.0);
|
||||
noRushingUsSpeed[client] -= 0.01;
|
||||
if(noRushingUsSpeed[client] < 0.05) {
|
||||
noRushingUsSpeed[client] = 0.05;
|
||||
}
|
||||
SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", noRushingUsSpeed[client]);
|
||||
PrintToConsoleAdmins("[FTT] NoRushingUs: Dropping speed for %N (now %.1f%)", client, noRushingUsSpeed[client] * 100.0);
|
||||
}
|
||||
if(Trolls[vocalGagID].IsActive(client)) {
|
||||
return Plugin_Handled;
|
||||
|
|
|
@ -90,8 +90,9 @@ public int ChoosePlayerHandler(Menu menu, MenuAction action, int param1, int par
|
|||
}
|
||||
|
||||
SetupCategoryMenu(param1, userid);
|
||||
} else if (action == MenuAction_End)
|
||||
} else if (action == MenuAction_End) {
|
||||
delete menu;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -208,7 +209,7 @@ public int ChooseModeMenuHandler(Menu menu, MenuAction action, int param1, int p
|
|||
|
||||
modiferMenu.ExitButton = true;
|
||||
modiferMenu.Display(param1, 0);
|
||||
} else if(troll.HasFlags() && !troll.IsActive(client)) {
|
||||
} else if(!troll.IsActive(client) && troll.HasFlags()) {
|
||||
ShowSelectFlagMenu(param1, userid, -1, troll);
|
||||
} else {
|
||||
troll.Activate(client, param1);
|
||||
|
@ -241,8 +242,10 @@ public int ChooseClumsySlotHandler(Menu menu, MenuAction action, int param1, int
|
|||
} else {
|
||||
ThrowItemToPlayer(client, param1, slot);
|
||||
}
|
||||
LogAction(param1, client, "\"%L\" activated troll \"Throw It all\" slot=%d for \"%L\"", param1, slot, client);
|
||||
ShowActivityEx(param1, "[FTT] ", "activated troll \"Throw It All\" for %N. ", client);
|
||||
if(slot != -2) {
|
||||
LogAction(param1, client, "\"%L\" activated troll \"Throw It all\" slot=%d for \"%L\"", param1, slot, client);
|
||||
ShowActivityEx(param1, "[FTT] ", "activated troll \"Throw It All\" for %N. ", client);
|
||||
}
|
||||
|
||||
ShowThrowItAllMenu(param1, userid);
|
||||
} else if (action == MenuAction_End)
|
||||
|
@ -395,17 +398,19 @@ void ShowTrollMenu(int client, bool isComboList) {
|
|||
for(int i = 1; i <= MaxClients; i++) {
|
||||
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2) {
|
||||
IntToString(GetClientUserId(i), userid, sizeof(userid));
|
||||
int specClient = GetSpectatorClient(i);
|
||||
int realPlayer = L4D_GetBotOfIdlePlayer(i);
|
||||
PrintToServer("%d/%d", i, realPlayer);
|
||||
// Incase player is idle, grab their bot instead of them
|
||||
if(specClient > 0) {
|
||||
if(IsPlayerAlive(specClient))
|
||||
Format(display, sizeof(display), "%N (AFK)", specClient);
|
||||
if(realPlayer > 0 && IsClientConnected(realPlayer)) {
|
||||
if(IsPlayerAlive(i))
|
||||
Format(display, sizeof(display), "%N (AFK)", realPlayer);
|
||||
else
|
||||
Format(display, sizeof(display), "%N (AFK/Dead)", specClient);
|
||||
Format(display, sizeof(display), "%N (AFK/Dead)", realPlayer);
|
||||
} else if(!IsPlayerAlive(i))
|
||||
Format(display, sizeof(display), "%N (Dead)", i);
|
||||
|
||||
GetClientName(i, display, sizeof(display));
|
||||
else {
|
||||
GetClientName(i, display, sizeof(display));
|
||||
}
|
||||
menu.AddItem(userid, display);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,14 +101,21 @@ bool ProcessSpecialQueue() {
|
|||
CheatCommand(target, "z_spawn_old", SPECIAL_NAMES[view_as<int>(spActiveRequest.type) - 1], "auto");
|
||||
} else if(spActiveRequest.type == Special_Witch) {
|
||||
int witch = L4D2_SpawnWitch(spActiveRequest.position, spActiveRequest.angle);
|
||||
DataPack pack;
|
||||
CreateDataTimer(0.2, Timer_SetWitchTarget, pack);
|
||||
pack.WriteCell(witch);
|
||||
pack.WriteCell(GetClientUserId(target));
|
||||
if(witch != -1)
|
||||
SetWitchTarget(witch, target);
|
||||
return ProcessSpecialQueue();
|
||||
} else if(spActiveRequest.type == Special_Tank) {
|
||||
// BypassLimit();
|
||||
int tank = L4D2_SpawnTank(spActiveRequest.position, spActiveRequest.angle);
|
||||
if(tank > 0 && IsClientConnected(tank))
|
||||
if(tank > 0 && IsClientConnected(tank)) {
|
||||
PrintToConsoleAll("[ftt/debug] requested tank spawned %d -> %N", tank, target)
|
||||
pdata[tank].attackerTargetUid = spActiveRequest.targetUserId;
|
||||
pdata[tank].specialAttackFlags = view_as<int>(SPI_AlwaysTarget);
|
||||
}
|
||||
return ProcessSpecialQueue();
|
||||
}
|
||||
return true;
|
||||
|
@ -117,6 +124,16 @@ bool ProcessSpecialQueue() {
|
|||
return false;
|
||||
}
|
||||
|
||||
Action Timer_SetWitchTarget(Handle h, DataPack pack) {
|
||||
pack.Reset();
|
||||
int witch = pack.ReadCell();
|
||||
int target = GetClientOfUserId(pack.ReadCell());
|
||||
if(IsValidEntity(witch) && target > 0) {
|
||||
SetWitchTarget(witch, target);
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
stock SpecialType GetSpecialType(const char[] input) {
|
||||
for(int i = 0; i < 8; i++) {
|
||||
if(strcmp(SPECIAL_NAMES[i], input, false) == 0) return view_as<SpecialType>(i + 1);
|
||||
|
|
|
@ -192,7 +192,14 @@ void SetupTrolls() {
|
|||
SetCategory("Misc");
|
||||
SetupTroll("Gun Jam", "On reload, small chance their gun gets jammed - Can't reload.", TrollMod_Constant);
|
||||
SetupTroll("No Shove", "Prevents a player from shoving", TrollMod_Constant);
|
||||
SetupTroll("No Button Touchie", "Stops people from pressing buttons", TrollMod_Constant);
|
||||
index = SetupTroll("No Button Touchie", "Stops people from pressing buttons", TrollMod_Constant);
|
||||
Trolls[index].AddFlagPrompt(true);
|
||||
Trolls[index].AddFlag("Prevent Use", true);
|
||||
Trolls[index].AddFlag("Vomit On Touch", false);
|
||||
Trolls[index].AddFlag("Incap On Touch", false);
|
||||
Trolls[index].AddFlag("Slay On Touch", false);
|
||||
Trolls[index].AddFlag("0.8x Speed", false);
|
||||
// add flag: vomit on touch
|
||||
index = SetupTroll("Meta: Inverse", "Uhm you are not supposed to see this...", TrollMod_Instant);
|
||||
Trolls[index].hidden = true;
|
||||
Trolls[index].AddFlagPrompt(false);
|
||||
|
@ -223,11 +230,12 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
|||
if(StrEqual(troll.name, "Reset User")) {
|
||||
LogAction(activator, victim, "\"%L\" reset all effects for \"%L\"", activator, victim);
|
||||
ShowActivityEx(activator, "[FTT] ", "reset effects for %N. ", victim);
|
||||
for(int i = 0; i <= MAX_TROLLS; i++) {
|
||||
Trolls[i].activeFlagClients[victim] = -1;
|
||||
}
|
||||
SetEntityGravity(victim, 1.0);
|
||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
// for(int i = 0; i <= MAX_TROLLS; i++) {
|
||||
// Trolls[i].activeFlagClients[victim] = -1;
|
||||
// }
|
||||
// SetEntityGravity(victim, 1.0);
|
||||
// SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
ResetClient(victim, true);
|
||||
return false;
|
||||
} else if(StrEqual(troll.name, "Slow Speed")) {
|
||||
if(toActive) {
|
||||
|
@ -280,7 +288,6 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
|||
if(modifier & TrollMod_Instant) {
|
||||
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", victim, 15000);
|
||||
}
|
||||
return true;
|
||||
} else if(StrEqual(troll.name, "Gun Jam")) {
|
||||
int wpn = GetClientWeaponEntIndex(victim, 0);
|
||||
if(wpn > -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue