Raised This Month: $ Target: $400
 0% 

End Round Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 09:49   Re: End Round Sound
Reply With Quote #1

Try this :

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Custom Bomb Pre-Warning"
#define VERSION "1.0.0"
#define AUTHOR "Kia"

// !!!
// ===============================================================================
//     WARNING! THIS PLUGIN IS UNTESTED! USE ON OWN RISK!
// ===============================================================================
// !!!

// ===============================================================================
//     Editing begins here
// ===============================================================================

// Time in Seconds when the Sound should start before Bomb explodes (X seconds before Bomb explodes)
#define TIME_LEFT_TO_PLAY 4.0

// Your sound file (.wav or .mp3 (Note : If you want to use a .mp3 add "sound/" at szSound))
new szSound[] = "misc/csclubdd2infnuke/Warning.wav"

// ===============================================================================
//     and stops here. DO NOT MODIFY BELOW UNLESS YOU KNOW WHAT YOU'RE DOING
// ===============================================================================

// ===============================================================================
//     Variables
// ===============================================================================

/* Defines */

#define TASK_ID_SOUND 1921

// ===============================================================================
//     plugin_precache
// ===============================================================================

public plugin_precache()
{
    if (
equal(szSound[strlen(szSound)-4], ".mp3"))
        
precache_generic(szSound)
    else
        
precache_sound(szSound)
}

// ===============================================================================
//     plugin_init
// ===============================================================================

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
/* Events */
    
    
register_logevent("LogEvent_BombPlanted"3"2=Planted_The_Bomb")
    
register_logevent("LogEvent_BombDefused"3"2=Defused_The_Bomb")
}

// ===============================================================================
//     LogEvent_BombPlanted - Called when the bomb was planted
// ===============================================================================

public LogEvent_BombPlanted()
{
    new 
iTime get_cvar_pointer("mp_c4timer")
    
    
set_task(iTime TIME_LEFT_TO_PLAY"PlayCustomSound"TASK_ID_SOUND)
}

// ===============================================================================
//     LogEvent_BombDefused - Called when the bomb was defused
// ===============================================================================

public LogEvent_BombDefused()
{
    if(
task_exists(TASK_ID_SOUND))
        
remove_task(TASK_ID_SOUND)
}

// ===============================================================================
//     PlayCustomSound - Plays your custom sound
// ===============================================================================

public PlayCustomSound()
{
    if (
equal(szSound[strlen(szSound)-4], ".mp3"))
        
client_cmd(0"mp3 play ^"%s^""szSound)
    else
        
client_cmd(0"spk ^"%s^""szSound)

__________________
Kia is offline
skunew
Member
Join Date: Dec 2013
Old 12-30-2013 , 10:04   Re: End Round Sound
Reply With Quote #2

No :/
Sound play when i put c4
skunew is offline
Reply



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 20:31.


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