mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-10-16 12:02:51 +00:00
Update CoinCmds.py
This commit is contained in:
parent
703955f333
commit
c94f86da32
1 changed files with 12 additions and 6 deletions
|
|
@ -255,12 +255,18 @@ def buy(arguments, clientid, accountid):
|
|||
if havecoins >= costofeffect:
|
||||
customers = pdata.get_custom()['paideffects']
|
||||
if accountid not in customers:
|
||||
dayss = settings["Paideffects"]["timedelta"]
|
||||
settime = settings["Paideffects"]["ExpriyPaideffectTime"]
|
||||
expiry = datetime.now() + timedelta(dayss=settime)
|
||||
setdate = settings["Paideffects"]["timedelta"]
|
||||
settime = int(settings["Paideffects"]["ExpriyPaideffectTime"])
|
||||
# Map unit string to timedelta attribute
|
||||
unit_map = {'years': 'years', 'days': 'days', 'hours': 'hours', 'minutes': 'minutes', 'seconds': 'seconds'}
|
||||
if setdate in unit_map:
|
||||
setdate_attr = unit_map[setdate]
|
||||
expiry = datetime.now() + timedelta(**{setdate_attr: settime})
|
||||
customers[accountid] = {'effect': effect, 'expiry': expiry.strftime('%d-%m-%Y %H:%M:%S')}
|
||||
addcoins(accountid, costofeffect * -1)
|
||||
_ba.chatmessage(f"Success! That cost you {str(costofeffect)}{tic}")
|
||||
else:
|
||||
_ba.chatmessage("Invalid timedelta unit in settings.")
|
||||
else:
|
||||
activeeffect = customers[accountid]['effect']
|
||||
till = customers[accountid]['expiry']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue