Help Me with players around area - 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: Help Me with players around area (
/showthread.php?tid=451521)
Help Me with players around area -
RandomDude - 17.07.2013
So I want to make a command but the player has to be within a certain distance with you for you to use it.
Like If the players next to me I can /wave the player and it says it in main chat like RandomDude Waved At LOL.
But if the player is not in the area it gives an error.
Re: Help Me with players around area -
Misiur - 17.07.2013
1. Get position of second player
2. Use
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
3.
4. Profit
Re: Help Me with players around area -
Mystique - 17.07.2013
Get the targets position with the function GetPlayerPos. Then use this function to decide if you're in range of the other players position.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Edit: Too late.
Re: Help Me with players around area -
RandomDude - 17.07.2013
No but I want it if the player is around you how am I ment to script it with this?
What numbers should I use? I suck at that lol. But OnCE I get the numbers I can script it.
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
The numbers in there?
Re: Help Me with players around area -
Misiur - 17.07.2013
pawn Код:
new Float:pos[3];
GetPlayerPos(otherplayerid, pos[0], pos[1], pos[2]);
And later
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, pos[0], pos[1], pos[2]))
Re: Help Me with players around area -
Mystique - 17.07.2013
Edit: Lmao too late again.
Re: Help Me with players around area -
RandomDude - 18.07.2013
I guess its not as easy at it looks I'll give it a go but can someone else try help
Re: Help Me with players around area -
Misiur - 18.07.2013
Show some effort. I gave you working snippet, now implement it
Re: Help Me with players around area -
RandomDude - 18.07.2013
Okay I'll try but it won't be perfect..
Re: Help Me with players around area -
RandomDude - 18.07.2013
Argh I can't to hard lol sorry.