Thereīs a important thing.
if you donīt want to to have the range between 0 and 4 but in 1 and 5 use this code and for action itīs in c_script:
function random_one()
{
var random_value_one;
random_value_one = int(random(5)+1);
if(random_value_one == 1)
{
give_weapon();
}
if(random_value_one == 2)
{
give_armor();
}
if(random_value_one == 3)
{
give_powerup();
}
if(random_value_one == 4)
{
give_crap();
}
if(random_value_one == 5)
{
give_nothing();
}
}
for lite_c i think you can use this.
function random_one()
{
var random_item = 0;
random_item = integer(random(5)+1); // 5 possibilities
switch(random_item)
{
case 1 : GivePlayerAmmo(); break;
case 2 : GivePlayerArmor(); break;
case 3 : GivePlayerHealth(); break;
case 4 : GivePlayerWeapon(); break;
case 5 : GivePlayerLife(); break;
}
}
Donīt forget to set "random_seed(0)" or "randomize()" in older versions before the level_load instruction.
This will bring you absolute random values otherwise they would always be the same.
greets