AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   End Round Sound (https://forums.alliedmods.net/showthread.php?t=232424)

skunew 12-30-2013 09:35

End Round Sound
 
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

Kia 12-30-2013 09:49

Re: End Round Sound
 
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)



skunew 12-30-2013 10:04

Re: End Round Sound
 
No :/
Sound play when i put c4

Kia 12-30-2013 10:05

Re: End Round Sound
 
What do you have on mp_c4timer?

skunew 12-30-2013 10:07

Re: End Round Sound
 
30 sec.
asked me about it?

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

Kia 12-30-2013 10:13

Re: End Round Sound
 
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.

skunew 12-30-2013 10:18

Re: End Round Sound
 
When i plant it. And when i plant play two sound cuz i have plugin for sound plant

Kia 12-30-2013 10:20

AW: Re: End Round Sound
 
Quote:

Originally Posted by skunew (Post 2078514)
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.

skunew 12-30-2013 10:23

Re: End Round Sound
 
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

Kia 12-30-2013 10:25

Re: End Round Sound
 
At public LogEvent_BombPlanted() you see :

new iTime = get_cvar_pointer("mp_c4timer")

change it to :

new Float:iTime = get_cvar_pointer("mp_c4timer")


All times are GMT -4. The time now is 20:32.

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