Code: Show/Hide def get_money(p): kp = stats.GetStat(p, STAT_KILL_POINTS, INTERVAL_RESET) fp = stats.GetStat(p, STAT_FLAG_POINTS, INTERVAL_RESET) return kp + fp def subtract_money(p, amount): if amount > 0: fp = stats.GetStat(p, STAT_FLAG_POINTS, INTERVAL_RESET) fp -= amount stats.SetStat(p, STAT_FLAG_POINTS, INTERVAL_RESET, fp) stats.SendUpdates() def c_buy(cmd, params, p, targ): # spec can't buy if len(params) > 0 and p.ship == SHIP_SPEC: chat.SendMessage(p, "Sorry, you cannot buy from spec.") return money = get_money(p) if params == "nades": if money >= 100000: subtract_money(p, 100000) do_nades(p) |
Code: Show/Hide import * from asss
cfg = get_interface(I_CONFIG) def set_doormode(arena, newdoormode): cfg.SetInt(arena.cfg, "Door", "DoorMode", newdoormode, "", false) call_callback(CB_ARENAACTION, (arena, AA_CONFCHANGED)) def mm_attach(a): set_doormode(a, 127) def mm_detach(a): set_doormode(a, -2) |