Пример #1
0
 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);
     }
 }
Пример #2
0
 public static int TryGetInt(this ServerPlayer player, string name)
 {
     if (player.ContainsValueName(name))
     {
         return((int)((long)player.GetExtraValue(name)));
     }
     else
     {
         return(0);
     }
 }