This is what I came up with.
Simply write /id <playername> into chat.
e.g "/id Theoris" or "/id Some_Random_Guy"
#/id <PlayerName>
#Shows the ID of PlayerName.
(str_starts_with, s1, "@id"),
(str_store_substring, s3, s1, 2),
(str_store_trim, s2, s3),
(get_max_players, ":max"),
(try_for_range, ":player", 0, ":max"),
(player_is_active, ":player"),
(str_store_player_username, s3, ":player"),
(str_equals, s2, s3),
(assign, ":max", 0),
(assign, reg0, ":player"),
(str_store_string, s0, "@[Server] PlayerID of {s3} is {reg0}."),
(multiplayer_send_string_to_player, ":player_no", pa_server_message, s0),
(try_end),
(set_trigger_result, 1),