IsPlayerInArea
#1

I caught the runway coordinates with the Gangzone Maker and I'm trying to detect if the plane is between these points, so I need the function IsPlayerInArea, the one which really works.

Does anyone have the function?

And my example is the following:


pawn Код:
public OnPlayerUpdate(playerid)
{

    new modelid;
    if(IsPlayerInAnyVehicle(playerid))
    {
        modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
        if(modelid == 476 || modelid == 511 || modelid == 519 || modelid == 577 || modelid == 592 || modelid == 593) // Some plane models
        {
            if(IsPlayerInArea(playerid, 1373.046875,1259.765625, 1394.53125, 1707.03125)) // Runway area
            {
                    Pista1 = false; // FALSE = its busy
            }
            else
            {
                Pista1 = true; // TRUE = its free
               
            }
        }
                return 1;
}
Reply
#2

https://www.******.co.uk/search?q=samp+isplayerinarea
Reply
#3

Check my code, please, it doesn't works.

That's the problem.
Reply
#4

Try with IsPlayerInRangeOfPoint
Reply
#5

But that's nothing to do with range, it's the runway area the plane must be to be detected by the system .
Reply
#6

Quote:
Originally Posted by Feastahashi
Посмотреть сообщение
I need the function IsPlayerInArea, the one which really works.
....
Reply
#7

I suggest using the Streamer plugin's dynamic areas. You can check whether they enter or exit the area without having to rely on timers or OnPlayerUpdate.
Reply
#8

Thanks all guys, the Streamer ideia has been done and worked successfully .
Reply
#9

Make sure you set the Z height of the area pretty low, as otherwise they'll be detected if they fly high over the airport. I assume you only want it if they are actually ON the runway (at ground level).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)