Raised This Month: $ Target: $400
 0% 

[REQ] C4 Timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bblair
Member
Join Date: Aug 2009
Location: Belgium
Old 09-15-2009 , 08:02   [REQ] C4 Timer
Reply With Quote #1

i search this c4 timer

Last edited by bblair; 09-15-2009 at 14:36.
bblair is offline
Send a message via MSN to bblair
Wiggen94
Member
Join Date: Jul 2009
Location: Schweden
Old 09-15-2009 , 14:06   Re: [REQ] C4 Timer
Reply With Quote #2

isn't this better?
http://forums.alliedmods.net/showthread.php?p=483666
__________________
[IMG]http://img283.**************/img283/8743/tankausbl8.png[/IMG]
Wiggen94 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-15-2009 , 14:08   Re: [REQ] C4 Timer
Reply With Quote #3

http://forums.alliedmods.net/showthread.php?p=803602
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bblair
Member
Join Date: Aug 2009
Location: Belgium
Old 09-15-2009 , 14:17   Re: [REQ] C4 Timer
Reply With Quote #4

Thanks

Last edited by bblair; 09-15-2009 at 14:36.
bblair is offline
Send a message via MSN to bblair
GmTx
BANNED
Join Date: May 2009
Location: Mountains [BG/Sofia]
Old 09-15-2009 , 14:35   Re: [REQ] C4 Timer
Reply With Quote #5

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Bomb Hud"
#define VERSION "1.0"
#define AUTHOR "GmTx"

new cvar_pointer
new g_c4timer
new bool:b_planted false;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
cvar_pointer get_cvar_pointer("mp_c4timer")
    
    
register_logevent("newRound"2"1=Round_Start")
    
register_logevent("endRound"2"1=Round_End")
    
register_logevent("endRound"2"1&Restart_Round_")
}

public 
newRound()
{
    
g_c4timer = -1;
    
remove_task(652450);
    
b_planted false;
}

public 
endRound()
{
    
g_c4timer = -1;
    
remove_task(652450);
}

public 
bomb_planted()
{
    
b_planted true;
    
g_c4timer get_pcvar_num(pointnum);
    
dispTime()
    
set_task(1.0"dispTime"652450""0"b");
}

public 
bomb_defused()
{
    if(
b_planted)
    {
        
remove_task(652450);
        
b_planted false;
    }
    
}

public 
bomb_explode()
{
    if(
b_planted)
    {
        
remove_task(652450);
        
b_planted false;
    }
    
}

public 
dispTime()
{   
    if(!
b_planted)
    {
        
remove_task(652450);
        return;
    }
    
set_hudmessage(02550, -1.0, -1.0)
    
show_hudmessage(id"C4: %d"g_c4timer)
    
    
    --
g_c4timer;

GmTx is offline
Send a message via Skype™ to GmTx
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-15-2009 , 14:36   Re: [REQ] C4 Timer
Reply With Quote #6

@GmTx
Your plugin can't work if you don't include csx.


Try this :
PHP Code:
#include <amxmodx>

#define VERSION "0.0.1"

#define TASKID 134567894

new mp_c4timer
new g_iC4Timer

public plugin_init()
{
    
register_plugin("c4 timer"VERSION"ConnorMcLeod")

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
register_logevent("LogEvent_PlantedTheBomb"3"2=Planted_The_Bomb")
    
register_logevent("Logevent_Round_End"2"1=Round_End")

    
mp_c4timer get_cvar_pointer("mp_c4timer")
}

public 
Event_HLTV_New_Round()
{
    
remove_task(TASKID)
    
g_iC4Timer get_pcvar_nummp_c4timer )
}

public 
LogEvent_PlantedTheBomb()
{
    
set_task(1.0"BombCountDown"TASKID, .flags="b")
}

public 
BombCountDown()
{
    if( --
g_iC4Timer )
    {
        
set_hudmessage(50150500.100.3501.01.00.00.0, -1)
        
show_hudmessage(0"C4: %isec"g_iC4Timer)
    }
}

public 
Logevent_Round_End()
{
    
remove_task(TASKID)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
bblair
Member
Join Date: Aug 2009
Location: Belgium
Old 09-15-2009 , 14:38   Re: [REQ] C4 Timer
Reply With Quote #7

Thanks all
bblair is offline
Send a message via MSN to bblair
GmTx
BANNED
Join Date: May 2009
Location: Mountains [BG/Sofia]
Old 09-15-2009 , 14:42   Re: [REQ] C4 Timer
Reply With Quote #8

Yeah i forgot it sorry.But your its better
GmTx is offline
Send a message via Skype™ to GmTx
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-15-2009 , 14:43   Re: [REQ] C4 Timer
Reply With Quote #9

This should make what you want.
I edited Connor's code for the sprite timer cause I was lazy :]

PHP Code:
/*    Copyright © 2009, ConnorMcLeod

    C4 Sprites Timer 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.

    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 C4 Sprites Timer; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "C4 Timer"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.1.0"

const OFFSET_C4_EXPLODE_TIME    100

new g_iC4
new HamHook:g_HhGrenadeThink

new g_iTime = -1

new Float:g_flExplodeTime

public plugin_init()
{    
    
register_plugin(PLUGINVERSIONAUTHOR)

    if( 
find_ent_by_class(FM_NULLENT"func_bomb_target") || find_ent_by_class(FM_NULLENT"info_bomb_target") )
    {
        
g_HhGrenadeThink RegisterHam(Ham_Think"grenade""C4_Think"1)

        
register_event("HLTV""StopHook""a""1=0""2=0")
        
register_logevent("StopHook"2"1=Round_End")

        
register_logevent("StartHook"3"2=Planted_The_Bomb")

        
StopHook()
    }
}

public 
StopHook()
{
    
g_iC4 0
    g_iTime 
= -1
    DisableHamForward
g_HhGrenadeThink )
}

public 
StartHook()
{
    new 
iC4 FM_NULLENT
    
new const grenade[] = "grenade"
    
new const env_sprite[] = "env_sprite"
    
while( (iC4 find_ent_by_class(iC4grenade)) )
    {
        if( 
get_pdata_int(iC4965) & (1<<8) )
        {
            
g_iC4 iC4
            g_flExplodeTime 
get_pdata_float(g_iC4OFFSET_C4_EXPLODE_TIME5)
            
EnableHamForwardg_HhGrenadeThink )
            return
        }
    }
}

public 
C4_ThinkiC4 )
{
    if( 
g_iC4 != iC4 )
    {
        return
    }

    static 
Float:flTimeiTime

    flTime 
g_flExplodeTime get_gametime()
    
iTime floatround(flTimefloatround_ceil)

    if( 
g_iTime != iTime )
    {
        
g_iTime iTime;
        
set_hudmessage025500.10.200.01.50.00.0);
        
show_hudmessage0"C4: %i"iTime );
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 04:44.


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