If player leaves the area
#1

Im trying to make so when a player leaves the area stuff will happend. But i have no idea how to make that.
Ive tryed with "!IsPlayerInRangeOfPoint" but that didnt really work because i need it to do stuff in the
second he leaves the area.

If you dont understand what im asking for. Maybe this will help you a little:

pawn Code:
if (//he leaves the area??)
{
    SendClientMessage(playerid, GREY, "blalala..");
}
Reply
#2

You would need a timer to repeatedly check if he has left or not. You could use IsPlayerInRangeOfPoint if you're talking about a circular area or your own way if you wanted a square area.
Reply
#3

Quote:
Originally Posted by Backwardsman97
View Post
You would need a timer to repeatedly check if he has left or not. You could use IsPlayerInRangeOfPoint if you're talking about a circular area or your own way if you wanted a square area.
Its just a little area, it isnt bigger than a pickup. But how would i update that timer to see if hes in the area?.
Reply
#4

Use:

pawn Code:
stock IsPlayerInArea(playerid, Float:xmin, Float:ymin, Float:xmax, Float:ymax)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= xmin && y >= ymin && x <= xmax && y <= ymax) return true;
    return false;
}
Reply
#5

Quote:
Originally Posted by Ricop522
View Post
Use:

pawn Code:
stock IsPlayerInArea(playerid, Float:xmin, Float:ymin, Float:xmax, Float:ymax)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= xmin && y >= ymin && x <= xmax && y <= ymax) return true;
    return false;
}
Im going with IsPlayerInRangeOfPoint since its just this one little circual. All i need to know is how i could update
the timer every second or so.
Reply
#6

Take a look at this: https://sampforum.blast.hk/showthread.php?tid=229423
Reply
#7

Quote:
Originally Posted by The Woody
View Post
Im going with IsPlayerInRangeOfPoint since its just this one little circual. All i need to know is how i could update
the timer every second or so.
I would recommend IsPlayerInRange, as it checks the z axis also.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)