def startKit(ID): gems = sql.valueAtNumber(ID, "gems", "gems") if gems == 0: sql.addGems(ID, 100) sql.add(ID, "pickaxe", 1, "inventory") sql.add(ID, "fishingrod", 1, "inventory") sql.add(ID, "shovel", 1, "inventory") sql.add(ID, "pickaxe", 20, "durability") sql.add(ID, "fishingrod", 20, "durability") sql.add(ID, "shovel", 20, "durability")
def admin(param): fct = param["fct"] arg2 = param["arg2"] arg3 = param["arg3"] arg4 = param["arg4"] msg = [] if fct == "playerid": if arg2 == "None": platform = param["name_pl"] else: platform = arg2 else: platform = param["name_pl"] if param["name_pl"] == "Admin" and fct != "playerid": PlayerID = int(param["ID"]) lang = "EN" else: ID = sql.get_SuperID(int(param["ID"]), platform) lang = param["lang"] if ID == "Error 404": msg = [ "WarningMsg", lang_P.forge_msg(lang, "WarningMsg", None, False, 0) ] return msg PlayerID = sql.get_PlayerID(ID, "gems") if fct == "init": sql.init() elif fct == "update": # arg2 = nameDB | arg3 = fieldName | arg4 = fieldValue desc = sql.updateField(PlayerID, arg3, arg4, arg2) elif fct == "add": # arg2 = nameDB | arg3 = nameElem | arg4 = nbElem desc = sql.add(PlayerID, arg3, arg4, arg2) elif fct == "value": # arg2 = nameDB | arg3 = nameElem desc = sql.valueAt(PlayerID, arg3, arg2) elif fct == "gems": # arg2 = nb gems desc = sql.addGems(PlayerID, arg2) elif fct == "spinelles": # arg2 = nb spinelles desc = sql.addSpinelles(PlayerID, arg2) elif fct == "balance total" or fct == 'balancetotal': desc = "Balance total" desc += "\n{}:gem:".format(sql.countTotalGems()) spinelleidmoji = "{idmoji[spinelle]}" desc += "\n{0}<:spinelle:{1}>".format(sql.countTotalSpinelles(), spinelleidmoji) elif fct == "playerid": desc = "PlayerID: {}".format(PlayerID) else: desc = ":regional_indicator_s::regional_indicator_q::regional_indicator_l:" msg.append("Admin {}".format(fct)) msg.append(lang) msg.append(str(desc)) return msg
def checklevel(ID): lang = sql.valueAtNumber(ID, "LANG", "IDs") if lang == None: lang = "EN" if ID == "Error 404": msg = [ "WarningMsg", lang_P.forge_msg(lang, "WarningMsg", None, False, 0) ] return msg PlayerID = sql.get_PlayerID(ID, "gems") # print(PlayerID) msg = [] S = success.checkSuccess(PlayerID, lang) try: lvl = sql.valueAtNumber(PlayerID, "lvl", "gems") xp = sql.valueAtNumber(PlayerID, "xp", "gems") palier = lvlPalier(lvl) desc = "" if xp >= palier: lvl = lvl + 1 sql.updateField(PlayerID, "lvl", lvl, "gems") desc = lang_P.forge_msg(lang, "level", [lvl], False, 0) nbG = 100 * lvl sql.addGems(PlayerID, nbG) desc += lang_P.forge_msg(lang, "level", [nbG], False, 1) msg.append("Level UP") else: msg.append("Level OK") msg.append(desc) if S != []: msg.append(S) except: print("Level >> Le joueur n'existe pas.") msg.append("Level NOK") msg.append("Le joueur n'existe pas") return msg