Basically what I want to do is give random equipment, and a certain ammount of it each round to all the players (maybe different to each player?).
THE PROBLEM NOW - Look at my bottom post for explaination.
Code:
#define AMX_MOD_X
#include <amxmodx>
#include <cstrike>
#include <fun>
#define MAX_LINES 64
#define MAX_STRING_LEN 256
new Title[32] = "Random Equip"
new Version[32] = "0.0.0"
new Author[16] = "TaRgEt*TuRkEy"
new ammo_type
new ammo_amount
public plugin_init() {
register_plugin(Title,Version,Author)
register_logevent("new_round", 2, "1=Round_Start")
}
public new_round(id) {
new weapon[32]
new User[32]
new RandomNum = random(5) +1
if (RandomNum == 1)
{
ammo_type = 1
ammo_amount = 1
client_print(0,print_chat, "[AMX] <Random Equip> Your have recieved a complimentry P228!", User)
} else if (RandomNum == 2){
ammo_type = 3
ammo_amount = 1
client_print(0,print_chat, "[AMX] <Random Equip> Your have recieved a stunning Scout!", User)
} else if (RandomNum == 3){
ammo_type = 4
ammo_amount = 2
client_print(0,print_chat, "[AMX] <Random Equip> Your have recieved a 2 Hand Grenades!", User)
} else if (RandomNum == 4){
ammo_type = 5
ammo_amount = 1
client_print(0,print_chat, "[AMX] <Random Equip> Your have recieved a noobish XM1014!", User)
} else if (RandomNum == 5){
ammo_type = 7
ammo_amount = 1
client_print(0,print_chat, "[AMX] <Random Equip> Your have recieved an unaccurate Mac10!", User)
}
get_weaponname(ammo_type,weapon,sizeof(weapon))
give_item(id,weapon)
cs_set_user_bpammo(id,ammo_type,ammo_amount)
return PLUGIN_CONTINUE
}