09-22-2012, 01:55 AM
This is my first contacts with hazards.
There are 5 barrels. The barrels should be spawn randomly, and should removed randomly.
Here is my script:
Can anyone tell me, that I have done false?
There are 5 barrels. The barrels should be spawn randomly, and should removed randomly.
Here is my script:
PHP Code:
void OnStart()
{
int iBarrel = RandFloat(1, 6);
AddTimer("remove_barrel", 2, "Remove_Barrel_Timer");
AddTimer("barrel", 1, "BarrelTimer");
}
void BarrelTimer(string &in asTimer)
{
SetEntityActive("barrel_" +iBarrel , true);
AddTimer("barrel", 3, "BarrelTimer");
}
void Remove_Barrel_Timer(string &in asTimer)
{
if (GetEntityExists("barrel_" +iBarrel) == true)
{
SetEntityActive("barrel_" +iBarrel, false);
AddTimer("remove_barrel", 5, "Remove_Barrel_Timer");
}
}
Can anyone tell me, that I have done false?