Object Respawn - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Object Respawn (
/showthread.php?tid=158764)
Object Respawn -
Nonameman - 11.07.2010
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
Re: Object Respawn -
Lorenc_ - 11.07.2010
Maybe set a timer for every 2minutes it recreates the object?
Re: Object Respawn -
Betamaster - 11.07.2010
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.
Re: Object Respawn -
Lorenc_ - 11.07.2010
but it could work by creating the object every 3minutes?
Re: Object Respawn -
Ernis456 - 11.07.2010
Set timer to destroy destroyable object and create new every 10 sec.
Re: Object Respawn -
Nonameman - 11.07.2010
Ok, thanks, I'll try the timer out
Re: Object Respawn -
Nonameman - 11.07.2010
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?
Re: Object Respawn -
Nonameman - 11.07.2010
Guys, just a 'Yes' or 'No' pls.
Re: Object Respawn -
n4pkill - 16.10.2010
im not sure that the "MAX_STREAM_OBJECTS" variable is correct
Re: Object Respawn -
Babul - 16.10.2010
NO.
5678