Object move - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Object move (
/showthread.php?tid=170837)
Object move -
billiout - 24.08.2010
is there anyway to check if an object move do something? i mean if i hit a small thing like cone with a car and moved can i check that? and another simillar one. i want to check if i hit with car even if the object didnt moved.
Re: Object move -
RSX - 24.08.2010
There was an callback, but i'm not sure if client pass this information to server, and then there's no actual way, except one dumb one, which i'm not going to tell
Won't checking like 20 objects each 0.1 sec with comparing positions make a great overflow? And.. add an limiter if object has already moved.
VVV
Re: Object move -
Claude - 24.08.2010
Give the object a name, e.g. and get the position
This
must be the general (not in a public function!)
pawn Код:
new object, objectmovet, Float:x, Float:y, Float:z;
object = CreateObject(...);
objectmovet = SetTimer("ObjectMove", 100, true);
Create a forward
pawn Код:
forward ObjectMove(objectid);
with a public function
pawn Код:
public ObjectMove(objectid)
{
new bool:moved;
moved = false;
if(GetObjectPos(object, x, y, z) != [the x-y-z coordinates from createobject])
{
moved = true;
}
else moved = false;
return 1;
}
Might give some errors but ye, give it a try