SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/12/2018, 10:49 PM   #1
SapMan
Banned
 
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default Identify player locations

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.
SapMan is offline   Reply With Quote
Old 20/12/2018, 11:11 PM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Identify player locations

Get the player's position https://wiki.sa-mp.com/wiki/GetPlayerPos and check if he's in a range https://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint try using the wiki its helpful
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 20/12/2018, 11:12 PM   #3
SapMan
Banned
 
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default Re: Identify player locations

Sorry, I was also referring to whether to use a timer to detect when the player enters a zone or use "OnPlayerEnterDynamicArea"
SapMan is offline   Reply With Quote
Old 20/12/2018, 11:19 PM   #4
SapMan
Banned
 
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default Re: Identify player locations

If I use the timer do I have to use it in OngamemodeInit or OnPlayerConnect?
SapMan is offline   Reply With Quote
Old 20/12/2018, 11:21 PM   #5
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,193
Reputation: 420
Default Re: Identify player locations

Start it per-player at onplayerconnect and kill it at onplayerdisconnect
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link

RogueDrifter is offline   Reply With Quote
Old 20/12/2018, 11:38 PM   #6
SapMan
Banned
 
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default Re: Identify player locations

So, would it be better to use a timer than "OnPlayerEnterDynamicArea"? I use "CreateDynamicRectangle" for zones.
SapMan is offline   Reply With Quote
Old 21/12/2018, 09:59 PM   #7
Threshold
High-roller
 
Threshold's Avatar
 
Join Date: Nov 2012
Location: Australia
Posts: 3,122
Reputation: 529
Default Re: Identify player locations

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?
__________________


Kar's Cops and Robbers 2020
Threshold is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify Player... introzen Scripting Help 6 02/12/2017 07:52 PM
Identify if player's vehicle is being robbed YwX Scripting Help 10 04/07/2014 12:03 PM
Changing player spawn locations. MrPlatinum Scripting Help 3 30/09/2012 05:18 AM
[HELP] Setting Random Player Spawn Locations wilcock33 Help Archive 7 30/09/2009 11:37 PM
[HELP] Setting Random Player Spawn Locations wilcock33 Help Archive 17 22/07/2009 02:02 PM


All times are GMT. The time now is 08:42 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.