Detecting when moving object is touching static GTA objects or vehicle with player inside
#1

How to detect an obstruction encountered by a moving object? vehicles with players or static GTA objects?
Reply
#2

when creating the object
pawn Код:
new OBJ = CreateObject..............
then create a timer for one second, if you don't have one CREATE ONE
then add this in it
pawn Код:
new Float:x, Float:y, Float:z;
new Float:px, Float:py, Float:pz;
GetObjectPos(OBJ, x, y, z);
GetPlayerPos(playerid, px, py, pz);
if( x == px && y == py)
{
     //add what u want to do here..
     //I suggest u stop it soo...
     MoveObject(OBJ, px+5, py+5, pz, 30.0); //+5 depending on object size
     return 1;
}
hope this helps
Reply
#3

Yes i know i can do that but 1 sec is to long for this [ame]http://www.youtube.com/watch?v=YRo4rq6ln7k[/ame] and what about static GTA objects?
Reply
#4

Static GTA Objects, idk..
but you can reduce the timer to milliseconds if you want, but I guess it lags your gamemode..
Reply
#5

That's why I do not want very quick timer for that
Reply
#6

Halo?
Reply
#7

well jefff once i asked the same but you can not do anything about the GTA objects
Reply
#8

Yes you can, i saw on some servers that trick
Reply
#9

You should use "Peppe" physics include.
This allows you to create invisible "walls", so object can't go over them.
Link:
https://sampforum.blast.hk/showthread.php?tid=446286
Hope it helps
Reply
#10

Looks ok but its huge .inc and timer 20ms :/ i need study this xd and maybe other ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)