public static void TryAddInt(this ServerPlayer player, string name, int inc) { if (player.ContainsValueName(name)) { player.ModifyExtraValue(name, (long)player.GetExtraValue(name) + (long)inc); } else { player.ModifyExtraValue(name, (long)inc); } }
public static int TryGetInt(this ServerPlayer player, string name) { if (player.ContainsValueName(name)) { return((int)((long)player.GetExtraValue(name))); } else { return(0); } }