SA-MP Forums Archive
IsXYZinAir - 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: IsXYZinAir (/showthread.php?tid=605878)



IsXYZinAir - ScIrUsna - 26.04.2016

Hi,

I don't found this function, but i need this like IsXYZinAir, it's possible to check if certain x,y,z is in air? not touching any object of GTA and my object just that coordinates must by in air


Re: IsXYZinAir - Gammix - 26.04.2016

Use (Col/Map)Andreas to check the Z height difference. If there is a significant difference, then yes the point is in air.

pawn Код:
public OnFilterScriptInit()
{
    CA_Init();

    return 1;
}

IsXYZinAir(Float:x, Float:y, Float:z)
{
    new Float:CA_z;
    CA_FindZ_For2DCoord(x, y, CA_z);

    return ((-(CA_z - z) * -1) >= 1.0) ? (true) : (false);
}



Re: IsXYZinAir - ScIrUsna - 26.04.2016

It's work with my created objects?


Re: IsXYZinAir - Crayder - 26.04.2016

So your question is, will your object fit in an area?

Gammix's solution is not the solution then. His is for checking if a point is above the ground.

What you need to use is CA_ContactTest!
pawn Код:
native CA_ContactTest(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
You simply just give it the model you want to test, the position you want to test, and the rotation of the object you want to test. Then the function will return true if the object collided any other object in San Andreas, including your custom objects. If it returns false then the model will fit in that location with that rotation!

And yes, of course ColAndreas does support custom maps.

https://sampforum.blast.hk/showthread.php?tid=586068


Re: IsXYZinAir - ScIrUsna - 26.04.2016

Where i can download colandreas ? and is there linux?


Re: IsXYZinAir - Crayder - 26.04.2016

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
Where i can download colandreas ?
According to your activity it looks like you found it. The thread you were on at exactly 4 minutes ago and are still on, the one you were on 5 minutes ago was from before ColAndreas was ever released.

And it's literally right there in my signature...


Re: IsXYZinAir - ScIrUsna - 26.04.2016

Yes i found but i don't found linux


Re: IsXYZinAir - Crayder - 26.04.2016

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
Yes i found but i don't found linux
You have two choices...
Compile it yourself (it's SUPER easy and the instructions are here if you have no clue what you're doing). You should always know how to compile Linux things yourself anyways.
Or use version 1.3.0's precompiled Linux version. 1.3.0 can be found in the releases on GitHub. https://github.com/Pottus/ColAndreas...ses/tag/v1.3.0

The latest version, 1.4.0 contains a very important update. So, until I can compile (or someone else can) a Linux release your best bet is to compile it yourself! It's really not hard. We literally provide step-by-step instructions on the GitHub.


Re: IsXYZinAir - ScIrUsna - 26.04.2016

I just need use this?

CA_ContactTest

I don't need that ongamemodeinit?

CA_RemoveBuilding();

// Initialize the collision world (This removes any objects and creates the collision world)
CA_Init();

// Create objects
CreateDynamicObject_SC();


Re: IsXYZinAir - ScIrUsna - 26.04.2016

And please make linux because i don't want to make mistakes.