Raised This Month: $45 Target: $400
 11% 

C4 Timer


Post New Thread Reply   
 
Thread Tools Display Modes
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-08-2014 , 10:00   Re: C4 Timer
Reply With Quote #51

Quote:
Originally Posted by 3emu View Post
Can someone update the plugin?
For those of us who have never used this, you should post the bugs you've found or any other issues your having.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Dr Zayd
Senior Member
Join Date: Jun 2014
Location: forums.alliedmods.net
Old 05-21-2017 , 14:48   Re: C4 Timer
Reply With Quote #52

Added some to this plugin hope you like the modifications X))

Line
PHP Code:
/* AMX Mod X
*   Stats Logging Plugin
*
* by the AMX Mod X Development Team
*  originally developed by JustinHoMi
*
* This file is part of AMX Mod X.
*
*
*  This program is free software; you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by the
*  Free Software Foundation; either version 2 of the License, or (at
*  your option) any later version.
*
*  This program is distributed in the hope that it will be useful, but
*  WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*  General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software Foundation, 
*  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*  In addition, as a special exception, the author gives permission to
*  link the code of this program with the Half-Life Game Engine ("HL
*  Engine") and Modified Game Libraries ("MODs") developed by Valve, 
*  L.L.C ("Valve"). You must obey the GNU General Public License in all
*  respects for all of the code used other than the HL Engine and MODs
*  from Valve. If you modify this file, you may extend this exception
*  to your version of the file, but you are not obligated to do so. If
*  you do not wish to do so, delete this exception statement from your
*  version.
*/

#include <amxmodx>
#include <cstrike>

#define PLUGIN     "C4 Timer and Sound"
#define VERSION "1.6"
#define AUTHOR     "kwpd"

new g_c4timer
new cvar_showteam
new cvar_flash
new cvar_sprite
new cvar_msg
new g_Cvar
new g_C4
new g_msg_showtimer
new g_msg_roundtime
new g_msg_scenario

#define MAX_SPRITES    2
#define task_sound 69696969

new const g_timersprite[MAX_SPRITES][] = { "bombticking""bombticking1" }
new const 
g_message[] = "Detonation time intiallized....."

public plugin_precache() 
{
    
precache_sound("C4Female/ten.wav")
    
precache_sound("C4Female/nine.wav")
    
precache_sound("C4Female/eight.wav")
    
precache_sound("C4Female/seven.wav")
    
precache_sound("C4Female/six.wav")
    
precache_sound("C4Female/five.wav")
    
precache_sound("C4Female/four.wav")
    
precache_sound("C4Female/three.wav")
    
precache_sound("C4Female/two.wav")
    
precache_sound("C4Female/one.wav")
    
precache_sound("C4Female/boom.wav")
    
    return 
PLUGIN_HANDLED


public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
cvar_showteam    register_cvar("amx_showc4timer""3")
    
cvar_flash    register_cvar("amx_showc4flash""0")
    
cvar_sprite    register_cvar("amx_showc4sprite""1")
    
cvar_msg    register_cvar("amx_showc4msg""1")
    
    
g_msg_showtimer    get_user_msgid("ShowTimer")
    
g_msg_roundtime    get_user_msgid("RoundTime")
    
g_msg_scenario    get_user_msgid("Scenario")
    
    
register_event("HLTV""event_hltv""a""1=0""2=0")
    
register_logevent("RoundEnd",2,"1=Round_End")
    
register_logevent("RoundStart"2"1=Round_Start")
    
register_logevent("logevent_plantedthebomb"3"2=Planted_The_Bomb")
    
register_logevent("logevent_function_p"3"2=Defused_The_Bomb")
    
    
g_C4    get_cvar_pointer("mp_c4timer")
    
g_Cvar    register_cvar("amx_soundc4""1")
}

public 
event_hltv()
{
    
g_c4timer get_pcvar_num(g_C4)
}

public 
logevent_plantedthebomb()
{
    new 
showtteam get_pcvar_num(cvar_showteam)
    
    static 
players[32], numi
    
switch(showtteam)
    {
        case 
1
        {
            
get_players(playersnum"ace""TERRORIST")
        }
        case 
2
        {
            
get_players(playersnum"ace""CT")
        }
        case 
3
        {
            
get_players(playersnum"ac")
        }
        default: return
    }
    for(
0num; ++iset_task(1.0"update_timer"players[i])
}

public 
client_death(killervictimwpnindexhitplaceTK)
{
    if (
wpnindex == CSW_C4)
    {
    
client_cmd(0"spk C4Female/boom.wav")  
    return 
PLUGIN_CONTINUE 
    
}
    return 
PLUGIN_HANDLED
}

public 
update_timer(id)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msg_showtimer_id)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_msg_roundtime_id)
    
write_short(g_c4timer)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_msg_scenario_id)
    
write_byte(1)
    
write_string(g_timersprite[clamp(get_pcvar_num(cvar_sprite), 0, (MAX_SPRITES 1))])
    
write_byte(150)
    
write_short(get_pcvar_num(cvar_flash) ? 20 0)
    
message_end()
    
    if(
get_pcvar_num(cvar_msg))
    {
        
set_hudmessage(25518000.440.8726.06.0)
        
show_hudmessage(idg_message)
    }
}

public 
bomb_planted(planter
{
    new 
Name[32]
    new 
id task_sound
    
    
if(get_pcvar_num(g_Cvar))
    {
        
get_user_name(planterName31)  
        
        new 
time get_pcvar_num(g_C4)
        
        
float(time)
        
set_task( (time 10.0) , "Zero"task_sound+id)
        
set_task( (time 9.0) , "one"task_sound+id)
        
set_task( (time 8.0) , "two"task_sound+id)
        
set_task( (time 7.0) , "three"task_sound+id)
        
set_task( (time 6.0) , "foor"task_sound+id)
        
set_task( (time 5.0) , "five"task_sound+id)
        
set_task( (time 4.0) , "six"task_sound+id)
        
set_task( (time 3.0) , "seven"task_sound+id)
        
set_task( (time 2.0) , "eigth"task_sound+id)
        
set_task( (time 1.0) , "nine"task_sound+id)
    }
    return 
PLUGIN_CONTINUE  
}

public 
Zero()  
{
    
client_cmd(0"spk C4Female/ten.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
one()  
{
    
client_cmd(0"spk C4Female/nine.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
two()  
{
    
client_cmd(0"spk C4Female/eight.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
three()  
{
    
client_cmd(0"spk C4Female/seven.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
foor()  

    
client_cmd(0"spk C4Female/six.wav"  
    
client_cmd(0"spk C4Female/boom.wav")            
    return 
PLUGIN_CONTINUE  
}

public 
five()  
{
    
client_cmd(0"spk C4Female/five.wav" )  
    return 
PLUGIN_CONTINUE  
}

public 
six()  
{
    
client_cmd(0"spk C4Female/four.wav" 
    return 
PLUGIN_CONTINUE  
}

public 
seven()  
{
    
client_cmd(0"spk C4Female/three.wav"
    return 
PLUGIN_CONTINUE  
}

public 
eigth()  
{
    
client_cmd(0"spk C4Female/two.wav"  )  
    return 
PLUGIN_CONTINUE  
}

public 
nine()  
{
    
client_cmd(0"spk C4Female/one.wav")  
    return 
PLUGIN_CONTINUE  
}

public 
logevent_function_p()
{
    new 
id task_sound
    remove_task
(task_sound+id)
}

public 
RoundEnd()
{
    new 
id task_sound
    remove_task
(task_sound+id)
}

public 
RoundStart()  
{
    new 
id task_sound
    remove_task
(task_sound+id)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang6154{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
WAV File : HERE
__________________
Invisible System | 100%
ـــــــــــــــــــــــــــــ
Anti setinfo check | Ez Plugin and lite
ـــــــــــــــــــــــــــــ
[ZP] Free VIP Menu | Free VIP menu | ZP-Mod |
Dr Zayd is offline
Frizzakis
Junior Member
Join Date: Mar 2015
Old 08-18-2021 , 10:02   Re: C4 Timer
Reply With Quote #53

could someone please add the countdown voice from miscstats and send the code here? thanks
Frizzakis is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 08-18-2021 , 10:49   Re: C4 Timer
Reply With Quote #54

Quote:
Originally Posted by Frizzakis View Post
could someone please add the countdown voice from miscstats and send the code here? thanks
Use this. Set the VOICE_SPEAKER.
https://forums.alliedmods.net/showthread.php?t=278600
__________________
+ARUKARI- is offline
Frizzakis
Junior Member
Join Date: Mar 2015
Old 08-18-2021 , 10:58   Re: C4 Timer
Reply With Quote #55

Quote:
Originally Posted by +ARUKARI- View Post
hey, thanks for the reply. i already saw it and its nice, but i prefer the simpler version of the timer this one here offers just need the vox voice added
Frizzakis 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 14:33.


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