Sorry, I assumed you'd know how to use the command.
The way the command runs is like this.
[42] [Variable for X-Pos] [Variable for Y-Pos]
or, as an example:
getplayerpos 0x8005 0x8006
And then you'd need to move on to comparing the x value to the value of the map position, and the y to the value of the y position on the map.
I'm sorry if that makes no sense, I'm just not sure of how to explain it in only a few words.