From cf58c745d2eda452f97778ceccde8bf5b357d941 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 9 Jun 2025 17:51:38 +0200 Subject: [PATCH 1/3] fixing minor mistake --- mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp index 779d12b..da1e7ca 100755 --- a/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp +++ b/mapchooser_extended/scripting/mapchooser_extended_avg_mapend.sp @@ -772,7 +772,7 @@ public void OnMapTimeLeftChanged() void SetupTimeleftTimer() { - if (g_iNextmapState == 0 && GetConVarInt(g_Cvar_Extend) - g_Extends < 1) + if (g_iNextmapState == 0 && GetConVarInt(g_Cvar_Extend) == 0) { g_iNextmapState = 3; //map simply had no extend to begin with. mce_extend 0. From 3ec612167d465004eefe1452793993ff8a0830f7 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 9 Jun 2025 20:31:34 +0200 Subject: [PATCH 2/3] added play time requirement for being allowed to spray --- SprayManager/scripting/SprayManager.sp | 31 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/SprayManager/scripting/SprayManager.sp b/SprayManager/scripting/SprayManager.sp index 7626b87..ed6175c 100644 --- a/SprayManager/scripting/SprayManager.sp +++ b/SprayManager/scripting/SprayManager.sp @@ -5,6 +5,9 @@ #include #include +//add some hour requirement for being allowed to spray +#include + #undef REQUIRE_PLUGIN #include #define REQUIRE_PLUGIN @@ -35,6 +38,7 @@ ConVar g_cvarUseProximityCheck = null; ConVar g_cvarSendSpraysToConnectingClients = null; ConVar g_cvarUsePersistentSprays = null; ConVar g_cvarMaxSprayLifetime = null; +ConVar g_cvarHourRequirement = null; int g_iNSFWDecalIndex; int g_iHiddenDecalIndex; @@ -49,6 +53,7 @@ bool g_bGotBlacklist; bool g_bGotNSFWList; bool g_bFullyConnected; bool g_bSkipDecalHook; +bool g_bFullFillHourRequirement[MAXPLAYERS + 1] = {false,...}; char g_sBanIssuer[MAXPLAYERS + 1][64]; char g_sBanIssuerSID[MAXPLAYERS + 1][32]; @@ -56,6 +61,7 @@ char g_sBanReason[MAXPLAYERS + 1][32]; char g_sSprayHash[MAXPLAYERS + 1][16]; char g_csSID[MAXPLAYERS + 1][65]; +int g_iClientHoursNotFullFilled[MAXPLAYERS + 1]; int g_iClientToClientSprayLifetime[MAXPLAYERS + 1][MAXPLAYERS + 1]; int g_iClientSprayLifetime[MAXPLAYERS + 1] = { 2, ... }; int g_iSprayLifetime[MAXPLAYERS + 1]; @@ -85,7 +91,7 @@ public Plugin myinfo = { name = "Spray Manager", description = "A plugin to help manage player sprays.", - author = "Obus", + author = "Obus blabla", version = "2.1.1", url = "" } @@ -156,6 +162,8 @@ public void OnPluginStart() g_cvarMaxSprayLifetime = CreateConVar("sm_spraymanager_maxspraylifetime", "2", "If not using persistent sprays, remove sprays after their global lifetime (in rounds) exceeds this number"); + g_cvarHourRequirement = CreateConVar("sm_spraymanager_hour_requirement", "5", "Using the unloze play time plugin to set a minimum amount of hours for allowing players access to spraying."); + AutoExecConfig(true, "plugin.SprayManager"); g_hTraceTimer = CreateTimer(0.25, Timer_PerformPlayerTraces, _, TIMER_REPEAT); @@ -330,6 +338,12 @@ public void OnClientPostAdminCheck(int client) UpdateHideSprays(); } +public void GetPlayerHoursServer(int client, int hours) +{ + g_iClientHoursNotFullFilled[client] = hours; + g_bFullFillHourRequirement[client] = g_iClientHoursNotFullFilled[client] > g_cvarHourRequirement.IntValue ? true : false; +} + public void update_client_online(int client, int is_online) { if (!g_hDatabase) @@ -363,7 +377,7 @@ public void OnClientDisconnect(int client) update_client_online(client, 0); } - + ClearPlayerInfo(client); UpdateHideSprays(); } @@ -2150,7 +2164,7 @@ public Action Command_ForceSFW(int client, int argc) return Plugin_Handled; AdminForceSpraySFW(iTarget); - PrintToChat(client, "\x01\x04[SprayManager]\x01 Marked \x04%N\x01's spray as SFW.", iTarget); + PrintToChat(client, "\x01\x04[SprayManager]\x01 Marked \x04%N\x01 spray as SFW.", iTarget); return Plugin_Handled; } @@ -2165,7 +2179,7 @@ public Action Command_ForceSFW(int client, int argc) continue; AdminForceSpraySFW(i); - PrintToChat(client, "\x01\x04[SprayManager]\x01 Marked \x04%N\x01's spray as SFW.", i); + PrintToChat(client, "\x01\x04[SprayManager]\x01 Marked \x04%N\x01s spray as SFW.", i); return Plugin_Handled; } @@ -2260,6 +2274,13 @@ public Action HookDecal(const char[] sTEName, const int[] iClients, int iNumClie return Plugin_Handled; } + //check for an arbitrary amount of hours before allowing spraying + if (!g_bFullFillHourRequirement[client]) + { + PrintToChat(client, "\x01\x04[SprayManager]\x01 You cannot spray because you dont have enough play time yet. (\x04%i/\x04%i\x01 hours)", g_iClientHoursNotFullFilled[client], g_cvarHourRequirement.IntValue); + return Plugin_Handled; + } + if (g_fNextSprayTime[client] > GetGameTime()) return Plugin_Handled; @@ -3306,6 +3327,8 @@ stock void ClearPlayerInfo(int client) g_SprayAABB[client] = view_as({ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }); //??? g_bHasNSFWSpray[client] = false; g_bMarkedNSFWByAdmin[client] = false; + g_bFullFillHourRequirement[client] = false; + g_iClientHoursNotFullFilled[client] = 0; } stock void UpdateClientToClientSprayLifeTime(int client, int iLifeTime) From 6a0b75ed61affbcdde6ea67944beb782a4c102a7 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 30 Jun 2025 17:16:49 +0200 Subject: [PATCH 3/3] not including nosteamers again. very simply --- .../scripting/rockthevote_extended_avg.sp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mapchooser_extended/scripting/rockthevote_extended_avg.sp b/mapchooser_extended/scripting/rockthevote_extended_avg.sp index aa6cea0..c92b444 100755 --- a/mapchooser_extended/scripting/rockthevote_extended_avg.sp +++ b/mapchooser_extended/scripting/rockthevote_extended_avg.sp @@ -201,6 +201,10 @@ public int Native_GetRtvPercentageForClient(Handle plugin, int numParams) UpdateRTV(); int player_worth_rtv = GetPlayerWorthRTV_boost_(client); + if (player_worth_rtv < 1) + { + player_worth_rtv = 1; + } return player_worth_rtv; } @@ -209,7 +213,7 @@ void update_g_VotesNeeded() int iVoters = 0; for (int i=1; i<=MaxClients; i++) { - if (IsClientInGame(i) && !IsFakeClient(i) && !is_bot_player[i]) + if (IsClientInGame(i) && !IsFakeClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(i)) { if (GetClientIdleTime(i) >= g_Cvar_AFKTime.IntValue) continue; @@ -250,6 +254,10 @@ public int get_voted_rtv() if (IsValidClient(i) && g_Voted[i]) { int player_worth_boost = GetPlayerWorthRTV_boost_(i); + if (player_worth_boost < 1) + { + player_worth_boost = 1; + } Votes += player_worth_boost; } } @@ -481,7 +489,7 @@ public Action Command_DebugRTV(int client, int args) for (int i=1; i<=MaxClients; i++) { - if (IsClientInGame(i) && !IsFakeClient(i) && !is_bot_player[i]) + if (IsClientInGame(i) && !IsFakeClient(i) && !is_bot_player[i] && PM_IsPlayerSteam(i)) { if (GetClientIdleTime(i) >= g_Cvar_AFKTime.IntValue) continue;