adding sprays as a tier instead of hour requirement
This commit is contained in:
parent
76c110f5eb
commit
f9eed6291d
@ -21,5 +21,6 @@ native int GetPlayerWorthRTV_boost_(int client);
|
||||
* @int Game time minutes the client has on the server.
|
||||
*/
|
||||
|
||||
native int GetPlayerTier_native(int client); //just the clients tier
|
||||
forward void GetPlayerHoursServer(int client, int hours, int minutes);
|
||||
forward void GetPlayerTier(int client, int tier);
|
||||
|
||||
@ -225,6 +225,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char [] error, int err_ma
|
||||
{
|
||||
CreateNative("GetAveragePlayerTimeOnServer", Native_GetAveragePlayerActiveTimeServer);
|
||||
CreateNative("GetPlayerWorthRTV_boost_", Native_GetPlayerWorthRTV_boost);
|
||||
CreateNative("GetPlayerTier_native", Native_GetPlayerTier);
|
||||
|
||||
g_hForwardPlayerHours = CreateGlobalForward("GetPlayerHoursServer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
|
||||
g_hForwardPlayerTier = CreateGlobalForward("GetPlayerTier", ET_Ignore, Param_Cell, Param_Cell);
|
||||
@ -275,6 +276,23 @@ public int Native_GetAveragePlayerActiveTimeServer(Handle plugin, int numParams)
|
||||
return GetAveragePlayerActiveTimeServer();
|
||||
}
|
||||
|
||||
public int Native_GetPlayerTier(Handle plugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(1);
|
||||
if(client > MaxClients || client <= 0)
|
||||
{
|
||||
ThrowNativeError(SP_ERROR_NATIVE, "Client is not valid.");
|
||||
return view_as<int>(-1);
|
||||
}
|
||||
|
||||
if(!IsClientInGame(client))
|
||||
{
|
||||
ThrowNativeError(SP_ERROR_NATIVE, "Client is not in-game.");
|
||||
return view_as<int>(-1);
|
||||
}
|
||||
return g_iPlayerTier[client];
|
||||
}
|
||||
|
||||
public int Native_GetPlayerWorthRTV_boost(Handle plugin, int numParams)
|
||||
{
|
||||
int client = GetNativeCell(1);
|
||||
@ -801,6 +819,10 @@ public void PrintClientGroupOverrides(int client)
|
||||
|
||||
char rtv_boost_tier[32];
|
||||
Format(rtv_boost_tier, sizeof(rtv_boost_tier), "tier%i", g_iRtvBoost_tier);
|
||||
|
||||
char spray_tier[32];
|
||||
Format(spray_tier, sizeof(spray_tier), "tier%i", FindConVar("sm_spraymanager_tier_required").IntValue);
|
||||
|
||||
for (int i = 0; i < groupCount; i++)
|
||||
{
|
||||
char groupName[64];
|
||||
@ -814,6 +836,10 @@ public void PrintClientGroupOverrides(int client)
|
||||
{
|
||||
PrintToChat(client, "tier%i access: %i mapvote/rtv/nomination boost", g_iRtvBoost_tier, g_iPlayerRTVCapacity);
|
||||
}
|
||||
if (StrEqual(groupName, spray_tier))
|
||||
{
|
||||
PrintToChat(client, "%s access: sprays",spray_tier );
|
||||
}
|
||||
if (g_GroupOverrides.GetString(groupName, overrides, sizeof(overrides)))
|
||||
{
|
||||
PrintToChat(client, "%s access: %s", groupName, overrides);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user