SA-MP Forums Archive
Identify player locations - 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)
+--- Thread: Identify player locations (/showthread.php?tid=661992)



Identify player locations - SapMan - 20.12.2018

I made a text drawing on my server to warn the player where it is. Example: "Place: Los Santos". But how do I know exactly where it is? By this I mean to know if it is in "Las venturas", "los santos", "san fierro", "airport (Ls, Lv or Sf)", "the beach", etc. and so with more places.


Re: Identify player locations - RogueDrifter - 20.12.2018

Get the player's position https://sampwiki.blast.hk/wiki/GetPlayerPos and check if he's in a range https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint try using the wiki its helpful


Re: Identify player locations - SapMan - 20.12.2018

Sorry, I was also referring to whether to use a timer to detect when the player enters a zone or use "OnPlayerEnterDynamicArea"


Re: Identify player locations - SapMan - 20.12.2018

If I use the timer do I have to use it in OngamemodeInit or OnPlayerConnect?


Re: Identify player locations - RogueDrifter - 20.12.2018

Start it per-player at onplayerconnect and kill it at onplayerdisconnect


Re: Identify player locations - SapMan - 20.12.2018

So, would it be better to use a timer than "OnPlayerEnterDynamicArea"? I use "CreateDynamicRectangle" for zones.


Re: Identify player locations - Threshold - 21.12.2018

Think logically.

When does 'OnPlayerEnterDynamicArea' get called? When a player enters a dynamic area.

"I use "CreateDynamicRectangle" for zones"..

What do you think the answer would be?