30.12.2011, 15:00
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
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