Maybe something like this. I'm too tired to explain everything, just made the code. I hope you will get it. If you can't, maybe someone could explain it before me. If not, I could do this.
Take a look.
PHP Code:
#include <amxmodx>
#include <fun>
new CountRounds[33], CountUses[33]
new cvarMaxUses, cvarPerRounds
new MaxUses, PerRounds
new UserID
public plugin_init() {
register_clcmd("say /ak", "cmdAK") //Test for counts of uses
cvarMaxUses = register_cvar("max_uses_cvar", "3")
cvarPerRounds = register_cvar("for_x_rounds_cvar", "2")
register_event("HLTV", "NewRound", "a", "1=0", "2=0")
}
public cmdAK(id)
{
MaxUses = get_pcvar_num(cvarMaxUses)
PerRounds = get_pcvar_num(cvarPerRounds)
if(CountUses[id] >= MaxUses && CountRounds[id] <= PerRounds)
{
client_print(id, print_chat, "You have already used ak47 max times (%d) for %d rounds", MaxUses, PerRounds)
return PLUGIN_HANDLED
}
CountUses[id]++
UserID = get_user_userid(id)
give_item(id, "weapon_ak47")
client_print(id, print_chat, "You successfully got ak47!")
return PLUGIN_CONTINUE
}
public NewRound()
{
new id = find_player("k", UserID)
if(!is_user_connected(id))
return PLUGIN_HANDLED
if(CountRounds[id] >= PerRounds)
{
CountRounds[id] = 0
CountUses[id] = 0
}
CountRounds[id]++
return PLUGIN_CONTINUE
}
__________________