SA-MP Forums Archive
Dynamic object bugg - 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: Dynamic object bugg (/showthread.php?tid=527352)



Dynamic object bugg - Banditukas - 22.07.2014

Hi,

I move dynamic object and when i get him pos GetDynamicObjectPos (when he is moving) i get position when he start a move. Why it'is? with createobject, even if i moveobject i always get position of moving object.


Re: Dynamic object bugg - SKAzini - 22.07.2014

Make sure that you're using CreateDynamicObject if you're using GetDynamicObjectPos. You said that you're using a dynamic object, but I can recreate this without issues.


Re: Dynamic object bugg - Banditukas - 22.07.2014

Yes am using everywhere dynamic object.


Re: Dynamic object bugg - Banditukas - 24.07.2014

Am doing that. I create dynamic object and then in OnPlayerUpdate i MoveDynamicObject to your position with 20.0 speed. And after that i want to GetDynamicObjectPos, but position is that from where object start to move and it have no change even dynamic object is targeting me.

Код:
OnPlayerUpdate (..)
{
MoveDynamicObject(...);
new Float:X,Float:Y,Float:Z;
GetDynamicObjectPos( ...X,Y,Z );
SetPlayerMapIcon( playerid, 69, X,Y,Z, 0, 0xFFFFFFAA, MAPICON_GLOBAL );
}
And i make an icon in minimap:

SetPlayerMapIcon( playerid, 69, X,Y,Z, 0, 0xFFFFFFAA, MAPICON_GLOBAL );
How i said icon in the same place where object start moved. With CreateObject, MoveObject and so on.. Then icon is changing place where is object.. I tried to Streamer_Update(playerid); when i MoveDynamicObject but this not help.


AW: Dynamic object bugg - Oskaar1994 - 24.07.2014

You could save the object's position before moving it and add/subtract the difference between the new and the old position with the help of a timer.