need help InRangeOfPoint
#1

ok im making a something using IsPlayerInRangeOfPoint
but how can add if player leave the rangeofpoint he will spawn or die??
Reply
#2

pawn Code:
if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
   SetPlayerHealth(playerid, 0.0);
}
You can put this under a timer or something, which is called frequently.
Reply
#3

like that?:
PHP Code:
public OnPlayerUpdate(playerid)
{
    If(!
IsPlayerInRangeOfPoint(playerid15.00.00.00.0))
    {
        
setPlayerHealth(playerid,0.0);
    }

Reply
#4

@[Bios]Marcel im so sure At onplayerupdate it will start spam so much.

@PrivatioBoni, i already know how is this code (!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
but i dont know where to put it ,
i want to add example if player leave the robbery point he will faild to the bank robbery
Reply
#5

create a Timer for every Player which checks there Position every 500 milliseconds or whatever
or create a global timer
Reply
#6

PHP Code:
new RobT[MaxPlayers];
CMD:Rob(playerid,params[])
{
//the rob command ....
    
RobT[playerid] = SetTimerEx("RobCheck"500true"i"playerid);
}
forward RobCheck(playerid);
public 
RobCheck(playerid)
{
    if(
IsRobbing)
    {
        if(!
isinrangeof.....)
        {
        
setPlayerHealth(playerid,0.0);
        
KillTimer(RobT[playerid]);
        }
    }

Reply
#7

Edit : nvm i will find another way about this...
anyway thanks for taking your time trying to help me.
+rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)