moved playtime restrictions from hour requirement over to tier requirement
This commit is contained in:
parent
7ec6fed775
commit
e86e90838a
@ -54,7 +54,7 @@ int g_iClientMinutes[MAXPLAYERS + 1];
|
||||
StringMap g_hTrie_Storage;
|
||||
|
||||
/* CONVARS */
|
||||
ConVar g_cvarHourRequirement = null;
|
||||
ConVar g_cvarItemTierRequirement = null;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
@ -118,7 +118,7 @@ public void OnPluginStart()
|
||||
OnClientCookiesCached(client);
|
||||
}
|
||||
|
||||
g_cvarHourRequirement = CreateConVar("sm_entwatch_hour_requirement", "10", "Using the unloze play time plugin to set a minimum amount of hours for allowing players access to items.");
|
||||
g_cvarItemTierRequirement = CreateConVar("sm_entwatch_tier_requirement", "1", "Using the unloze play time plugin to set a tier for allowing players access to items.");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -289,7 +289,8 @@ public Action Command_DisplayRestrictions(int client, int args)
|
||||
{
|
||||
if (ClientRestricted(i))
|
||||
{
|
||||
if (g_iClientHours[i] < g_cvarHourRequirement.IntValue)
|
||||
int client_tier = GetPlayerTier_native(i);
|
||||
if (client_tier < g_cvarItemTierRequirement.IntValue)
|
||||
{
|
||||
GetClientName(i, aBuf2_time_requirement, sizeof(aBuf2_time_requirement));
|
||||
StrCat(aBuf_time_requirement, sizeof(aBuf_time_requirement), aBuf2_time_requirement);
|
||||
@ -316,10 +317,10 @@ public Action Command_DisplayRestrictions(int client, int args)
|
||||
if (strlen(aBuf_time_requirement))
|
||||
{
|
||||
aBuf_time_requirement[strlen(aBuf_time_requirement) - 2] = 0;
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sCurrent clients with not enough playtime: \x07%s%s", "E01B5D", "F16767", "EDEDED", aBuf_time_requirement);
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sCurrent clients with not high enough Tier: \x07%s%s", "E01B5D", "F16767", "EDEDED", aBuf_time_requirement);
|
||||
}
|
||||
else
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sCurrent clients with not enough playtime: \x07%snone", "E01B5D", "F16767", "EDEDED");
|
||||
CReplyToCommand(client, "\x07%s[entWatch] \x07%sCurrent clients with not high enoughouh Tier: \x07%snone", "E01B5D", "F16767", "EDEDED");
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
@ -602,12 +603,13 @@ stock bool ClientRestricted(int client)
|
||||
}
|
||||
}
|
||||
|
||||
//hour requirement for picking up items
|
||||
if (g_iClientHours[client] < g_cvarHourRequirement.IntValue)
|
||||
//tier requirement for picking up items
|
||||
int client_tier = GetPlayerTier_native(client);
|
||||
if (client_tier < g_cvarItemTierRequirement.IntValue)
|
||||
{
|
||||
if (!g_bDontSpamMsg[client])
|
||||
{
|
||||
CPrintToChat(client, "\x07%s[entWatch] \x07%s You have \x07%s%i\x07%s hours and \x07%s%i\x07%s minutes playtime and need %i hours for picking up items.", "E01B5D", "EDEDED", "EDEDED", g_iClientHours[client], "EDEDED", "EDEDED", g_iClientMinutes[client], "EDEDED", g_cvarHourRequirement.IntValue);
|
||||
CPrintToChat(client, "\x07%s[entWatch] \x07%s You need to reach Tier \x07%s%i\x07%s for picking up items.", "E01B5D", "EDEDED", "EDEDED", g_cvarItemTierRequirement.IntValue, "EDEDED");
|
||||
g_bDontSpamMsg[client] = true;
|
||||
CreateTimer(1.0, allow_message_again, GetClientSerial(client));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user