Hey, i got this plugin running on my Hide n Seek server.
Its a chance to get items at start of each round plugin ;) I got some extra health, scout, dgl. armor and shield added atm.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define Plugin "Weapon Chance"
#define Version "1.0"
#define Author "Doombringer"
#define TIME_TO_WAIT 5.0
public plugin_init()
{
register_plugin(Plugin, Version, Author)
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]
if(random_num(0, 100) <= 1)
{
give_item(player, "weapon_scout")
cs_set_user_bpammo(player, CSW_SCOUT, 0)
client_print(player, print_chat, "You were lucky, you got a scout with 1 bullet")
}
if(random_num(0, 100) <= 5)
{
give_item(player, "weapon_deagle")
cs_set_user_bpammo(player, CSW_DEAGLE, 0)
client_print(player, print_chat, "You were lucky, you got a deagle with 1 bullet")
}
if(random_num(0, 100) <= 15)
{
give_item(player, "weapon_hegrenade")
client_print(player, print_chat, "You were lucky, you got a HE-grenade")
}
if(random_num(0, 100) <= 10)
{
give_item(player, "weapon_shield")
client_print(player, print_chat, "You were lucky, you got a shield")
}
if(random_num(0, 100) <= 2)
{
set_user_health(player, 200)
client_print(player, print_chat, "You were lucky, you got 100 extra health, if you walk on a healer you will loose this extra health")
}
if(random_num(0, 100) <= 4)
{
set_user_health(player, 150)
client_print(player, print_chat, "You were lucky, you got 50 extra health, if you walk on a healer you will loose this extra health")
}
if(random_num(0, 100) <= 8)
{
set_user_health(player, 125)
client_print(player, print_chat, "You were lucky, you got 25 extra health, if you walk on a healer you will loose this extra health")
}
if(random_num(0, 100) <= 25)
{
cs_set_user_armor(player, 100, CS_ARMOR_VESTHELM)
client_print(player, print_chat, "You were lucky, you got a kevlar and helmet")
}
}
}
public round_start()
{
set_task(TIME_TO_WAIT, "main_func")
}
My question is if its possible to make the shield "chance to get" only work for T's?