add player name as Hint target

This commit is contained in:
Fabian Dill 2020-01-13 01:23:29 +01:00
parent 85a4e9d409
commit 2fad46c26e
1 changed files with 22 additions and 13 deletions

View File

@ -336,7 +336,16 @@ async def console(ctx : Context):
print("Unknown item: " + item)
elif command[0] == '/hint':
if len(command) > 2:
player_number = 0
if command[1].isnumeric():
player_number = int(command[1])
else:
client = get_client_from_name(ctx, command[1])
if client:
player_number = client.slot()
else:
print(f"Player with name {command[1]} not found.")
if player_number:
item = " ".join(command[2:])
if item in Items.item_table:
seeked_item_id = Items.item_table[item][3]
@ -350,7 +359,7 @@ async def console(ctx : Context):
else:
print("Unknown item: " + item)
else:
print("Use /hint {playernumber} {itemname}\nFor example /hint 1 Lamp")
print("Use /hint {Playernumber/Playername} {itemname}\nFor example /hint 1 Lamp")
elif command[0][0] != '/':
notify_all(ctx, '[Server]: ' + input)
except Exception as e: