Raised This Month: $ Target: $400
 0% 

End Round Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skunew
Member
Join Date: Dec 2013
Old 12-30-2013 , 09:35   End Round Sound
Reply With Quote #1

Hi
Please give/write me plugin.
This plugin must play sound 4 sec before end round or c4 explosion.

Are u know? When c4timer or timelimit is 4sec this plugin play misc.

This sound: http://speedy.sh/3Cdgu/Warning.wav

sound/misc/csclubdd2infnuke/Warning.wav
skunew is offline
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 #2

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 #3

No :/
Sound play when i put c4
skunew is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 10:05   Re: End Round Sound
Reply With Quote #4

What do you have on mp_c4timer?
__________________
Kia is offline
skunew
Member
Join Date: Dec 2013
Old 12-30-2013 , 10:07   Re: End Round Sound
Reply With Quote #5

30 sec.
asked me about it?

I wont to this misc play 4 sec before end round and 4 sec before exposion c4

Last edited by skunew; 12-30-2013 at 10:09.
skunew is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 10:13   Re: End Round Sound
Reply With Quote #6

Your english is weird.
Is the sound playing right before the explosion or when you plant it?
About Round End, I didn't see that, will add it later.
__________________
Kia is offline
skunew
Member
Join Date: Dec 2013
Old 12-30-2013 , 10:18   Re: End Round Sound
Reply With Quote #7

When i plant it. And when i plant play two sound cuz i have plugin for sound plant
skunew is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 10:20   AW: Re: End Round Sound
Reply With Quote #8

Quote:
Originally Posted by skunew View Post
When i plant it. And when i plant play two sound cuz i have plugin for sound plant
Hmm, that's strange, maybe I did something wrong.
Try changing "new iTime" to "new Float:iTime".
Maybe it's not working because the C4 Time is a float.
__________________
Kia is offline
skunew
Member
Join Date: Dec 2013
Old 12-30-2013 , 10:23   Re: End Round Sound
Reply With Quote #9

I dont understand you. This plugin play misc when c4 is planted and c4 time = 30 . I wont plugin for sound 4 sec bedore end round
skunew is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 10:25   Re: End Round Sound
Reply With Quote #10

At public LogEvent_BombPlanted() you see :

new iTime = get_cvar_pointer("mp_c4timer")

change it to :

new Float:iTime = get_cvar_pointer("mp_c4timer")
__________________
Kia is offline
Reply


Thread Tools
Display Modes

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