SA-MP Forums Archive
Moving Icon on textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: Moving Icon on textdraw (/showthread.php?tid=660810)



Moving Icon on textdraw - Craft. - 14.11.2018

Essentially id like to make an area display on the screen showing a map using a textdraw. From this textdraw I would like to live update the player's location on the minimap. I already know how id like to display the map I just don't know if its possible to update the player's position like that on the minimap textdraw. Any tips are appreciated!


Re: Moving Icon on textdraw - NaS - 14.11.2018

You'll need to calculate the player position on the Map TextDraw, which depends on the Map's size and position.
The SA Map is 6000.0m x 6000.0m, the TD grid is 640 x 480, and the map is just a part of that grid (eg. 200 x 200 at a specific position on the TD grid) so the player's coords must be transformed to that grid.

When you calculated the point on the TD grid you can create a (player) textdraw there for the icon, then keep updating it by destroying and recreating the icon.