added double barrel shotgun

This commit is contained in:
2023-07-22 15:57:17 +02:00
parent 20e2aae0f5
commit db983a5ea7
6 changed files with 7 additions and 5 deletions
-1
View File
@@ -162,7 +162,6 @@ cython_debug/
# token # token
/discordtoken /discordtoken
#images #images
/Reuse/images
Reuse/images/legend.png Reuse/images/legend.png
Reuse/images/player_weapons_used.png Reuse/images/player_weapons_used.png
Reuse/images/leaderboard.png Reuse/images/leaderboard.png
+3 -1
View File
@@ -13,7 +13,9 @@ def getleaderboard(board:str, weaponid="", server="", mapid = "", gamemodeid = "
board = "max_distance" board = "max_distance"
if(board.lower() == "kd"): if(board.lower() == "kd"):
handler = lambda p : response[p]['kills'] / max(response[p]["deaths_while_equipped"], 1) if(weaponid != ""):
handler = lambda p : response[p]['kills'] / max(response[p]["deaths_while_equipped"], 1)
handler = lambda p : response[p]['kills'] / max(response[p]["deaths"], 1)
elif(board.lower() == "avgd"): elif(board.lower() == "avgd"):
handler = lambda p : response[p]['total_distance'] / max(response[p]["kills"], 1) handler = lambda p : response[p]['total_distance'] / max(response[p]["kills"], 1)
else: else:
+2 -1
View File
@@ -44,7 +44,8 @@ def getweaponid(givenweapon):
"p2016": "mp_weapon_semipistol", "p2016": "mp_weapon_semipistol",
"arc grenade": "mp_weapon_grenade_emp", "arc grenade": "mp_weapon_grenade_emp",
"hemlok": "mp_weapon_hemlok", "hemlok": "mp_weapon_hemlok",
"phase shift": "phase_shift" "phase shift": "phase_shift",
"double barrel shotgun": "mp_weapon_shotgun_doublebarrel"
} }
weaponid = "" weaponid = ""
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

+1 -1
View File
@@ -52,7 +52,7 @@ class SlashLeaderboard(commands.Cog):
@leaderboard.autocomplete("weapon") @leaderboard.autocomplete("weapon")
async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]: async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]:
data = [] data = []
weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift'] weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift', 'double barrel shotgun']
for weapon_choice in weaponlist: for weapon_choice in weaponlist:
if(current.lower() in weapon_choice.lower()): if(current.lower() in weapon_choice.lower()):
data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice)) data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice))
+1 -1
View File
@@ -79,7 +79,7 @@ class SlashStats(commands.Cog):
@stats.autocomplete("weapon") @stats.autocomplete("weapon")
async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]: async def autocomplete_weapon(self, interaction: discord.Interaction, current: str) -> list[app_commands.Choice[str]]:
data = [] data = []
weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift'] weaponlist = ['execution', 'car', 'charge rifle', 'double take', 'epg', 'volt', 'lstar', 'r97', 'r-201', 'smart pistol', 'kraber', 'flatline', 're-45 auto', 'alternator', 'frag grenade', 'g2', 'spitfire', 'smr', 'softball', 'firestar', 'melee', 'mastiff', 'mgl', 'r-101', 'wingman', 'invalid', 'thunderbolt', 'dmr', 'electric smoke', 'cold war', 'satchel', 'eva-8 auto', 'mozambique', 'wingman elite', 'gravity star', 'pulse blade', 'archer', 'outOfBounds', 'mind crime', 'devotion', 'fall', 'p2016', 'arc grenade', 'hemlok', 'phase shift', 'double barrel shotgun']
for weapon_choice in weaponlist: for weapon_choice in weaponlist:
if(current.lower() in weapon_choice.lower()): if(current.lower() in weapon_choice.lower()):
data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice)) data.append(app_commands.Choice(name=weapon_choice, value=weapon_choice))