Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Disappearance of dynamic objects

 
  • 0 Vote(s) - 0 Average
Pawn Disappearance of dynamic objects
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#1
2020-12-15, 11:07 PM (This post was last modified: 2020-12-15, 11:08 PM by Radical.)
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?
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#2
2020-12-15, 11:24 PM
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.
DaZzY
Offline

Burgershot Member
Posts: 74
Threads: 12
Joined: Oct 2020
Reputation: 2
#3
2020-12-16, 04:25 PM (This post was last modified: 2020-12-16, 04:25 PM by DaZzY.)
Do you use latest Streamer Plugin & include versions ?
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#4
2020-12-17, 12:15 PM (This post was last modified: 2020-12-18, 12:31 AM by Radical.)
I upgraded the VPS RAM to 6GB.
But still, dynamic objects disappear.
I have the latest version of streamer
Markski
Offline

Burgershot Clerk

Posts: 127
Threads: 6
Joined: Apr 2019
Reputation: 5
Location: La Plata, Argentina
#5
2020-12-19, 02:54 AM
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;
}
Website
« 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