SA-MP Forums Archive
Move 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)
+--- Thread: Move Object. (/showthread.php?tid=369239)



Move Object. - kesem140599 - 16.08.2012

So, I imagine an object moving at headquarters, And i have a many problems here.
1. I open it, he flees to a distant place and stops
Two. I close it is back but he bends a little.
3. I close it, it does not come back at all.
4. How do I do that I would just open it, and he will own .

Code :
Quote:

if(strcmp(cmdtext, "/Open" ,true)==0)
{
MoveObject(gate, 980, 1766.9000244141, 2730.1000976563, 12.60000038147, 1, 0, 0, 0);
return 1;
}

if(strcmp(cmdtext, "/Close" ,true)==0)
{
MoveObject(gate, 1766.9000244141, 2730.1000976563, 6.30000038147, 1, 0, 0, 0);
return 1;
}




Re: Move Object. - jop9888 - 16.08.2012

Remove the last three 0's ( 0, 0, 0)

If you don't mean to turn the object you can leave these variables away
This might fix your problem


Re: Move Object. - Ranama - 16.08.2012

Код:
MoveObject(gate, 980, 1766.9000244141, 2730.1000976563, 12.60000038147, 1, 0, 0, 0);
MoveObject(gate, 1766.9000244141, 2730.1000976563, 6.30000038147, 1, 0, 0, 0);
these seems a little bit to far away from each other don't they, that's maybe why it floats far far away, get the right cordiantes and it should fix.


Re: Move Object. - kesem140599 - 16.08.2012

its work !
But, why in /Open its run so fast and in close its slow ? the speed of them is same , "1"
and if i dont do /Close , its run's away..and dont stoping


Re: Move Object. - AndreT - 16.08.2012

Read what Ranama said. Clearly you have a WRONG parameter there.

Perhaps you don't understand, let me write it out to you:
If you use /open, the gate will move to coordinates 980, 1766.9000244141, 2730.1000976563 with the speed of 12.60000038147
If you use /close, the gate will move to coordinates 1766.9000244141, 2730.1000976563, 6.30000038147 with the speed of 1

As someone said, the coordinates are NOT close to eachother. You are better off re-doing the coordinates.


Re: Move Object. - kesem140599 - 16.08.2012

Ok , i Remove it (the 980) and this is now not work :/
i Mean , The Gate Not Moveing .. !
What To Do ??:PP


Re: Move Object. - Cjgogo - 16.08.2012

OMG,Ranama did not mean to remove the X coordinate or Y coordinate,but to modify it and change it,like a closer and better correspondent for the X coordinate 980 would be Y 1000,and not Y 1280,but YOU CANNOT TELL this,this is just an example,don't change the Y coordinate to 1000,but use a map-editor and save the proper coordinates.