Hello, could you please add the OnPointsUpdated hook, which will be called upon the update of points?
Something like this:
private void OnPointsUpdated(ulong userID, int amount)
Line 1800:
private object AddPoints(object userID, int amount)
{
ulong ID;
object success = GetUserID(userID);
if (success is bool)
return false;
else ID = (ulong)success;
if (!playerRP.ContainsKey(ID))
playerRP.Add(ID, amount);
else playerRP[ID] += amount;
if (configData.Options.Logs)
{
string message = string.Empty;
BasePlayer player = BasePlayer.FindByID(ID);
if (player != null)
message = $"{ID} - {player.displayName} has been given {amount}x RP";
else message = $"(offline){ID} has been given {amount}x RP";
LogToFile($"Earnings", $"[{DateTime.Now.ToString("hh:mm:ss")}] {message}", this);
}
Interface.CallHook("OnPointsUpdated", ID, playerRP[ID]);//Like this
return true;
}
private object TakePoints(object userID, int amount, string item = "")
{
ulong ID;
object success = GetUserID(userID);
if (success is bool)
return false;
else ID = (ulong)success;
if (!playerRP.ContainsKey(ID)) return null;
playerRP[ID] -= amount;
if (configData.Options.Logs)
{
string message = string.Empty;
BasePlayer player = BasePlayer.FindByID(ID);
if (player != null)
message = $"{ID} - {player.displayName} has spent {amount}x RP{(string.IsNullOrEmpty(item) ? string.Empty : $" on: {item}")}";
else message = $"(offline){ID} has spent {amount}x RP";
LogToFile($"SpentRP", $"[{DateTime.Now.ToString("hh:mm:ss")}] {message}", this);
}
Interface.CallHook("OnPointsUpdated", ID, playerRP[ID]);//Like this
return true;
}