added forward when tier arrived

This commit is contained in:
jenz 2026-06-16 01:33:14 +02:00
parent b4a943d987
commit b617d12870
2 changed files with 8 additions and 1 deletions

View File

@ -22,3 +22,4 @@ native int GetPlayerWorthRTV_boost_(int client);
*/
forward void GetPlayerHoursServer(int client, int hours, int minutes);
forward void GetPlayerTier(int client, int tier);

View File

@ -20,6 +20,7 @@ int g_iAvgHour_Contribution_per_player;
int g_iPlayerTier[MAXPLAYERS + 1];
static Handle g_hForwardPlayerHours;
static Handle g_hForwardPlayerTier;
public Plugin myinfo =
{
@ -147,6 +148,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char [] error, int err_ma
CreateNative("GetPlayerWorthRTV_boost_", Native_GetPlayerWorthRTV_boost);
g_hForwardPlayerHours = CreateGlobalForward("GetPlayerHoursServer", ET_Ignore, Param_Cell, Param_Cell, Param_Cell);
g_hForwardPlayerTier = CreateGlobalForward("GetPlayerTier", ET_Ignore, Param_Cell, Param_Cell);
return APLRes_Success;
}
@ -231,6 +233,7 @@ public void OnPluginEnd()
if (g_h_time_activity != null)
delete g_h_time_activity;
CloseHandle(g_hForwardPlayerHours);
CloseHandle(g_hForwardPlayerTier);
}
public void SQL_OnDatabaseConnect(Database db, const char[] error, any data)
@ -413,7 +416,10 @@ public void SetPlayerTier(int client)
} while (kv.GotoNextKey(false));
PrintToChat(client, "Your Player Tier is %i", g_iPlayerTier[client]);
Call_StartForward(g_hForwardPlayerTier);
Call_PushCell(client);
Call_PushCell(g_iPlayerTier[client]);
Call_Finish();
delete kv;
}