samp-streamer-plugin: AttachDynamicObjectToObject bug
I made command that create two dynamic objects, I attach them with AttachDynamicObjectToObject and it works, but when I leave stream radius and come back the attach object is not streamed in(loaded) it disappears. Streamer only load the main object. And it works only when I type command for the first time if I type command again streamer only create me the main object.
My code:
GetPlayerPos(playerid, X, Y, Z);
new Mainobject = CreateDynamicObject(19632,X, Y, Z+2,0.000000,0.000000,14.900031);
new Attachobject = CreateDynamicObject(19614,X, Y, Z-100,0.000000,0.000000,0.000000);
AttachDynamicObjectToObject(Attachobject,Mainobject,0.009999,-0.220000,-0.599999,0.000000,0.000000,180.000015);
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 26 (9 by maintainers)
Sorry, I realized just now that this is backwards. These should actually all be
INVALID_STREAMER_ID
. We’re attaching dynamic objects, not player objects, soINVALID_OBJECT_ID
is still a valid ID. The problem before was that this was inconsistent in the code.It`s strange, but when I set the PRIORITY(1 to the base object, not -1), everything works well. It means that need to set the priority of the base object higher?
Code:
Streamer_SetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_PRIORITY, 1);
@Tagic, @mmimix, @samp-incognito?
when a fix?
Such problem was also in 2.8.2, but if the attached object`s position(global) was defined as 0,0,0(I even made video https://www.youtube.com/watch?v=a48wswSNrwI). If the pos are some coords(near the main object), I have not this issue
In 2.9.0 and 2.9.1 the problem exists any way. Try to compare the code of old and current version to found a changing that causes this problem
Yes, those should all be
INVALID_OBJECT_ID
. I noticed that earlier as well. #193 is also affected by this.I did some research (of this and #193). This may be my mistake. I did some cleanup inside the plugin related to IDs definitions (they were pretty messed up) and I think that I messed up few checks. Here are the lines that I think that should be changed:
Shouldn’t
INVALID_STREAMER_ID
beINVALID_OBJECT_ID
in all these lines ? Not sure if these are the problems related to this issue, as those are related only to valid ID checking, the OP’s code should work with bothINVALID_STREAMER_ID
andINVALID_OBJECT_ID
.@samp-incognito, can you take a quick look at this, if this is indeed the problem ?
same problem. It appears since 2.9.0. Please, try founding a solution