GetDynamicObjectPos returns old location after moving with SelectObject
#1

So I have a system in my server where people can create doors which can be opened and closed.
People can also place the door anywhere to their liking after it has been created with the usage of the SelectObject function.
Problem is, when the door is moved by the player, the new location is not returned by GetDynamicObjectPos.
This results in the door not being openable while standing next to it on it's new location, the door can still be opened while standing on the old location by pressing the open key.

Any idea why the old location of the object is returned and not the new location of the object?
Reply
#2

Are you using OnPlayerSelectObject instead of OnPlayerSelectDynamicObject by any chance?
Reply
#3

Maybe you need to get your cordinates from a callback, example after editing with EditObject you need to use SetObjectPos in OnPlayerEditObject and aftar that you can use GetObjectPos.
Reply
#4

Quote:
Originally Posted by Freaksken
Посмотреть сообщение
Are you using OnPlayerSelectObject instead of OnPlayerSelectDynamicObject by any chance?
I am using EditDynamicObject and OnPlayerEditDynamicObject.
Reply
#5

Quote:
Originally Posted by Ferman
Посмотреть сообщение
Maybe you need to get your cordinates from a callback, example after editing with EditObject you need to use SetObjectPos in OnPlayerEditObject and aftar that you can use GetObjectPos.
Adding

Код:
SetDynamicObjectPos(objectid, x,y,z);
SetDynamicObjectRot(objectid, rx,ry,rz);
To OnPlayerEditDynamicObject fixed it, thank you for your suggestion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)