Collision something on something - 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: Collision something on something (
/showthread.php?tid=538292)
How to make a Collision Function? -
XStormiest - 20.09.2014
As the title says, I would like to start a script or something that will identifiy if an something ex: car is colliding with an object, but I dont have any ideeas where to start from.
Also, I would like to know if this can be created in SA-MP, I mean, i think we can create just Collision between created object through SA-MP, unless you know how to get the IDs of GTA SA Objects (Something that I dont know)
What should I start with, trying to work with the 3d Coordonates, loops through all the objects, and get their information?.... I mean I have some ideeas but I dont think that SA-MP will make this possible for me....
Or I can make something like a Health system, so if two objects get modified then a function is called (It wont be like a real Health, more something like a normal variable...
So what you think?
Re: Collision something on something -
MicroD - 20.09.2014
https://sampwiki.blast.hk/wiki/GetVehicleModelInfo
https://sampforum.blast.hk/showthread.php?tid=407909
https://sampforum.blast.hk/showthread.php?tid=102865
So my idea is following:
I would start by creating a timer which will update frequently let's say 33 milliseconds (30 FPS).
First I need to check model of vehicle then get info of front bumper position. I would create a dynamic area around object using streamer area functions together with model size of object. Then I check if point is in dynamic area and if it is I will decrease HP of object. This idea is not the best idea, and I've never done something like this.
Re: Collision something on something -
XStormiest - 20.09.2014
Yeah thats smart, and then you can create a callback based on that wich calls if the objects's health decrease.
Thanks, I will try that xD
Respuesta: Collision something on something -
romperson - 20.09.2014
Yo digo que el que publico esto es un pendejo