Raised This Month: $ Target: $400
 0% 

c4 hud fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SAMURAI16
BANNED
Join Date: Sep 2006
Old 02-16-2007 , 13:41   Re: c4 hud fix
Reply With Quote #1

with this works,
Code:
#include <amxmodx>
#include <amxmisc>
#include <csx>

new g_c4timer;
new mp_timec4;
new bool:b_planted = false;


public plugin_init()
{
    register_plugin("Test","0.1","SAMURAI");
    mp_timec4 = get_cvar_num("mp_c4timer")
    
    register_event("RoundTime", "newRound", "bc")
    register_event("SendAudio", "endRound", "a", "2&%!MRAD_terwin", "2&%!MRAD_ctwin", "2&%!MRAD_rounddraw")
}


public newRound()
{
    g_c4timer = 0
    b_planted = false;
}

public endRound()
{
    g_c4timer = -2
}

public bomb_planted()
{
    b_planted = true;
    g_c4timer = mp_timec4 
    set_task(1.0, "dispTime", 652450, "", 0, "b")
}

public bomb_explode()
{
    if(b_planted)
    remove_task(652450)
    
    return PLUGIN_CONTINUE;
}
    

public dispTime()
{
    
    if(!b_planted)
    remove_task(652450)
    
    
    if(g_c4timer < 8) set_hudmessage(150, 0, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)

    if(g_c4timer > 7) set_hudmessage(150, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)

    if(g_c4timer > 13) set_hudmessage(0, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)
        
    
    show_hudmessage(0, "C4: %d",g_c4timer)
    g_c4timer--
    
}
- I added bomb_explode forward to stop c4 timer because it's appear after 0, -1,-2,-3 etc ;P
- But, it's changed completely the c4 timer cvar ; It's changed it in "45 seconds" . Why ?
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-16-2007 , 14:08   Re: c4 hud fix
Reply With Quote #2

EDIT: I think this will work.
Code:
#include <amxmodx> #include <csx> new g_c4timer; public plugin_init() {     register_plugin("Test", "0.1", "SAMURAI");         register_event("RoundTime", "newRound", "bc")     register_event("SendAudio", "endRound", "a", "1=0") } public bomb_planted() {     g_c4timer = get_cvar_num("mp_c4timer");     set_task(1.0, "dispTime", 652450, "", 0, "a", g_c4timer) } public bomb_explode()     remove_task(652450) public bomb_defused()     remove_task(652450) public dispTime() {     g_c4timer--     show_hudmsg() } show_hudmsg() {     switch ( g_c4timer ) {         case 0..7 : set_hudmessage(150, 0, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)                     case 8..13 : set_hudmessage(150, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)                     default : set_hudmessage(0, 150, 0, -1.0, 0.80, 0, 1.0, 1.0, 0.01, 0.01, -1)     }     show_hudmessage(0, "C4: %d", g_c4timer) }

Last edited by [ --<-@ ] Black Rose; 02-16-2007 at 14:18.
[ --<-@ ] Black Rose 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 00:43.


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