L 01/10/2013 - 20:26:53: Invalid CVAR pointer
L 01/10/2013 - 20:26:53: [AMXX] Displaying debug trace (plugin "countdown.amxx")
L 01/10/2013 - 20:26:53: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 01/10/2013 - 20:26:53: [AMXX] [0] countdown.sma::plugin_precache (line 22)
SMA:
PHP Code:
#include < amxmodx >
#define VERSION "1.0"
// For exemple, here u have 10 sounds, but u have to add +1, so 10+1 = 11 ^^
#define X_POS 0.2
#define Y_POS -0.55
new Sounds[ ][ ] =
{
"",
"CountDown_Voice/one.wav", "CountDown_Voice/two.wav", "CountDown_Voice/three.wav",
"CountDown_Voice/four.wav", "CountDown_Voice/five.wav", "CountDown_Voice/six.wav",
"CountDown_Voice/seven.wav", "CountDown_Voice/eight.wav", "CountDown_Voice/nine.wav",
"CountDown_Voice/ten.wav"
}
new CountDown, pCvar_ZombiePlague_MaxSounds, MAX_SOUNDS
public plugin_precache( )
{
MAX_SOUNDS = get_pcvar_num( pCvar_ZombiePlague_MaxSounds )+1
new iDelay; iDelay = get_cvar_num( "zp_delay" )
for( new i = 0; i < ( ( iDelay < MAX_SOUNDS ) ? iDelay : MAX_SOUNDS ); i++ )
{
if( i != 0 )
{
precache_sound( Sounds[ i ] )
}
}
}
public plugin_init( )
{
register_plugin( "Zombie Plague CountDown", VERSION, "BboY GruN" )
register_cvar( "ZombiePlague_Countdown", VERSION, FCVAR_SERVER|FCVAR_SPONLY );
pCvar_ZombiePlague_MaxSounds = register_cvar( "Zp_MAX_SOUNDS", "10" )
register_dictionary( "zombiecountdown.txt" )
register_event( "HLTV", "Event_RoundStart", "a", "1=0", "2=0" )
}
public Event_RoundStart( )
{
CountDown = get_cvar_num( "zp_delay" )
if( task_exists( 666_666_666 ) ) remove_task( 666_666_666 )
CountDownAndSounds( )
}
public CountDownAndSounds( )
{
if( CountDown <= MAX_SOUNDS-1 )
{
client_cmd( 0, "%s%s",
( containi( Sounds[ CountDown ], ".wav" ) != -1 ) ? "spk " : "mp3 stop;mp3 play sound/", Sounds[ CountDown ] )
}
set_hudmessage( 255, 255, 255, X_POS, Y_POS, 2, 0.0, 1.0, 0.0, 0.0, -1 )
show_hudmessage( 0, "%L", LANG_PLAYER, "COUNTDOWN", CountDown )
CountDown--
if( CountDown > 0 )
{
set_task( 1.0, "CountDownAndSounds", 666_666_666 )
}
}
In this line error:
PHP Code:
MAX_SOUNDS = get_pcvar_num( pCvar_ZombiePlague_MaxSounds )+1
__________________