Raised This Month: $ Target: $400
 0% 

Show Hud Message Color Countdown


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 06:00   Show Hud Message Color Countdown
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <csx>
#include <amxmisc>
#include <zombieplague>
#define PLUGIN "[ZP] Infection Countdown Remix"
#define VERSION "1.3"
#define AUTHOR "Dels"
new countdown_timercvar_countdown_sound;
new 
g_msgsync;
const 
TASK_ID 1603;
public 
plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR); 
 
register_event("HLTV""event_round_start""a""1=0""2=0");
 
register_dictionary("Evil-Night.txt");
 
g_msgsync CreateHudSyncObj();
 
cvar_countdown_sound register_cvar("Evn_CountDown_Sound""1");
}
 
public 
plugin_precache()
{
    
precache_sound("Evil-Night/Countdown/one.wav");
    
precache_sound("Evil-Night/Countdown/two.wav");
    
precache_sound("Evil-Night/Countdown/three.wav");
    
precache_sound("Evil-Night/Countdown/four.wav");
    
precache_sound("Evil-Night/Countdown/five.wav");
    
precache_sound("Evil-Night/Countdown/six.wav");
    
precache_sound("Evil-Night/Countdown/seven.wav");
    
precache_sound("Evil-Night/Countdown/eight.wav");
    
precache_sound("Evil-Night/Countdown/nine.wav");
    
precache_sound("Evil-Night/Countdown/ten.wav");
    
precache_sound("Evil-Night/Countdown/zero.wav");
}
public 
event_round_start()
{
 
//bugfix
 
remove_task(TASK_ID);
 
 
countdown_timer get_cvar_num("Evn_delay") - 1;
 
set_task(4.0"countdown"TASK_ID);
}
public 
countdown()

  static 
hrgb[3]
  switch (
countdown_timer-1)
  {
   case 
0// 0
   
{
    
hrgb[0] = 192 // r
    
hrgb[1] = // g
    
hrgb[2] = // b
   
}
   case 
1//1
   
{
    
hrgb[0] = 192 // r
    
hrgb[1] = // g
    
hrgb[2] = // b
   
}
   case 
2//2
   
{
    
hrgb[0] = 236 // r
    
hrgb[1] = // g
    
hrgb[2] = // b
   
}
   case 
3//3
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 11 // g
    
hrgb[2] = // b
   
}
   case 
4//4
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 32 // g
    
hrgb[2] = // b
   
}
   case 
5//5
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 55 // g
    
hrgb[2] = // b
   
}
   case 
6//6
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 114 // g
    
hrgb[2] = // b
   
}
   case 
7//7
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 150 // g
    
hrgb[2] = // b
   
}
   case 
8//8
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 207 // g
    
hrgb[2] = // b
   
}
   case 
9//9
   
{
    
hrgb[0] = 255 // r
    
hrgb[1] = 238 // g
    
hrgb[2] = // b
   
}
   case 
10//10
   
{
    
hrgb[0] = 194 // r
    
hrgb[1] = 232 // g
    
hrgb[2] = 47 // b
   
}
   case 
11//11
   
{
    
hrgb[0] = 131 // r
    
hrgb[1] = 198 // g
    
hrgb[2] = 96 // b
   
}
   case 
12//12
   
{
    
hrgb[0] = 70 // r
    
hrgb[1] = 160 // g
    
hrgb[2] = 141 // b
   
}
   case 
13//13
   
{
    
hrgb[0] = 32 // r
    
hrgb[1] = 136 // g
    
hrgb[2] = 168 // b
   
}
   case 
14//14
   
{
    
hrgb[0] = // r
    
hrgb[1] = 118 // g
    
hrgb[2] = 183 // b
   
}
   case 
15//15
   
{
    
hrgb[0] = // r
    
hrgb[1] = 83 // g
    
hrgb[2] = 154 // b
   
}
  }
 }
 new 
speak[16][] = { 
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/one.wav"
 
"Evil-Night/Countdown/two.wav"
 
"Evil-Night/Countdown/three.wav"
 
"Evil-Night/Countdown/four.wav"
 
"Evil-Night/Countdown/five.wav"
 
"Evil-Night/Countdown/six.wav"
 
"Evil-Night/Countdown/seven.wav"
 
"Evil-Night/Countdown/eight.wav"
 
"Evil-Night/Countdown/nine.wav",
 
"Evil-Night/Countdown/ten.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav"
 
}
 if (
countdown_timer 1)
 { 
  
//emit_sound(0, CHAN_VOICE, speak[countdown_timer-1], 1.0, ATTN_NORM, 0, PITCH_NORM);
  
if (cvar_countdown_sound != 0)
   
client_cmd(0"spk %s"speak[countdown_timer-1]);
 
  
set_hudmessage(hrgb[0], hrgb[1], hrgb[2], -1.00.2820.021.00.010.110); 
  if (
countdown_timer != 1)
   
ShowSyncHudMsg(0g_msgsync"%L"LANG_PLAYER"COUNTDOWN"countdown_timer-1);
 }
 --
countdown_timer;
 
 if(
countdown_timer >= 1)
        
set_task(1.0"countdown"TASK_ID);
 else
  
remove_task(TASK_ID);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 
Something is wrong .

I've never done Hud message And countdown color 1-15 Need somehelp ...

Last edited by .Dare Devil.; 03-01-2011 at 06:03.
.Dare Devil. is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 06:24   Re: Show Hud Message Color Countdown
Reply With Quote #2

I changed a little bit
Now I get only 1 error when i compile.

[line 130] argument type mismatch (argument 1)

PHP Code:
public countdown()

 new 
hudred[15][] = { 
 
"192",
 
"236"
 
"255"
 
"255"
 
"255"
 
"255"
 
"255"
 
"255"
 
"255"
 
"194",
 
"131",
 
"70",
 
"32",
 
"6",
 
"5"
 
}
 new 
hudgreen[15][] = { 
 
"0",
 
"0"
 
"11"
 
"32"
 
"55"
 
"114"
 
"150"
 
"207"
 
"238"
 
"232",
 
"198",
 
"160",
 
"136",
 
"118",
 
"83"
 
}
 new 
hudblue[15][] = { 
 
"1",
 
"2"
 
"0"
 
"0"
 
"0"
 
"0"
 
"0"
 
"0"
 
"0"
 
"47",
 
"96",
 
"141",
 
"168",
 
"183",
 
"154"
 
}
 new 
speak[16][] = { 
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/one.wav"
 
"Evil-Night/Countdown/two.wav"
 
"Evil-Night/Countdown/three.wav"
 
"Evil-Night/Countdown/four.wav"
 
"Evil-Night/Countdown/five.wav"
 
"Evil-Night/Countdown/six.wav"
 
"Evil-Night/Countdown/seven.wav"
 
"Evil-Night/Countdown/eight.wav"
 
"Evil-Night/Countdown/nine.wav",
 
"Evil-Night/Countdown/ten.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav",
 
"Evil-Night/Countdown/zero.wav"
 
}
 if (
countdown_timer 1)
 { 
  
//emit_sound(0, CHAN_VOICE, speak[countdown_timer-1], 1.0, ATTN_NORM, 0, PITCH_NORM);
  
if (cvar_countdown_sound != 0)
   
client_cmd(0"spk %s"speak[countdown_timer-1]);
   
  
set_hudmessage(hudred[countdown_timer-1], hudgreen[countdown_timer-1], hudblue[countdown_timer-1], -1.00.2820.021.00.010.110); 
  if (
countdown_timer != 1)
   
ShowSyncHudMsg(0g_msgsync"%L"LANG_PLAYER"COUNTDOWN"countdown_timer-1);
 }
 --
countdown_timer;
  
 if(
countdown_timer >= 1)
        
set_task(1.0"countdown"TASK_ID);
 else
  
remove_task(TASK_ID);

.Dare Devil. is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-01-2011 , 08:50   Re: Show Hud Message Color Countdown
Reply With Quote #3

your sounds array is bullshit, what are you trying to achieve?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 08:56   Re: Show Hud Message Color Countdown
Reply With Quote #4

I want make like that :
Hudmessage countdown 15-13 = blue 13-9 = orange and 9-1 red
Can you help me?
.Dare Devil. is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-01-2011 , 08:58   Re: Show Hud Message Color Countdown
Reply With Quote #5

seriously, i don't understant, you want a countdown timer from 15 with each second with specified color by your arrays?
and sounds, shouldn't be from zero to fifteen?
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 08:58   Re: Show Hud Message Color Countdown
Reply With Quote #6

yes
.Dare Devil. is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-01-2011 , 09:03   Re: Show Hud Message Color Countdown
Reply With Quote #7

try this, not tested

PHP Code:

#include < amxmodx >
#include < amxmisc >

#pragma semicolon 1

#define MAX_SECONDS    16

enum _iRGB
{
    
r,
    
g,
    
b
};

enum ( += 1337 )
{
    
TASK_ONE,
    
TASK_TWO
};

new const 
gHudColorsMAX_SECONDS ][ iRGB ] =
{
    { 
1920},
    { 
2360},
    { 
25511},
    { 
25532},
    { 
25555},
    { 
255114},
    { 
255150},
    { 
255207},
    { 
255238},
    { 
19423247 },    
    { 
13118996 },
    { 
70160141 },
    { 
32136168 },
    { 
6118183 },
    { 
583154 },
    { 
255255255 }
};

new const 
gSoundsSpeakMAX_SECONDS ][ ] =
{
    
"Evil-Night/Countdown/zero.wav",
     
"Evil-Night/Countdown/one.wav"
     
"Evil-Night/Countdown/two.wav"
     
"Evil-Night/Countdown/three.wav"
     
"Evil-Night/Countdown/four.wav"
     
"Evil-Night/Countdown/five.wav"
     
"Evil-Night/Countdown/six.wav"
     
"Evil-Night/Countdown/seven.wav"
     
"Evil-Night/Countdown/eight.wav",      
    
"Evil-Night/Countdown/nine.wav",
     
"Evil-Night/Countdown/ten.wav",
    
"Evil-Night/Countdown/eleven.wav",
    
"Evil-Night/Countdown/twelve.wav",
    
"Evil-Night/Countdown/thirteen.wav",
    
"Evil-Night/Countdown/fourteen.wav",
    
"Evil-Night/Countdown/fifteen.wav"
};

new 
gCountTimer;
new 
gHudSync;

public 
plugin_init( )
{
    
register_plugin"""""" );
    
    
register_logevent"LOGRoundStart"2"1=Round_Start" );
    
    
gHudSync CreateHudSyncObj( );
}

public 
plugin_precache( )
{
    new 
i;
    for( 
0MAX_SECONDSi++ )
    {
        
precache_soundgSoundsSpeak] );
    }
}

public 
LOGRoundStart( )
{
    
remove_taskTASK_ONE );
    
remove_taskTASK_TWO );
    
    
set_taskfloatMAX_SECONDS ), "RemoveTimerHUD"TASK_ONE__"b" );
    
set_task1.0"ShowCountTimer"TASK_TWO__"a"MAX_SECONDS );
}

public 
ShowCountTimer( )
{
    
gCountTimer++;
    
    new 
iTimer MAX_SECONDS gCountTimer;
    
    
set_hudmessagegHudColorsiTimer ][ ], gHudColorsiTimer ][ ], gHudColorsiTimer ][ ], -1.00.2820.021.00.010.1); 
    
ShowSyncHudMsg0gHudSync"CountDown: %d"iTimer );
    
    if( 
iTimer <= MAX_SECONDS )
    {
        new 
szNumToWord60 ];
        
num_to_wordiTimerszNumToWordcharsmaxszNumToWord ) );
        
        
client_cmd0"speak ^"Evil-Night/Countdown/%s^""szNumToWord );
    }
}

public 
RemoveTimerHUD( )
{
    
remove_taskTASK_ONE );
    
remove_taskTASK_TWO );
    
    
gCountTimer 0;

updated
__________________

Last edited by tuty; 03-01-2011 at 09:37.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 09:13   Re: Show Hud Message Color Countdown
Reply With Quote #8

Quote:
Originally Posted by tuty View Post
try this, not tested

PHP Code:
 
 
#include < amxmodx >
#include < amxmisc >
 
#pragma semicolon 1
 
#define MAX_SECONDS    16
 
enum _iRGB
{
    
r,
    
g,
    
b
};
 
enum ( += 1337 )
{
    
TASK_ONE,
    
TASK_TWO
};
 
new const 
gHudColorsMAX_SECONDS ][ iRGB ] =
{
    { 
1920},
    { 
2360},
    { 
25511},
    { 
25532},
    { 
25555},
    { 
255114},
    { 
255150},
    { 
255207},
    { 
255238},
    { 
19423247 },    
    { 
13118996 },
    { 
70160141 },
    { 
32136168 },
    { 
6118183 },
    { 
583154 }
};
 
new const 
gSoundsSpeakMAX_SECONDS ][ ] =
{
    
"Evil-Night/Countdown/zero.wav",
     
"Evil-Night/Countdown/one.wav"
     
"Evil-Night/Countdown/two.wav"
     
"Evil-Night/Countdown/three.wav"
     
"Evil-Night/Countdown/four.wav"
     
"Evil-Night/Countdown/five.wav"
     
"Evil-Night/Countdown/six.wav"
     
"Evil-Night/Countdown/seven.wav"
     
"Evil-Night/Countdown/eight.wav",      
    
"Evil-Night/Countdown/nine.wav",
     
"Evil-Night/Countdown/ten.wav",
    
"Evil-Night/Countdown/eleven.wav",
    
"Evil-Night/Countdown/twelve.wav",
    
"Evil-Night/Countdown/thirteen.wav",
    
"Evil-Night/Countdown/fourteen.wav",
    
"Evil-Night/Countdown/fifteen.wav"
};
 
new 
gCountTimer;
new 
gHudSync;
 
public 
plugin_init( )
{
    
register_plugin"""""" );
 
    
register_logevent"LOGRoundStart"2"1=Round_Start" );
 
    
gHudSync CreateHudSyncObj( );
}
 
public 
plugin_precache( )
{
    new 
i;
    for( 
0MAX_SECONDSi++ )
    {
        
precache_soundgSoundsSpeak] );
    }
}
 
public 
LOGRoundStart( )
{
    
remove_taskTASK_ONE );
    
remove_taskTASK_TWO );
 
    
set_taskfloatMAX_SECONDS ), "RemoveTimerHUD"TASK_ONE__"b" );
    
set_task1.0"ShowCountTimer"TASK_TWO__"a"MAX_SECONDS );
}
 
public 
ShowCountTimer( )
{
    
gCountTimer++;
 
    new 
iTimer decrease_numMAX_SECONDSgCountTimer );
 
    
set_hudmessagegHudColors][ iTimer ], gHudColors][ iTimer ], gHudColors][ iTimer ], -1.00.2820.021.00.010.1); 
    
ShowSyncHudMsg0gHudSync"CountDown: %d"iTimer );
 
    if( 
iTimer <= MAX_SECONDS )
    {
        new 
szNumToWord20 ];
        
num_to_wordiTimerszNumToWordcharsmaxszNumToWord ) );
 
        
client_cmd0"speak ^"Evil-Night/Countdown/%s^""szNumToWord );
    }
}
 
public 
RemoveTimerHUD( )
{
    
remove_taskTASK_ONE );
    
remove_taskTASK_TWO );
 
    
gCountTimer 0;
}
 
stock decrease_numiFirstiSecond )
{
    new 
iResult iFirst iSecond;
 
    return 
iResult;

PHP Code:
L 03/01/2011 16:10:22: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:22: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:22: [AMXX]    [0Evn_Countdown.sma::ShowCountTimer (line 97)
L 03/01/2011 16:10:23: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:23: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:23: [AMXX]    [0Evn_Countdown.sma::ShowCountTimer (line 97)
L 03/01/2011 16:10:24: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:24: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:24: [AMXX]    [0Evn_Countdown.sma::ShowCountTimer (line 97)
L 03/01/2011 16:10:25: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:25: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:25: [AMXX]    [0Evn_Countdown.sma::ShowCountTimer (line 97)
L 03/01/2011 16:10:26: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:26: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:26: [AMXX]    [0Evn_Countdown.sma::ShowCountTimer (line 97)
L 03/01/2011 16:10:27: [AMXXDisplaying debug trace (plugin "Evn_Countdown.amxx")
L 03/01/2011 16:10:27: [AMXXRun time error 4index out of bounds 
L 03
/01/2011 16:10:27: [AMXX]    [0Evn_Countdown.sma::ShowCou 
.Dare Devil. is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 03-01-2011 , 09:21   Re: Show Hud Message Color Countdown
Reply With Quote #9

main post updated, try now o.O
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 03-01-2011 , 09:29   Re: Show Hud Message Color Countdown
Reply With Quote #10

still
Run time error 4: index out of bounds

round start and countdown start, then play only 2 , 1
others 15 , 14 , 13 , 12 , 11 , 10 , 9 , 8 , 7 , 6 , 5 , 4 ,3 ,
write Run time error 4: index out of bounds
.Dare Devil. 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 16:53.


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