UserID=GetUserTempFlag(0,10)

If #RESULT=""
	ShowUserDialog(UserID,716,"text","Please choose a new name...")
Else
	If GetUserID(#RESULT)>0
		ShowUserDialog(UserID,716,"text","That name is already taken! Choose another...")
	Else
		SendMessageToAll("SERVER: "+GetUserName(UserID)+" has changed their name to "+#RESULT+"!",#MSG_EMOTE)
		SetUserName(UserID,#RESULT)
		SetUserDisplayName(UserID,#RESULT)
		SendMessageToUser(UserID,"Don't forget to login using '"+#RESULT+"' from now on.",#MSG_TELL)
	Endif
Endif

Continue = 1