samp-streamer-plugin
samp-streamer-plugin copied to clipboard
Objects disappearing
Hello,
I've been using Incognito's plugin since 2012, and I've always had this problem in my script. I have many dynamic objects (and static objects too, CreateObject I use for objects that can't be streamed, such as floors to avoid vehicles falling through the dynamic objects). I have systems where players can place furniture objects in their houses, police men can place roadblocks, and admins can place objects around the map. They all work with dynamic objects, but when someone places a roadblock, furniture, or object, the object just dissapears after a few seconds.
It's not destroyed by the script, it just dissapears. Oddly enough, this only happens with objects created on the run, and not OnGameModeInit (initial maps), such as the ones I mentioned, roadblocks and furniture and dynamic objects placed by admins. This isn't a limit problem, since this also happens when placing an object in the desert with nothing scripted there.
I have a Ubuntu server in the latest streamer version. This problem is mortifying me and I am looking for a solution.
Thanks, beforehand.
Make sure that:
- You are using one of the latest Streamer Plugin versions.
- You recompiled all of your scripts (gamemode + filterscripts) with the correct include - in some past SA-MP version the
drawdistance
was messed up by some change and everything had to be recompiled, but this is probably not the case here. - You aren't actually creating too many global objects (
CreateObject
) - this may explain why they go away in desert. - There's actually no difference between dynamic objects created in
OnGameModeInit
or objects created anywhere else. WhenCreateDynamicX
is called, the item is simply added in the memory and then, an internal timer checks if a player is close to the position of any object position added in memory. So, because of this, it may be possible that inOnGameModeInit
you create them with some fine settings (such as correctstreamdistance
anddrawdistance
), while in commands, dialogs and other things you are creating them with weird and incorrect properties (streamdistance
too small, maybe, or any other similar thing).
Double check if you are actually reaching the limits. Count all of your CreateObject
functions which are applied at any time and check the statistics available when you press the F5 button. Streamer_CountVisibleItems
may also help.
In total, there are 7 CreateObject, the bug is actually the plugin, and I fight with it a long time. All scripts are compiled in the correct version.
I changed to version 2.8.2 recently, and it looks a little better. It takes time to happen, but it happens the same way. But this version does not have DynamicActors and I had to pass all my systems to the CreateActor.
Another thing I noticed is that when the object disappears, its rotation is modificated. For example, a player's balloon, when created, stay in normal position 10 seconds, is placed in the opposite rotation, lying on the ground and then disappears. This is very fast, matter of milliseconds between changing the rotation and disappearing.
Here are some videos:
https://www.youtube.com/watch?v=xCUTFcLqGsk https://www.youtube.com/watch?v=Lbpzl2oV9TQ
Can you reproduce that in an empty script?
I've tried filterscripts, clean gamemodes, and the same thing happens. With few players this does not happen.
If you do have a simple script that reproduces this, then it would be helpful if you would share it. Otherwise, you should probably try to figure out exactly what your script is doing when these objects are disappearing.
This problem also happens to me. Create furniture on different virtual world, The object dissapears after a few seconds. The problem is not going to happen if there are only a few players. If restart server let object initial to gamemode It will be permanently displayed.
I have the same problem ... The objects created by commands randomly come out, they only stick when loaded next to Gamemode. (I am also creating objects in different worlds.) The more online players, the greater the occurrence of this problem.
Not only objects, but textlabels also disappear sometimes.
Is the allocated memory already used by one object being used by another object?
Have an solution?
Same on v2.9.2 and v2.9.3.
A new dynamic object takes the id from another already created even if that one was not deleted yet.
Even map's objects charged by FS at the beginning disappears.
Same, still fighting with this for months..
Also having this issue on the latest version.
I create around 18000 objects at server startup, and they never disappear. However, objects that are added after startup (such as house furnishing) do disappear after some time, one by one, in order they were created. Reloading those objects from the database and creating them again doesn't fix the issue - they still disappear sooner or later.
@samp-incognito @IstuntmanI any way to fix this?
I'm almost positive it's because you're getting object IDs mixed up somewhere. This is the most common scripting problem I've seen, especially when an object is destroyed and the old ID continues to be used. The fact that the objects don't "disappear" if they're created at startup is telling. I'm assuming they aren't assigned to any variables and thus never get modified in any way. Check your script carefully to see how you're handling IDs.
Otherwise, if it truly is a plugin problem, then the only way it can be fixed is if you've somehow found a way to reproduce it.
RESOLVED. See edits of this post to know what I said before.
My particular problem was resolved for reasons I'm not sure about, after changes to the enviroment where the server was running. It might have been an issue with libraries in the old docker container. It's worth noting at the same time I added safeguards to 2 unchecked DestroyDynamicObject calls too, but I really doubt these two alone were the reason that so much havoc started happening out of a sudden.
Hello,
After 2 years of creating this issue, I can confirm that this problem continues to happen with objects created after the server started. With objects attached to vehicles and players mainly, but also with objects like life machines, balloons, and more.
Few months ago, we solved this problem with another problem, using this:
CreateDynamicObject(19300,0.00000000,0.00000000,0.00000000.0.00000000.0.00000000.0.00000000);
However, this is not solving the problem anymore. @samp-incognito
Hey, I got this problem too. Have you got any ideas to fix? @BartNWD
No, until today the problem has not been solved. On the contrary, it gets more and more strange and random. I tested old versions of the plugin, since 2.7.2, and the problem persists.
Some more strange happenings that I captured:
Balloons creating on vehicle attached objects slot: https://www.youtube.com/watch?v=9011-OFezZ0
After disappearing, go to point 0: (using / goto object command) https://www.youtube.com/watch?v=qCUOWeW0mz4
The fire when firing nitro in vehicles never stabilizes: https://www.youtube.com/watch?v=euT_EJAqe0U
I think the problem is not even in DestroyDynamicObject, because I have already reviewed all mine and they are being used correctly, without interference from IDs. I think the problem is in the internal manipulation of data.
NOTE: The smaller the number of players, the fewer occurrences. With 1 player everything just happens perfectly. In version 2.7.2 it is also possible to notice a reduction in occurrences.
Note²: I use streamer in gamemode and 2 filterscripts.
Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?
Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?
I didn't solve :c
Here's a tip! For localobjects use player names.
Note²: I use streamer in gamemode and 2 filterscripts.
ThIs is the problem.
Me too. I got this problem only above 100 players in my server. And this happened. @BartNWD. So, how you solve this for this time?
I didn't solve :c
Have you solved this issue?
I'm experiencing the same problem, apparently with no effective resolution yet.