Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] [Solved] Selecting and Editing object problem

 
  • 0 Vote(s) - 0 Average
Pawn [Solved] Selecting and Editing object problem
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#1
2021-01-16, 01:43 AM (This post was last modified: 2021-05-14, 09:22 PM by Radical.)
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.
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#2
2021-01-16, 02:32 PM
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.
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#3
2021-01-16, 02:47 PM (This post was last modified: 2021-01-16, 02:50 PM by Radical.)
(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.
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#4
2021-01-16, 04:20 PM
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.
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#5
2021-01-17, 09:38 PM
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
Expert*
Offline

Burgershot Member
Posts: 61
Threads: 2
Joined: Apr 2019
Reputation: 4
#6
2021-01-18, 07:14 PM
In _FINAL

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

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#7
2021-04-15, 11:03 PM
Thanks @Expert*
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#8
2021-04-16, 12:31 AM (This post was last modified: 2021-04-16, 12:36 AM by Radical.)
(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.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode