OK I have this and it works...some of the time...
Code:
new players[32], num
new i
get_players(players, num)
new rnd
rnd = random_num(0,100)
if( rnd <= 100)
{
give_item(id, "weapon_awp")
new WeapEntIndex = find_ent_by_owner(-1, "weapon_awp", players[i], 0);
cs_set_weapon_ammo(WeapEntIndex, 3);
client_print(players[i], print_chat, "You got an awp with 3 bullets! (1/20 Chance)")
i++
}
else if(rnd > 5 && rnd <= 15)
{
give_item(id, "weapon_p228")
new WeapEntIndex = find_ent_by_owner(-1, "weapon_p228", players[i], 0);
cs_set_weapon_ammo(WeapEntIndex, 2);
client_print(id, print_chat, "You got a P228 with 2 bullets! (1/10 Chance)")
i++
}
else if(rnd > 15 && rnd <= 30)
{
give_item(id, "item_shield")
client_print(id, print_chat, "You got a Shield! (1/6 Chance)")
}
else if(rnd >30 && rnd <= 60)
{
give_item(id, "weapon_hegrenade")
client_print(id, print_chat, "You got a HE Grenade! (1/3 Chance)")
}
else if(rnd > 60 && rnd <= 100)
{
give_item(id, "weapon_p228")
client_print(id, print_chat, "...")
}
}