AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with SendAudio (https://forums.alliedmods.net/showthread.php?t=50080)

soccdoodcss 01-19-2007 02:02

Help with SendAudio
 
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(PLUGINVERSIONAUTHOR)
    
    
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(1bet6)
    
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(idcs_get_user_money(id) - money)
}

public 
receive_bet(id)
{
    if(
is_user_alive(id))
    {
        
set_hudmessage(025500.430.306.010.0)
        
show_hudmessage(id"You won your money and $%d."money)
        
cs_set_user_money(idcs_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.

XxAvalanchexX 01-19-2007 02:10

Re: Help with SendAudio
 
It's probably the "Okay let's go!" sound clips. You probably want to use hook only objective-based ones, such as "The bomb has been planted!"

soccdoodcss 01-20-2007 11:52

Re: Help with SendAudio
 
Alright thanks, is there perhaps another event at the end of the round that I am not familiar with?

[ --<-@ ] Black Rose 01-20-2007 16:40

Re: Help with SendAudio
 
End of round:
Code:
register_event("SendAudio", "event_EndRound", "a", "1=0");

soccdoodcss 01-25-2007 18:59

Re: Help with SendAudio
 
Thanks a lot.


All times are GMT -4. The time now is 22:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.