예제 #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);
     }
 }