mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 12:03:20 +00:00
add no rushing us troll
This commit is contained in:
parent
68a43a78cf
commit
f60250042a
5 changed files with 32 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
|||
//Allow MAX_TROLLS to be defined elsewhere
|
||||
#if defined MAX_TROLLS
|
||||
#else
|
||||
#define MAX_TROLLS 46
|
||||
#define MAX_TROLLS 47
|
||||
#endif
|
||||
|
||||
enum trollModifier {
|
||||
|
|
|
@ -744,10 +744,20 @@ public Action Event_TakeDamage(int victim, int& attacker, int& inflictor, float&
|
|||
|
||||
public Action OnVocalizeCommand(int client, const char[] vocalize, int initiator) {
|
||||
static int vocalGagID;
|
||||
static int noRushingUsID;
|
||||
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);
|
||||
}
|
||||
if(Trolls[vocalGagID].IsActive(client)) {
|
||||
return Plugin_Handled;
|
||||
}
|
||||
}
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -544,4 +544,18 @@ stock LookAtPoint(int entity, const float destination[3]){
|
|||
}
|
||||
angles[1] -= 180;
|
||||
TeleportEntity(entity, NULL_VECTOR, angles, NULL_VECTOR);
|
||||
}
|
||||
}
|
||||
stock void PrintToConsoleAdmins(const char[] format, any ...) {
|
||||
char buffer[254];
|
||||
|
||||
VFormat(buffer, sizeof(buffer), format, 2);
|
||||
for(int i = 1; i <= MaxClients; i++) {
|
||||
if(IsClientConnected(i) && IsClientInGame(i)) {
|
||||
AdminId admin = GetUserAdmin(i);
|
||||
if(admin != INVALID_ADMIN_ID) {
|
||||
PrintToConsole(i, "%s", buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
PrintToServer("%s", buffer);
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ void SetupTrolls() {
|
|||
Trolls[index].AddFlag("Show Modified Only To Them", false);
|
||||
SetupTroll("Reversed", "Reserves their message", TrollMod_Constant);
|
||||
SetupTroll("Voice Mute", "Mutes from voice", TrollMod_Constant);
|
||||
SetupTroll("No Rushing Us", "Decreases player speed everytime they yell hurry up", TrollMod_Constant);
|
||||
|
||||
/// CATEGORY: Health
|
||||
SetCategory("Health");
|
||||
|
@ -217,7 +218,6 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
|||
for(int i = 0; i <= MAX_TROLLS; i++) {
|
||||
Trolls[i].activeFlagClients[victim] = -1;
|
||||
}
|
||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
SetEntityGravity(victim, 1.0);
|
||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
return false;
|
||||
|
@ -439,12 +439,14 @@ bool ApplyAffect(int victim, const Troll troll, int activator, trollModifier mod
|
|||
pdata[victim].smartChargeMaxAttempts = timeout;
|
||||
pdata[victim].smartChargeActivator = GetClientUserId(activator);
|
||||
CreateTimer(1.0, Timer_CheckForChargerOpportunity, GetClientUserId(victim), TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
|
||||
} else if(~modifier & TrollMod_Constant) {
|
||||
} else if(StrEqual(troll.name, "No Rushing Us")) {
|
||||
SetEntPropFloat(victim, Prop_Send, "m_flLaggedMovementValue", 1.0);
|
||||
} else if(~modifier & TrollMod_Constant) {
|
||||
PrintToServer("[FTT] Warn: Possibly invalid troll, no apply action defined for \"%s\"", troll.name);
|
||||
#if defined DEBUG
|
||||
ReplyToCommand(activator, "[FTT/Debug] If nothing occurs, this troll possibly was not implemented correctly. ");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue