"Timestamping" objects?
#1

I have a filterscript here that spawns a heap of explosive barrels, but on a timer, so it spawns maybe 8 every 5 seconds or so.

The idea of this is sort of a shooting game, where players shoot the barrels as they roll down a steep ramp, trying to stop them from reaching the player and killing them.

The issue is, since sa-mp can't detect the barrels exploding and destroy their objectids, I hit the sa-mp object limit very quickly, even though the barrels are exploding.

It was suggested that I put all the barrels on a timer, so that they are destroyed via code after a certain time.

The issue I'm having is, how to destroy the barrels after a set time from them spawning? I'm currently storing all the generated barrel ID's in an array, but there is no way of knowing when each barrel was spawned, and thus, when it needs to be destroyed.

What do you think would be the best way to go about this?

Thanks
Reply
#2

Uhh.. Try.. making the respawn time of the Barrel to something like 10? So if it explodes, it respawns at exactly 10 seconds
Reply
#3

That's what I'm having issues with. CreateObject doesn't specify a respawn time, so I have to somehow do it manually.
Reply
#4

When you create new barrel destroy old one...
Reply
#5

The barrels are spawned every few seconds, they wouldn't go anywhere before being destroyed and recreated back where they started.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)