Use command for an 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: Use command for an area (
/showthread.php?tid=522200)
Use command for an area -
bitakid - 26.06.2014
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!
Re: Use command for an area -
Laurey - 26.06.2014
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.
Re: Use command for an area -
bitakid - 26.06.2014
Effect for a large area?
Re: Use command for an area -
Rittik - 26.06.2014
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"
Re: Use command for an area -
bitakid - 26.06.2014
Can you explain and give me a specific example? Sorry but i'm noob
Re: Use command for an area -
Dignity - 26.06.2014
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
Re: Use command for an area -
bitakid - 26.06.2014
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?
Re: Use command for an area -
Laurey - 26.06.2014
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!");
Re: Use command for an area -
bitakid - 26.06.2014
solved. thanks all