From a228405eab7d6dc4c0f75aacf0688689990f4d9c Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 22 May 2019 19:49:51 +0200 Subject: [PATCH 1/5] AdminCheats: Add logging. --- AdminCheats/scripting/AdminCheats.sp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/AdminCheats/scripting/AdminCheats.sp b/AdminCheats/scripting/AdminCheats.sp index 36dac76..c5f63fd 100644 --- a/AdminCheats/scripting/AdminCheats.sp +++ b/AdminCheats/scripting/AdminCheats.sp @@ -99,13 +99,14 @@ public Action OnCheatCommand(int client, const char[] command, int argc) if(client == 0) return Plugin_Continue; - if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) - return Plugin_Continue; - if(!argc && (StrEqual(command, "kill") || StrEqual(command, "explode"))) return Plugin_Continue; - return Plugin_Handled; + if(!IsClientAuthorized(client) || !CheckCommandAccess(client, "", ADMFLAG_CHEATS)) + return Plugin_Handled; + + LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command); + return Plugin_Continue; } public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) @@ -116,10 +117,11 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 if(impulse == 100 || impulse == 201) return Plugin_Continue; - if(IsClientAuthorized(client) && CheckCommandAccess(client, "", ADMFLAG_CHEATS)) - return Plugin_Continue; + if(!IsClientAuthorized(client) || !CheckCommandAccess(client, "", ADMFLAG_CHEATS)) + return Plugin_Handled; - return Plugin_Handled; + LogAction(client, -1, "\"%L\" used cheat command: \"impulse %d\"", client, impulse); + return Plugin_Continue; } stock void MakeCheatCommand(const char[] name) From 60be38608c29e481e9052047c7c67521d94d2e49 Mon Sep 17 00:00:00 2001 From: Dogan Date: Wed, 22 May 2019 20:23:41 +0200 Subject: [PATCH 2/5] AdminCheats: print noclip to chat --- AdminCheats/scripting/AdminCheats.sp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AdminCheats/scripting/AdminCheats.sp b/AdminCheats/scripting/AdminCheats.sp index c5f63fd..9d72abb 100644 --- a/AdminCheats/scripting/AdminCheats.sp +++ b/AdminCheats/scripting/AdminCheats.sp @@ -106,6 +106,9 @@ public Action OnCheatCommand(int client, const char[] command, int argc) return Plugin_Handled; LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command); + if(StrEqual(command, "noclip") && GetClientTeam(client) > 1 && IsPlayerAlive(client) == true) + ShowActivity2(client, "[SM] ", "Toggled noclip on target himself."); + return Plugin_Continue; } From 7c8147a50c7174e5c7c9fe3ce65dbe6a50b6aa54 Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 22 May 2019 20:38:06 +0200 Subject: [PATCH 3/5] AdminCheats: Organize last commit slightly. --- AdminCheats/scripting/AdminCheats.sp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AdminCheats/scripting/AdminCheats.sp b/AdminCheats/scripting/AdminCheats.sp index 9d72abb..b0b3487 100644 --- a/AdminCheats/scripting/AdminCheats.sp +++ b/AdminCheats/scripting/AdminCheats.sp @@ -105,10 +105,10 @@ public Action OnCheatCommand(int client, const char[] command, int argc) if(!IsClientAuthorized(client) || !CheckCommandAccess(client, "", ADMFLAG_CHEATS)) return Plugin_Handled; - LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command); - if(StrEqual(command, "noclip") && GetClientTeam(client) > 1 && IsPlayerAlive(client) == true) - ShowActivity2(client, "[SM] ", "Toggled noclip on target himself."); + if(StrEqual(command, "noclip") && IsPlayerAlive(client)) + ShowActivity2(client, "[SM] ", "toggled noclip on himself."); + LogAction(client, -1, "\"%L\" used cheat command: \"%s\"", client, command); return Plugin_Continue; } From 1c3352f08a3c82be59089f7c27ebb87caccd37fb Mon Sep 17 00:00:00 2001 From: Dogan Date: Tue, 28 May 2019 21:02:07 +0200 Subject: [PATCH 4/5] hlxstatsx_ze: dont be racist to zombies --- hlstatsx/scripting/hlstatsx_ze.sp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hlstatsx/scripting/hlstatsx_ze.sp b/hlstatsx/scripting/hlstatsx_ze.sp index c516fe2..0a09374 100644 --- a/hlstatsx/scripting/hlstatsx_ze.sp +++ b/hlstatsx/scripting/hlstatsx_ze.sp @@ -133,11 +133,18 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast bool bAwardZombies = ((g_tMinimalRoundDuration == INVALID_HANDLE) && (hEvent.GetInt("winner") == CS_TEAM_T)); int iAliveHumans; + int iAliveZombies; for (int client = 1; client <= MaxClients; client++) { if (IsValidClient(client) && GetClientTeam(client) == CS_TEAM_CT) + { iAliveHumans++; + } + else if(IsValidClient(client) && GetClientTeam(client) == CS_TEAM_T) + { + iAliveZombies++; + } } for (int client = 1; client <= MaxClients; client++) @@ -160,7 +167,12 @@ public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast } else if (bAwardZombies && g_bIsZombie[client]) { - if (g_bMotherZM[client]) + + if (iAliveZombies == 1) + { + LogPlayerEvent(client, "triggered", "ze_z_win_solo"); + } + else if (g_bMotherZM[client]) { char sPlayerEvent[32]; Format(sPlayerEvent, sizeof(sPlayerEvent), "ze_m_win_%d", g_cvarDifficultyZombie.IntValue); From c4e3b3a17cfe025a6e0aec57929a4e87e3452a7c Mon Sep 17 00:00:00 2001 From: Dogan Date: Fri, 31 May 2019 01:27:18 +0200 Subject: [PATCH 5/5] ExtraCommands: better sm_setscore make it possible to decrease or increase the current score --- ExtraCommands/scripting/ExtraCommands.sp | 46 +++++++++++++++++++----- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/ExtraCommands/scripting/ExtraCommands.sp b/ExtraCommands/scripting/ExtraCommands.sp index 5dc7104..a11fa79 100644 --- a/ExtraCommands/scripting/ExtraCommands.sp +++ b/ExtraCommands/scripting/ExtraCommands.sp @@ -51,7 +51,7 @@ public void OnPluginStart() RegAdminCmd("sm_modelscale", Command_ModelScale, ADMFLAG_GENERIC, "sm_modelscale <#userid|name> "); RegAdminCmd("sm_resize", Command_ModelScale, ADMFLAG_GENERIC, "sm_resize <#userid|name> "); RegAdminCmd("sm_setmodel", Command_SetModel, ADMFLAG_GENERIC, "sm_setmodel <#userid|name> "); - RegAdminCmd("sm_setscore", Command_SetScore, ADMFLAG_GENERIC, "sm_setscore <#userid|name> "); + RegAdminCmd("sm_setscore", Command_SetScore, ADMFLAG_GENERIC, "sm_setscore <#userid|name> <(optional +/-) value>"); RegAdminCmd("sm_setdeaths", Command_SetDeaths, ADMFLAG_GENERIC, "sm_setdeaths <#userid|name> "); RegAdminCmd("sm_setmvp", Command_SetMvp, ADMFLAG_GENERIC, "sm_setmvp <#userid|name> "); RegAdminCmd("sm_setteamscore", Command_SetTeamScore, ADMFLAG_GENERIC, "sm_setteamscore "); @@ -918,7 +918,7 @@ public Action Command_SetScore(int client, int argc) { if(argc < 2) { - ReplyToCommand(client, "[SM] Usage: sm_setscore <#userid|name> "); + ReplyToCommand(client, "[SM] Usage: sm_setscore <#userid|name> <(optional +/-) value>"); return Plugin_Handled; } @@ -932,25 +932,53 @@ public Action Command_SetScore(int client, int argc) GetCmdArg(1, sArgs, sizeof(sArgs)); GetCmdArg(2, sArgs2, sizeof(sArgs2)); - int iVal = StringToInt(sArgs2); - if((iTargetCount = ProcessTargetString(sArgs, client, iTargets, MAXPLAYERS, 0, sTargetName, sizeof(sTargetName), bIsML)) <= 0) { ReplyToTargetError(client, iTargetCount); return Plugin_Handled; } - for(int i = 0; i < iTargetCount; i++) + int iMode = 0; + int iVal; + + if(StrContains(sArgs2, "+", true) != -1) { - SetEntProp(iTargets[i], Prop_Data, "m_iFrags", iVal); + iMode = 1; + iVal = StringToInt(sArgs2[1]); + } + else if(StrContains(sArgs2, "-", true) != -1) + { + iMode = 2; + iVal = StringToInt(sArgs2[1]); + } + else + { + iVal = StringToInt(sArgs2); } - ShowActivity2(client, "\x01[SM] \x04", "\x01Set score to \x04%d\x01 on target \x04%s", iVal, sTargetName); + for(int i = 0; i < iTargetCount; i++) + { + if(iMode == 1) + { + SetEntProp(iTargets[i], Prop_Data, "m_iFrags", GetEntProp(iTargets[i], Prop_Data, "m_iFrags") + iVal); + ShowActivity2(client, "\x01[SM] \x04", "\x01Increased score by \x04%d\x01 on target \x04%s", iVal, sTargetName); + } + else if(iMode == 2) + { + SetEntProp(iTargets[i], Prop_Data, "m_iFrags", GetEntProp(iTargets[i], Prop_Data, "m_iFrags") - iVal); + ShowActivity2(client, "\x01[SM] \x04", "\x01Decreased score by \x04%d\x01 on target \x04%s", iVal, sTargetName); + } + else + { + SetEntProp(iTargets[i], Prop_Data, "m_iFrags", iVal); + ShowActivity2(client, "\x01[SM] \x04", "\x01Set score to \x04%d\x01 on target \x04%s", iVal, sTargetName); + } + } if(iTargetCount > 1) - LogAction(client, -1, "\"%L\" set score to \"%d\" on target \"%s\"", client, iVal, sTargetName); + LogAction(client, -1, "\"%L\" set score \"%s\" on target \"%s\"", client, sArgs2, sTargetName); else - LogAction(client, iTargets[0], "\"%L\" set score to \"%d\" on target \"%L\"", client, iVal, iTargets[0]); + LogAction(client, iTargets[0], "\"%L\" set score \"%s\" on target \"%L\"", client, sArgs2, iTargets[0]); return Plugin_Handled; }