diff --git a/BossHP/scripting/BossHP_Ranking.sp b/BossHP/scripting/BossHP_Ranking.sp index 5a090757..720bac27 100644 --- a/BossHP/scripting/BossHP_Ranking.sp +++ b/BossHP/scripting/BossHP_Ranking.sp @@ -7,6 +7,9 @@ ArrayList g_hStats[MAXPLAYERS+1]; + +bool g_bLoadedLate; + //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- @@ -18,6 +21,33 @@ public Plugin myinfo = version = "1.0.0", }; +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public APLRes AskPluginLoad2(Handle hThis, bool bLate, char[] err, int iErrLen) +{ + g_bLoadedLate = bLate; + + return APLRes_Success; +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public void OnPluginStart() +{ + if (g_bLoadedLate) + { + for (int i = 1; i <= MaxClients; i++) + { + if (!IsClientInGame(i) || IsFakeClient(i)) + continue; + + OnClientPutInServer(i); + } + } +} + //---------------------------------------------------------------------------------------------------- // Purpose: //---------------------------------------------------------------------------------------------------- @@ -119,8 +149,14 @@ public void OnBossKilled(any Boss, int reason) if (iSortedCount) { + char sBossName[64]; + CBoss _Boss = view_as(Boss); + CConfig Config = _Boss.dConfig; + Config.GetName(sBossName, sizeof(sBossName)) + delete Config; + char sBuffer[512]; - Format(sBuffer, sizeof(sBuffer), "BOSS DAMAGE:"); + Format(sBuffer, sizeof(sBuffer), "BOSS DAMAGE [%s]:", sBossName); Format(sBuffer, sizeof(sBuffer), "%s\n*************************", sBuffer); if (iSortedList[0][0]) Format(sBuffer, sizeof(sBuffer), "%s\n1. %N - %d hits", sBuffer, iSortedList[0][0], iSortedList[0][1]);