To Know the position of a object - 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: To Know the position of a object (
/showthread.php?tid=205997)
To Know the position of a object -
ombre - 02.01.2011
Hi,
I have in my script:
GamemodeInit()
Object1 = Createobject(588,1000,1000,500); // just a example
I want to make a command, if the "Object1" move or is not in the position given in the GamaModeInit, so the command don't work with a return, "this object move". I use if (getobjectpos(Object1, 1000,1000,500) { command work} else if (getobjectpos(Object1, 1000,1000,600){ command work} ... but i have always a error ...so getobjectpos is not I think adapted for that.
Thanks help.
Re: To Know the position of a object -
Backwardsman97 - 02.01.2011
Well it seems that the example is some kind of elevator since just the z changes from 500 to 600. Here's a script for
only checking the z.
pawn Код:
new Float:z;
GetObjectPos(Object1,z,z,z);
if(z == 500)
{
//Down
}
else
{
//Up
}
Re : To Know the position of a object -
ombre - 02.01.2011
That is used like that. Thank man. Good year.