In a specfic area , players wont be able to dmg each other
#3

Hi!

There are more then only one way because you can use two functions.

1. function - IsPlayerInRangeOfPoint:
IsPlayerInRangeOfPoint is a function which you can use to get the distance between a player and a certain point.
The range which is a parameter in that function is circular from the point.

2. function - IsPlayerInArea:
IsPlayerInArea is a function which you can use to get wheather a player is in a certain "area". This area isn't circular but it's square.

So, I think for your intention it is a good way to use IsPlayerInArea.
PHP код:
IsPlayerInArea(playerid,Float:MinX,Float:MinY,Float:MaxX,Float:MaxY)
{
    new 
Float:X,Float:Y,Float:Z;
    
GetPlayerPos(playerid,X,Y,Z);
    return (
X>=MinX && X<= MaxX && Y=>MinY && Y<=MaxY) ? 0;

This is the function you need. You apply this function in the callback OnPlayerTakeDamage or OnPlayerGiveDamage. It's yours decision.

Try this and feel free to ask if you need help. Good luck!
Reply


Messages In This Thread
In a specfic area , players wont be able to dmg each other - by Beasthian - 31.03.2016, 03:44
Re: In a specfic area , players wont be able to dmg each other - by Threshold - 31.03.2016, 04:39
Re: In a specfic area , players wont be able to dmg each other - by Mencent - 31.03.2016, 09:19

Forum Jump:


Users browsing this thread: 2 Guest(s)