IsPlayerInArea - 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: IsPlayerInArea (
/showthread.php?tid=448349)
IsPlayerInArea -
Feastahashi - 04.07.2013
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;
}
Re: IsPlayerInArea -
MP2 - 04.07.2013
https://www.******.co.uk/search?q=samp+isplayerinarea
Re: IsPlayerInArea -
Feastahashi - 04.07.2013
Check my code, please, it doesn't works.
That's the problem.
Re: IsPlayerInArea -
RaZzZzoR - 04.07.2013
Try with
IsPlayerInRangeOfPoint
Re: IsPlayerInArea -
Feastahashi - 04.07.2013
But that's nothing to do with range, it's the runway area the plane must be to be detected by the system
.
Re: IsPlayerInArea -
MP2 - 04.07.2013
Quote:
Originally Posted by Feastahashi
I need the function IsPlayerInArea, the one which really works.
|
Quote:
Originally Posted by MP2
|
....
Re: IsPlayerInArea -
Vince - 04.07.2013
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.
Re: IsPlayerInArea -
Feastahashi - 05.07.2013
Thanks all guys, the Streamer ideia has been done and worked successfully
.
Re: IsPlayerInArea -
MP2 - 05.07.2013
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).