Raised This Month: $64 Target: $400
 16% 

[ZP] Extra Addon: Countdown NEW !


Post New Thread Reply   
 
Thread Tools Display Modes
Gh05t04
Senior Member
Join Date: Jul 2015
Old 07-29-2015 , 07:37   Re: [ZP] Extra Addon: Countdown NEW !
Reply With Quote #31

Can someone help me?

https://forums.alliedmods.net/showthread.php?t=266887
Gh05t04 is offline
razb95
Junior Member
Join Date: Dec 2016
Old 05-23-2017 , 15:04   Re: [ZP] Extra Addon: Countdown NEW !
Reply With Quote #32

I know that this post is old post but i have to write this:
You there is better way to do this?! like this...
Code:
#include <amxmodx>
#include <dhudmessage>
#include <zombieplague>

#define PLUGIN "[ZP] Addon: CD"
#define VERSION "1.0"
#define AUTHOR "@.Hacker-`"

new Timer;

new const TimerSound[ ][ ] ={
	{ "" },
	{ "zombie_plague/1.wav" },
	{ "zombie_plague/2.wav" },
	{ "zombie_plague/3.wav" },
	{ "zombie_plague/4.wav" },
	{ "zombie_plague/5.wav" },
	{ "zombie_plague/6.wav" },
	{ "zombie_plague/7.wav" },
	{ "zombie_plague/8.wav" },
	{ "zombie_plague/9.wav" },
	{ "zombie_plague/10.wav" }
}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0") 
}

public plugin_precache()
{
	for( new i=1; i < sizeof( TimerSound ); i++ )
		precache_sound( TimerSound[ i ] );
}

public event_round_start()
{
	set_task(1.0, "countdown")
}

public countdown()
{
	set_task( 1.0, "CmdTimer", 0,_,_, "b" );
	Timer = 10;
}

public CmdTimer()
{
	if( Timer == 0 || zp_has_round_started() )
	{
		remove_task();
		return 1;
	}
	
	set_hudmessage(0, 85, 255, -1.0, 0.31, 1, 6.0, 1.0)
	show_hudmessage(0, "[**********]^nZombie Infected will start in^n%i second%s^n[**********]", Timer, Timer > 1 ? "s" : "")
	client_cmd(0, "spk ^"%s^"", TimerSound[ Timer ])
	
	Timer--
}
razb95 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 05-23-2017 , 17:49   Re: [ZP] Extra Addon: Countdown NEW !
Reply With Quote #33

You can find the best countdown with support for both zp4 and zp5 here: https://forums.alliedmods.net/showthread.php?t=273814
__________________
Zombie Plague Nightmare Mod + all sub-plugins
Appreciate my help or want to support me release awesome plugins?
PayPal
Donate Steam games or items

georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
shady101
Member
Join Date: Nov 2014
Location: USA
Old 10-13-2018 , 12:09   Re: [ZP] Extra Addon: Countdown NEW !
Reply With Quote #34

Quote:
Originally Posted by razb95 View Post
I know that this post is old post but i have to write this:
You there is better way to do this?! like this...
Code:
#include <amxmodx>
#include <dhudmessage>
#include <zombieplague>

#define PLUGIN "[ZP] Addon: CD"
#define VERSION "1.0"
#define AUTHOR "@.Hacker-`"

new Timer;

new const TimerSound[ ][ ] ={
	{ "" },
	{ "zombie_plague/1.wav" },
	{ "zombie_plague/2.wav" },
	{ "zombie_plague/3.wav" },
	{ "zombie_plague/4.wav" },
	{ "zombie_plague/5.wav" },
	{ "zombie_plague/6.wav" },
	{ "zombie_plague/7.wav" },
	{ "zombie_plague/8.wav" },
	{ "zombie_plague/9.wav" },
	{ "zombie_plague/10.wav" }
}

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0") 
}

public plugin_precache()
{
	for( new i=1; i < sizeof( TimerSound ); i++ )
		precache_sound( TimerSound[ i ] );
}

public event_round_start()
{
	set_task(1.0, "countdown")
}

public countdown()
{
	set_task( 1.0, "CmdTimer", 0,_,_, "b" );
	Timer = 10;
}

public CmdTimer()
{
	if( Timer == 0 || zp_has_round_started() )
	{
		remove_task();
		return 1;
	}
	
	set_hudmessage(0, 85, 255, -1.0, 0.31, 1, 6.0, 1.0)
	show_hudmessage(0, "[**********]^nZombie Infected will start in^n%i second%s^n[**********]", Timer, Timer > 1 ? "s" : "")
	client_cmd(0, "spk ^"%s^"", TimerSound[ Timer ])
	
	Timer--
}
thanks
shady101 is offline
Reply


Thread Tools
Display Modes

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:47.


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