mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
add player name as Hint target
This commit is contained in:
@@ -336,7 +336,16 @@ async def console(ctx : Context):
|
|||||||
print("Unknown item: " + item)
|
print("Unknown item: " + item)
|
||||||
elif command[0] == '/hint':
|
elif command[0] == '/hint':
|
||||||
if len(command) > 2:
|
if len(command) > 2:
|
||||||
|
player_number = 0
|
||||||
|
if command[1].isnumeric():
|
||||||
player_number = int(command[1])
|
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:])
|
item = " ".join(command[2:])
|
||||||
if item in Items.item_table:
|
if item in Items.item_table:
|
||||||
seeked_item_id = Items.item_table[item][3]
|
seeked_item_id = Items.item_table[item][3]
|
||||||
@@ -350,7 +359,7 @@ async def console(ctx : Context):
|
|||||||
else:
|
else:
|
||||||
print("Unknown item: " + item)
|
print("Unknown item: " + item)
|
||||||
else:
|
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] != '/':
|
elif command[0][0] != '/':
|
||||||
notify_all(ctx, '[Server]: ' + input)
|
notify_all(ctx, '[Server]: ' + input)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user