CreateObject and DestroyObject
#1

Hello, I own several events in my server, that when creating the event, and objects are created when the event is over, the objects are automatically destroyed.

However, over time and to start other events, there comes a certain time to begin to rise as objects, but the other events have been destroyed.

It seems that 1000 sa objects count: mp does not diminish when I use DestroyObject.

Can anyone tell me the reason for this event?

Exp Codes: http://pastebin.com/PxaPYxem
Reply
#2

Ofcourse the code you pasted will work, just like as you said.

But your problem is not create/destroy object as you said it does work, as you said again your problem is "a certain time" that objects begin rise or not deleted when other events have been destroyed. But you did not show us the "Event Callback" codes at where you are creating and destroying the objects, so how do we know when it's called? For sure, if you place code on global scope like that same as exactly in the pastebin, the create and destroy object code will not have executed.

Here, "event callback" that i mean is the certain time when something is changed or updated so it can be handled with code (example, OnPlayerConnect, it's an event that is called when a player successfully connected to the server).
So we are expecting that you showed us the code where you used it like this:
Код:
new ObjectosCS[18];
public LoadEvent() // your custom callback for loading event
{
     // ....
    ObjetosCS[1] = CreateObject(3434, 1491.32349, 2773.79346, 14.19130,   0.00000, 0.00000, 90.00000,100.0);
    // etc
}

public EndEvent() // your custom callback for ending event
{
    // ...
    for(new f = 0; f < sizeof(ObjetosCS); f ++)
    {
        DestroyObject(ObjetosCS[f]);
    }
    // ...
}
And then we might help you identify the problem.

The reason is you might have not done the code correctly on event callback, or there are some cases when the object should be destroyed but you didn't placed the destroy object code there...

Also i'm not sure what you mean with 1000 objects, i think if you have created alot objects (more than 1000 at a time), then you need to use Streamer Plugin.

Well, that's all i can guess, good luck finding that certain time cases hope that can helps.
Reply
#3

then friend, I work with the samp a long time, I understand quite ..
My question is really about the objects being destroyed (they add up) and it seems to me, even disappearing they are still having an effect on the count of 1,000 standard objects sa: mp.
works exactly the way you posted when creating the event, they are created and the end of the event, are destroyed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)