|
Member
|

12-09-2007
, 19:55
weapon chance
|
#1
|
how do i set how many bullets the gun should have ?
Quote:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define TIME_TO_WAIT 2.0
public plugin_init()
{
register_logevent("round_start", 2, "1=Round_Start")
}
public main_func()
{
new players[32], num
get_players(players, num)
new player
for(new i = 0; i < num; i++)
{
player = players[i]
new health = get_user_health(player);
if(random_num(0, 100) <= 1)
{
give_item(player, "weapon_awp")
cs_set_user_bpammo(player, CSW_AWP, 0)
client_print(player, print_chat, "Lucky You have got a awp with 1 bullet (1% chance)")
}
if(random_num(0, 100) <= 3)
{
give_item(player, "weapon_deagle")
cs_set_user_bpammo(player, CSW_DEAGLE, 0)
client_print(player, print_chat, "Lucky You have got a deagle with 1 bullet (3% chance)")
}
if(random_num(0, 100) <= 6)
{
give_item(player, "weapon_fiveseven")
cs_set_user_bpammo(player, CSW_FIVESEVEN, 0)
client_print(player, print_chat, "Lucky You have got a fiveseven (with 4 bullet (6% chance)")
}
if(random_num(0, 100) <= 15)
{
give_item(player, "weapon_hegrenade")
client_print(player, print_chat, "Lucky You have got a HE-grenade (15% chance")
}
if(random_num(0, 100) <= 2)
{
health += 100;
set_user_health(player,health);
client_print(player, print_chat, "Lucky You have got 100 extra health, if you walk on a healer you will loose this extra health (2% chance")
}
if(random_num(0, 100) <= 4)
{
health += 50;
set_user_health(player,health);
client_print(player, print_chat, "Lucky You have got 50 extra health, if you walk on a healer you will loose this extra health (4% chance")
}
if(random_num(0, 100) <= 
{
health += 25;
set_user_health(player,health);
client_print(player, print_chat, "Lucky You were got 25 extra health, if you walk on a healer you will loose this extra health (8% chance")
}
}
}
public round_start()
{
set_task(TIME_TO_WAIT, "main_func")
}
|
Last edited by duckluck0077; 12-10-2007 at 16:40.
|
|