Bug fixes

This commit is contained in:
Jackzie 2022-02-18 15:05:06 -06:00
parent 5b60b8a95f
commit aa4eab2a76
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
3 changed files with 7 additions and 4 deletions

Binary file not shown.

View file

@ -60,7 +60,7 @@ public void OnClientAuthorized(int client, const char[] auth) {
}
public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
if(g_PendingBanTroll[client] > 0) {
if(client > 0 && g_PendingBanTroll[client] > 0) {
if(!IsFakeClient(client) && GetUserAdmin(client) == INVALID_ADMIN_ID) {
BanIdentity(steamids[client], 0, BANFLAG_AUTHID, "Marked as Troll", "ftt", GetClientOfUserId(g_PendingBanTroll[client]));
}
@ -525,7 +525,10 @@ public Action Event_TakeDamage(int victim, int& attacker, int& inflictor, float&
return Plugin_Changed;
}
if(damagetype & DMG_BURN || damagetype & DMG_BLAST) return Plugin_Continue;
if(damagetype & DMG_BURN || damagetype & DMG_BLAST) {
if(IsFakeClient(attacker)) return Plugin_Handled;
else return Plugin_Continue;
}
if(hBotReverseFFDefend.IntValue > 0 && IsFakeClient(attacker) && shootAtTarget[attacker] == 0 && GetClientTeam(attacker) == 2 && GetClientTeam(victim) == 2) return Plugin_Stop;
if(attacker != victim && hBotReverseFFDefend.IntValue > 0 && hBotReverseFFDefend.IntValue == 2 || GetUserAdmin(attacker) == INVALID_ADMIN_ID) {
if(IsFakeClient(victim) && !IsFakeClient(attacker) && GetClientTeam(attacker) == 2 && GetClientTeam(victim) == 2) {
@ -552,7 +555,7 @@ public Action SoundHook(int[] clients, int& numClients, char sample[PLATFORM_MAX
if(honkID == 0) honkID = GetTrollID("Honk / Meow");
if(vocalGagID == 0) vocalGagID = GetTrollID("Vocalize Gag");
if(lastButtonUser > -1 && !IsFakeClient(lastButtonUser) && StrEqual(sample, "npc/mega_mob/mega_mob_incoming.wav")) {
if(lastButtonUser > 0 && IsClientConnected(lastButtonUser) && !IsFakeClient(lastButtonUser) && StrEqual(sample, "npc/mega_mob/mega_mob_incoming.wav")) {
PrintToConsoleAll("CRESCENDO STARTED BY %N", lastButtonUser);
#if defined DEBUG
PrintToChatAll("CRESCENDO STARTED BY %N", lastButtonUser);

View file

@ -66,7 +66,7 @@ public void OnPluginStart() {
hMagnetTargetMode = CreateConVar("sm_ftt_magnet_targetting", "4", "How does the specials target players. Add bits together\n0=Incapped are ignored, 1=Specials targets incapped, 2=Tank targets incapped 4=Witch targets incapped");
hShoveFailChance = CreateConVar("sm_ftt_shove_fail_chance", "0.65", "The % chance that a shove fails", FCVAR_NONE, true, 0.0, true, 1.0);
hBadThrowHitSelf = CreateConVar("sm_ftt_badthrow_fail_chance", "1", "The % chance that on a throw, they will instead hit themselves. 0 to disable", FCVAR_NONE, true, 0.0, true, 1.0);
hBotReverseFFDefend = CreateConVar("sm_ftt_bot_defend", "1", "Should bots defend themselves?\n0 = OFF\n1 = Will retaliate against non-admins\n2 = Anyone", FCVAR_NONE, true, 0.0, true, 2.0);
hBotReverseFFDefend = CreateConVar("sm_ftt_bot_defend", "0", "Should bots defend themselves?\n0 = OFF\n1 = Will retaliate against non-admins\n2 = Anyone", FCVAR_NONE, true, 0.0, true, 2.0);
hBotDefendChance = CreateConVar("sm_ftt_bot_defend_chance", "0.75", "% Chance bots will defend themselves.", FCVAR_NONE, true, 0.0, true, 1.0);
hSbFriendlyFire = FindConVar("sb_friendlyfire");