Raised This Month: $ Target: $400
 0% 

mp3 play problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
pob18
Member
Join Date: Jun 2014
Old 07-01-2014 , 14:40   Re: mp3 play problems
Reply With Quote #11

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#include <hamsandwich>
#include <fun>

#define PRECACHE_SOUND "myserver/music.mp3"



new TimerSecondsCvar
new bool:g_knife true

public plugin_init()
{
    
    
register_event("DeathMsg""on_death""a")
    
register_event"CurWeapon""EventCurWeapon""be""2!29" )
    
    
SecondsCvar register_cvar("auto_rr_time","50.0")

    
Timer get_pcvar_num(SecondsCvar)
    
set_task(1.0"start_rr_timer"___"a"Timer)
}


public 
plugin_precache()
    
precache_sound(PRECACHE_SOUND)


public 
on_death()
{
    new 
victim
    victim 
read_data(2)
    
    if(
g_knife)
        
set_task(1.0"fnRevivePlayer"victim)
}

public 
fnRevivePlayer(id
{
    if(!
is_user_alive(id)) 
        
ExecuteHamB(Ham_CS_RoundRespawnid)    
}

public 
EventCurWeapon(id)
{
    if(
g_knife)
    {
        
engclient_cmd(id"weapon_knife")
        
set_user_gravity(id0.5)
    }
}

public 
start_rr_timer()
{
    
Timer--
    
    
PlaySound(0,PRECACHE_SOUND)
    
    
set_dhudmessage(24000, -1.00.0800.00.01)
    
show_dhudmessage(0"time to rr: %d"Timer)

    if(
Timer 1)
    {
        
server_cmd("sv_restartround 1")
        
set_task(3.0"rr_end")
        
set_task(3.0"off_gravity")
        
g_knife false
    
}
}

public 
rr_end()
{
    
set_dhudmessage(random_num(0255), random_num(0255), random_num(0255), -1.00.7826.03.00.11.5false )
    
show_dhudmessage(0"good luck")
}

public 
off_gravity(id
{
    
client_cmd(0"stopsound")
    new 
players[32], num
    get_players
(playersnum"c")
    for (new 
0;num;i++)
                   
set_user_gravity(players[i], 1.0
}

stock PlaySound(id, const sound[])
{
    if (
equal(sound[strlen(sound)-4], ".mp3"))
        
client_cmd(id"mp3 play ^"%s^""sound)
    else
        
client_cmd(id"spk ^"%s^""sound)

pob18 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:07.


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