Use command for an area
#1

I want to make a command just effect in an area (not specific location). When I go out this area, the command is no effect. How can I do? Please help me!
Reply
#2

Create the command and just check if he is in range like using the following tag
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SendClientMessage(playerid, -1, "Not in range!");
Apply your wanted range and coordinates then add that in your command.
Reply
#3

Effect for a large area?
Reply
#4

You can set the range/radius of that area.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z); // you can set your own range/radius by editing "range"
Reply
#5

Can you explain and give me a specific example? Sorry but i'm noob
Reply
#6

I assume you're looking for an actual area, and not just a position?

If so, please refer to this: https://sampwiki.blast.hk/wiki/YSI:Areas
Reply
#7

Quote:
Originally Posted by Rittik
Посмотреть сообщение
You can set the range/radius of that area.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z); // you can set your own range/radius by editing "range"
Unit of float:range is centimetre or metre?
Reply
#8

Use this, it will work in such a way that the command works only if you are in the range of 30m of the area.
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) return SendClientMessage(playerid, -1, "Not in range!");
Reply
#9

solved. thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)