replaced hour requirement with tier requirement

This commit is contained in:
jenz 2026-06-17 10:54:56 +02:00
parent e5974b7478
commit 7ec6fed775

View File

@ -38,7 +38,7 @@ ConVar g_cvarUseProximityCheck = null;
ConVar g_cvarSendSpraysToConnectingClients = null; ConVar g_cvarSendSpraysToConnectingClients = null;
ConVar g_cvarUsePersistentSprays = null; ConVar g_cvarUsePersistentSprays = null;
ConVar g_cvarMaxSprayLifetime = null; ConVar g_cvarMaxSprayLifetime = null;
ConVar g_cvarHourRequirement = null; ConVar g_cvarSprayTierRequired = null;
int g_iNSFWDecalIndex; int g_iNSFWDecalIndex;
int g_iHiddenDecalIndex; int g_iHiddenDecalIndex;
@ -53,7 +53,6 @@ bool g_bGotBlacklist;
bool g_bGotNSFWList; bool g_bGotNSFWList;
bool g_bFullyConnected; bool g_bFullyConnected;
bool g_bSkipDecalHook; bool g_bSkipDecalHook;
bool g_bFullFillHourRequirement[MAXPLAYERS + 1] = {false,...};
char g_sBanIssuer[MAXPLAYERS + 1][64]; char g_sBanIssuer[MAXPLAYERS + 1][64];
char g_sBanIssuerSID[MAXPLAYERS + 1][32]; char g_sBanIssuerSID[MAXPLAYERS + 1][32];
@ -61,8 +60,6 @@ char g_sBanReason[MAXPLAYERS + 1][32];
char g_sSprayHash[MAXPLAYERS + 1][16]; char g_sSprayHash[MAXPLAYERS + 1][16];
char g_csSID[MAXPLAYERS + 1][65]; char g_csSID[MAXPLAYERS + 1][65];
int g_iClientHoursNotFullFilled[MAXPLAYERS + 1];
int g_iClientMinutesNotFullFilled[MAXPLAYERS + 1];
int g_iClientToClientSprayLifetime[MAXPLAYERS + 1][MAXPLAYERS + 1]; int g_iClientToClientSprayLifetime[MAXPLAYERS + 1][MAXPLAYERS + 1];
int g_iClientSprayLifetime[MAXPLAYERS + 1] = { 2, ... }; int g_iClientSprayLifetime[MAXPLAYERS + 1] = { 2, ... };
int g_iSprayLifetime[MAXPLAYERS + 1]; int g_iSprayLifetime[MAXPLAYERS + 1];
@ -163,7 +160,7 @@ 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_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."); g_cvarSprayTierRequired = CreateConVar("sm_spraymanager_tier_required", "1", "Using the unloze play time plugin to set a minimum tier for allowing players access to spraying.");
AutoExecConfig(true, "plugin.SprayManager"); AutoExecConfig(true, "plugin.SprayManager");
@ -339,13 +336,6 @@ public void OnClientPostAdminCheck(int client)
UpdateHideSprays(); UpdateHideSprays();
} }
public void GetPlayerHoursServer(int client, int hours, int minutes)
{
g_iClientHoursNotFullFilled[client] = hours;
g_iClientMinutesNotFullFilled[client] = minutes;
g_bFullFillHourRequirement[client] = g_iClientHoursNotFullFilled[client] > g_cvarHourRequirement.IntValue ? true : false;
}
public void update_client_online(int client, int is_online) public void update_client_online(int client, int is_online)
{ {
if (!g_hDatabase) if (!g_hDatabase)
@ -2277,9 +2267,11 @@ public Action HookDecal(const char[] sTEName, const int[] iClients, int iNumClie
} }
//check for an arbitrary amount of hours before allowing spraying //check for an arbitrary amount of hours before allowing spraying
if (!g_bFullFillHourRequirement[client]) int clientTier = GetPlayerTier_native(client);
int TierRequired = g_cvarSprayTierRequired.IntValue;
if (TierRequired > clientTier)
{ {
PrintToChat(client, "\x01\x04[SprayManager]\x01 You cannot spray because you dont have enough play time yet. (You have \x04%i Hours and \x04%i minutes. You need \x04%i\x01 hours)", g_iClientHoursNotFullFilled[client], g_iClientMinutesNotFullFilled[client], g_cvarHourRequirement.IntValue); PrintToChat(client, "\x01\x04[SprayManager]\x01 You cannot spray because you dont have reached tier %i yet. (You have tier \x04%i)", TierRequired, clientTier);
return Plugin_Handled; return Plugin_Handled;
} }
@ -3329,9 +3321,6 @@ stock void ClearPlayerInfo(int client)
g_SprayAABB[client] = view_as<float>({ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }); //??? g_SprayAABB[client] = view_as<float>({ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }); //???
g_bHasNSFWSpray[client] = false; g_bHasNSFWSpray[client] = false;
g_bMarkedNSFWByAdmin[client] = false; g_bMarkedNSFWByAdmin[client] = false;
g_bFullFillHourRequirement[client] = false;
g_iClientHoursNotFullFilled[client] = 0;
g_iClientMinutesNotFullFilled[client] = 0;
} }
stock void UpdateClientToClientSprayLifeTime(int client, int iLifeTime) stock void UpdateClientToClientSprayLifeTime(int client, int iLifeTime)