Object Respawn
#1

Hey!

I'm using 'MidoStream - Object Streamer', and I have more than 2000 objects in my server. There are some destroyable (with vehicles) objects, and I want to respawn them after 10 secs they destroyed. How can I do this, if I cannot give them all an ID, because there are more than 200 destroyable objects?

Nonameman
Reply
#2

Maybe set a timer for every 2minutes it recreates the object?
Reply
#3

In the current version of SA-MP you cannot detect when a destroyable object is destroyed, so destroyable objects can only be recreated if your streamer re-streams (creates) them.
Reply
#4

but it could work by creating the object every 3minutes?
Reply
#5

Set timer to destroy destroyable object and create new every 10 sec.
Reply
#6

Ok, thanks, I'll try the timer out
Reply
#7

pawn Код:
public OnGameModeInit()
{
LoadObjects();
return 1;
}
pawn Код:
public OnGameModeExit()
{
KillTimer(ObjectRespawn());
return 1;
}
pawn Код:
forward LoadObjects();
public LoadObjects()
{
CreateStreamObject(...);
SetTimer("ObjectRespawn", 60*60*1000, true); //1 hour is enough =)
return 1;
}
pawn Код:
forward ObjectRespawn();
public ObjectRespawn()
{
for(new i=0; i<MAX_STREAM_OBJECTS; i++)
{
DestroyStreamObject(i);
}
return LoadObjects();
}
Is this correct?
Reply
#8

Guys, just a 'Yes' or 'No' pls.
Reply
#9

im not sure that the "MAX_STREAM_OBJECTS" variable is correct
Reply
#10

NO.
5678
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)