There sure is! Call this function whenever you want to get the player's name. The name is stored as the attribute playername of the player object. Once you've asked for the player's name, you can access it anytime by referencing it as player.playername.
<function name="name_player">
msg ("Please enter your name:")
player.playername = GetInput()
</function>