Help Me with players around area
#1

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.
Reply
#2

1. Get position of second player
2. Use https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
3.
4. Profit
Reply
#3

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.
Reply
#4

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?
Reply
#5

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]))
Reply
#6

Edit: Lmao too late again.
Reply
#7

I guess its not as easy at it looks I'll give it a go but can someone else try help
Reply
#8

Show some effort. I gave you working snippet, now implement it
Reply
#9

Okay I'll try but it won't be perfect..
Reply
#10

Argh I can't to hard lol sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)