PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "RiskItAll"
#define VERSION "0.0"
#define AUTHOR "Bent/Soccdoodcss"
new bet[7], money
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("RoundTime", "say_bet", "b")
register_event("SendAudio", "receive_bet", "b")
register_concmd("amx_bet", "set_bet", 0)
}
public say_bet(id)
{
set_hudmessage(255,0,0,0.43,0.3,0,6.0,10.0)
show_hudmessage(id, "Place One Or Multiple Bets.")
}
public set_bet(id)
{
read_argv(1, bet, 6)
money = str_to_num(bet)
if (money > cs_get_user_money(id))
money=cs_get_user_money(id)
else if (money<0)
money=0
if(money!=0)
cs_set_user_money(id, cs_get_user_money(id) - money)
}
public receive_bet(id)
{
if(is_user_alive(id))
{
set_hudmessage(0, 255, 0, 0.43, 0.3, 0, 6.0, 10.0)
show_hudmessage(id, "You won your money and $%d.", money)
cs_set_user_money(id, cs_get_user_money(id) + money + money)
}
else
{
set_hudmessage(0,255,0,0.45,0.3,0,6.0,10.0)
show_hudmessage(id, "You lost $%d.", money)
}
money = 0
return PLUGIN_CONTINUE
}
Anyone know why the SendAudio is showing up at the beginning of a new round? Thanks.