SA-MP Forums Archive
making a object follow you? - 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: making a object follow you? (/showthread.php?tid=176213)



making a object follow you? - thomas.. - 12.09.2010

ok, so say if you typed a command

then a bomb would appear, then it would chase you until it hit you then it exploded


help?



Re: making a object follow you? - Scarface~ - 12.09.2010

Attach it to the player.


Re: making a object follow you? - thomas.. - 12.09.2010

Quote:
Originally Posted by Scarface~
Посмотреть сообщение
Attach it to the player.
no.

i actually want it to be free to move around rather than trying to stick to my pos


Re: making a object follow you? - boelie - 12.09.2010

you need MoveObject

get the x,y,z position of the player ..put the same x,y,z into the moveobject x,y,z and it should folow you.
You also dont need to dubble post


Re: making a object follow you? - thomas.. - 12.09.2010

Quote:
Originally Posted by boelie
Посмотреть сообщение
you need MoveObject

get the x,y,z position of the player ..put the same x,y,z into the moveobject x,y,z and it should folow you.
You also dont need to dubble post
how to do?
xd


Re: making a object follow you? - Matej_ - 12.09.2010

Quote:
Originally Posted by thomas..
Посмотреть сообщение
how to do?
xd
pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);

^ to get player position.
pawn Код:
new Float:X, Float:Y, Float:Z;
MoveObject(playerid,X, Y, Z);

^ to move the object.



Re: making a object follow you? - thomas.. - 12.09.2010

Quote:
Originally Posted by Matej_
Посмотреть сообщение
pawn Код:
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X, Y, Z);

^ to get player position.
pawn Код:
new Float:X, Float:Y, Float:Z;
MoveObject(playerid,X, Y, Z);

^ to move the object.
yes but moving the object to playerpos' offsets?