adding minute support from unloze playtime into discord message, entwatch, knifeban and spraymanager

This commit is contained in:
jenz
2026-01-27 18:55:28 +01:00
parent 7d940c6509
commit 41b775f611
5 changed files with 284 additions and 77 deletions
+5 -2
View File
@@ -62,6 +62,7 @@ char g_sSprayHash[MAXPLAYERS + 1][16];
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_iClientSprayLifetime[MAXPLAYERS + 1] = { 2, ... };
int g_iSprayLifetime[MAXPLAYERS + 1];
@@ -338,9 +339,10 @@ public void OnClientPostAdminCheck(int client)
UpdateHideSprays();
}
public void GetPlayerHoursServer(int client, int hours)
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;
}
@@ -2277,7 +2279,7 @@ public Action HookDecal(const char[] sTEName, const int[] iClients, int iNumClie
//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);
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);
return Plugin_Handled;
}
@@ -3329,6 +3331,7 @@ stock void ClearPlayerInfo(int client)
g_bMarkedNSFWByAdmin[client] = false;
g_bFullFillHourRequirement[client] = false;
g_iClientHoursNotFullFilled[client] = 0;
g_iClientMinutesNotFullFilled[client] = 0;
}
stock void UpdateClientToClientSprayLifeTime(int client, int iLifeTime)