• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Disappearance of dynamic objects
#1
I have 10,300 dynamic objects, some of which disappear after 24 hours.

Game mode runs on a vps with 1 GB of RAM.

The problem is the lack of RAM or what?
  Reply
#2
Should be lack of RAM
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
Do you use latest Streamer Plugin & include versions ?
  Reply
#4
I upgraded the VPS RAM to 6GB.
But still, dynamic objects disappear.
I have the latest version of streamer
  Reply
#5
I've faced this error a few times, avoiding it comes down to following two key practices:



- Always check if a dynamic object is valid with IsValidDynamicObject(objectid) before destroying it.

- When destroying an object, ALWAYS set the variable which held it to INVALID_OBJECT_ID to avoid collisions with newly created objects in the future.



This helper should do both:



Code:
stock DestroyDynObj(&objectid) {

    new bool:success = false;

    if (IsValidDynamicObject(objectid) {

        DestroyDynamicObject(objectid);

        success = true;

    }

    objectid = INVALID_OBJECT_ID;

    return success;

}
  Reply


Forum Jump: