Raised This Month: $ Target: $400
 0% 

Plugin Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 11-15-2011 , 12:41   Plugin Help
Reply With Quote #1

hello i have a zombie mod server and on that is a countdown remix from here on allied the coders name i forgot but the problem with plugin is when it counts it counts from 10 zp delay on my server is 10 but it counts 10 and on hudmessage its a 9, 9 is 8 etc and on last 1 it again says 10 here is the code whats wrong with sry for bad englisch

PHP Code:
/*********************************************
==============================================
* Infection Countdown For Zombie Plague 4.3+ *
==============================================
Description:
Remake version of zp_server_addon_countdown
by Mr. Apple, borrowed some code from
bcdhud_timer by SAMURAI

Modules:
- csx (for Countdown HUD Message)

Changelog:
1.0 Initial release

 Credits:
 - AMXModx Team (AMXModX 1.8.1)
 - Mercylezz (Zombie Plague 4.3)
 - SAMURAI (bcdhud_timer)
 - Mr. Apple (zp_server_addon_countdown)
********************************************/

#include <amxmodx>
#include <csx>
#include <amxmisc>
#include <zombieplague>

#define PLUGIN "[ZP] Infection Countdown"
#define VERSION "1.0"
#define AUTHOR "Dels"

new countdown_timer;
new 
g_msgsync;
const 
TASK_ID 1603;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);    
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
    
//needed for smooth countdown display
    
g_msgsync CreateHudSyncObj();
}
 
public 
plugin_precache()
{
    
precache_sound("fvox/ten.wav");
    
precache_sound("fvox/nine.wav");
    
precache_sound("fvox/eight.wav");
    
precache_sound("fvox/seven.wav");
    
precache_sound("fvox/six.wav");
    
precache_sound("fvox/five.wav");
    
precache_sound("fvox/four.wav");
    
precache_sound("fvox/three.wav");
    
precache_sound("fvox/two.wav");
    
precache_sound("fvox/one.wav");
}

public 
event_round_start()
{
    
//bugfix
    
remove_task(TASK_ID);
    
    
countdown_timer get_cvar_num("zp_delay") - 0;
    
set_task(4.0"countdown"TASK_ID);
}

public 
countdown()
{    
    new 
speak[10][] = { 
    
"fvox/one.wav"
    
"fvox/two.wav"
    
"fvox/three.wav"
    
"fvox/four.wav"
    
"fvox/five.wav"
    
"fvox/six.wav"
    
"fvox/seven.wav"
    
"fvox/eight.wav"
    
"fvox/nine.wav"
    
"fvox/ten.wav" 
    
}

    if (
countdown_timer 1)
    {         
        
emit_sound(0CHAN_VOICEspeak[countdown_timer-1], 1.0ATTN_NORM0PITCH_NORM);
        
set_hudmessage(17900, -1.00.2820.021.00.010.110);    
        
//show_hudmessage(0, "Infection on %i", countdown_timer-1); //old way to display message, little flicker
        
ShowSyncHudMsg(0g_msgsync"Infection on %i"countdown_timer-1); //the new way
    
}
    --
countdown_timer;
        
    if(
countdown_timer >= 1)
    {
        
set_task(1.0"countdown"TASK_ID);
    }
    else
    {
        
emit_sound(0CHAN_VOICEspeak[9], 1.0ATTN_NORM0PITCH_NORM);
        
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 }
*/
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
asdfdsdf is offline
 



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 08:26.


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