/* Plugin generated by
AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#define PLUGIN "[
ZP] Donate Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "r1laX , PomanoB"
new g_UserTotalAmmo[33]
new g_CvarAllowDonate
new SayText
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
g_CvarAllowDonate = register_cvar("zp_stats_allow_donate", "1")
register_clcmd("say", "handleSay")
register_clcmd("say_team", "handleSay")
register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
SayText = get_user_msgid("SayText")
}
public RoundStart()
{
if (get_pcvar_num(g_CvarAllowDonate))
set_task(2.2, "MsgOnRoundStart")
}
public MsgOnRoundStart()
{
if(get_pcvar_num(g_CvarAllowDonate))
client_printcolor(0, "!g[
ZP] !yAby przekazac ap dla graczy wpisz /daj")
}
public handleSay(id)
{
new args[64]
read_args(args, charsmax(args))
remove_quotes(args)
new arg1[16]
new arg2[32]
strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
if (get_pcvar_num(g_CvarAllowDonate) && equal(arg1,"/daj", 7))
donate(id, arg2)
}
public donate(id, arg[])
{
new to[32], count[10]
strbreak(arg, to, 31, count, 9)
if (!to[0] || !count[0])
{
client_printcolor(id, "!g[
ZP] !yWpisz: say /daj <nick> <ilosc>")
return