ftt: Integrate swarm directly

This commit is contained in:
Jackzie 2021-05-19 14:52:42 -05:00
parent 1f23237ec7
commit e0ae644c80
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
3 changed files with 8 additions and 5 deletions

View file

@ -188,7 +188,7 @@ Troll Modes: (updated 4/20/2021)
11. **ThrowItAll** - Makes a player throw all their items at any nearby players. Runs on the interval set by sm_ftt_throw_interval.
12. **GunJam** - On reload, small chance their gun gets jammed - Can't reload.
13. **NoPickup** - Prevents a player from picking up ANY (new) item. Use ThrowItAll to make them drop
14. **Swarm** - Swarms a player with zombies. Requires my [swarm plugin](#l4d2_swarm)
14. **Swarm** - Swarms a player with zombies.
15. **Honk** Replaces player's chat messages with honk
16. **Special Magnet** Attracts ALL specials to the closest alive trolled target with this troll enabled
17. **Tank Magnet** Attracts ALL tanks to the closest alive trolled target with this troll enabled

View file

@ -215,9 +215,9 @@ void ApplyModeToClient(int client, int victim, trollMode mode, TrollModifier mod
}
case Troll_Swarm: {
if(modifier == TrollMod_InstantFire) {
FakeClientCommandEx(client, "sm_swarm #%d", victim);
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", victim, 15000);
}else if(modifier == TrollMod_Repeat) {
FakeClientCommandEx(client, "sm_swarmtoggle #%d", victim);
}else{
ReplyToCommand(client, "Invalid modifier for mode.");
return;

View file

@ -136,10 +136,11 @@ public void Event_PanicEventCreate(Event event, const char[] name, bool dontBroa
}
}
public void Event_CarAlarm(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
int user = event.GetInt("userid");
int client = GetClientOfUserId(user;
if(client) {
PrintToChatAll("%N has alerted the horde!", client);
FakeClientCommandEx(client, "sm_swarm #%d", client);
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", user, 15000);
}
//Ignore car alarms for autopunish
lastButtonUser = -1;
@ -704,6 +705,8 @@ public Action Timer_Main(Handle timer) {
SetEntPropFloat(i, Prop_Send, "m_healthBufferTime", bufferTime - 7.0);
}
}
}else if(HasTrollMode(i, Troll_Swarm)) {
L4D2_RunScript("RushVictim(GetPlayerFromUserID(%d), %d)", GetClientUserId(i), 15000);
}
}
}