• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Solved] Selecting and Editing object problem
#1
SOLUTION:?

Use streamer v2.9.4.



1: OnPlayerEditObject/OnPlayerEditDynamicObject response is EDIT_RESPONSE_UPDATE



Recently, a bug was found on the server that when we edit objects, the objects return to where they were created after a few seconds.

I do not know why in OnPlayerEditObject/OnPlayerEditDynamicObject the 'response' is EDIT_RESPONSE_UPDATE.

The response should be EDIT_RESPONSE_FINAL to solve.





2: SelectObject function is not working for dynamic objects.

When I select the object, the OnPlayerSelectDynamicObject is not called.

Why?





What is your solutions? Thank u.
  Reply
#2
1.
Quote:OnPlayerEditDynamicObject is called:



If you cancel the object editing. (response = EDIT_RESPONSE_CANCEL = 0)

If you finish (save) the object editing. (response = EDIT_RESPONSE_FINAL = 1)

If you update (move/rotate) the object (response = EDIT_RESPONSE_UPDATE = 2)

2.
Code:
native EditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid);
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
(2021-01-16, 02:32 PM)Pinch Wrote: 1.
Quote:OnPlayerEditDynamicObject is called:

If you cancel the object editing. (response = EDIT_RESPONSE_CANCEL = 0)
If you finish (save) the object editing. (response = EDIT_RESPONSE_FINAL = 1)
If you update (move/rotate) the object (response = EDIT_RESPONSE_UPDATE = 2)
2.
Code:
native EditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid);

1.
I (finish) save the object but response is EDIT_RESPONSE_UPDATE instead of EDIT_RESPONSE_FINAL

2.
I said when I select the object, the OnPlayerSelectDynamicObject is not called.
  Reply
#4
SelectObject function is not working for dynamic objects.



That's what you wrote so I assumed that you're using the wrong native
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#5
See, I save the dynamic object but after a few seconds it goes back to where it was created:











[Image: sa-mp-188.png]







[Image: sa-mp-189.png]











This is a problem.

Please tell me the solution
  Reply
#6
In _FINAL



Set

SetDynamicObjectPos( objectid, x, y, z );

SetDynamicObjectRot( objectid, rx, ry, rz );
  Reply
#7
Thanks @Expert*
  Reply
#8
(2021-01-18, 07:14 PM)Expert* Wrote: In _FINAL

Set
? ? SetDynamicObjectPos( objectid, x, y, z );
? ? SetDynamicObjectRot( objectid, rx, ry, rz );

I solved this problem without doing this.

I just put this code

Code:
if (response ==?EDIT_RESPONSE_UPDATE)
? ? return 1;
in OnPlayerEditDynamicObject callback and the problem was solved.
  Reply


Forum Jump: