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

@ -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);
}
}
}