04-23-2012, 11:29 PM
Code:
void badbarrel(string &in asEntity)
{
int iBarrel = RandInt(1, 3);
if(iBarrel == 3)
{
SetPropHealth("badbarrel", 0);
}
}
This is the code I have now that has a 1 in 3 chance of the barrel exploding when the player picks it up.
The thing is once it has chosen the random number it may not blow up until you load the map again.
I want it to choose a random number every time the barrel is picked up and check if int == 3 to see if it should explode.
What am I missing here? A For loop?