Raised This Month: $ Target: $400
 0% 

Countdown


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-11-2010 , 08:28   Countdown
Reply With Quote #1

For some reason this countdown doesnt work. I type /countdown and nothing happens.
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "[ZP] Countdown"
#define VERSION "1.0"
#define AUTHOR "Mr.Apple"

new time_s

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_clcmd("say /countdown""countdown")
}

public 
event_round_start()
{
    
time_s 5
}

public 
countdown()
{       
    
set_hudmessage(02550, -1.00.2821.11.10.010.01)   
    
show_hudmessage(0"---Warning---^n ---Alerta Biologica en: %i---"time_s); 
    --
time_s;
    
    if(
time_s >= 1)
    {
        
set_task(1.0"countdown")
    }

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 03-14-2010 , 04:33   Re: Countdown
Reply With Quote #2

You should use some array actually, becouse the time_s is being stored inside event new round and inside countdown its ALWAYS 0.

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "[ZP] Countdown" 
#define VERSION "1.0" 
#define AUTHOR "Mr.Apple + Lure.d" 

new time_s[33];

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
register_clcmd("say /countdown""countdown");


public 
event_round_start(server

    
time_s[server] = 5;


public 
countdown(server
{        
    
set_hudmessage(02550, -1.00.2821.11.10.010.01)    
    
show_hudmessage(0"---Warning---^nTime left before infection: "time_s[server]);
     
    if(
time_s[server] >= 1
    { 
        
set_task(1.0"countdown"server
    } 

I know that its saved to players id, just called it server though xD

Should work now.
Lure.d is offline
Send a message via Skype™ to Lure.d
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-14-2010 , 11:29   Re: Countdown
Reply With Quote #3

You forgot to call the time_s in the message. I added %d and now message appear but it shows time on 0 and dissapear after a second. I have to type /countdown again to see number 1, etc..
__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-14-2010 , 12:55   Re: Countdown
Reply With Quote #4

Why are you classifying 'server' as a player?

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "[ZP] Countdown" 
#define VERSION "1.0" 
#define AUTHOR "Itteh Bitteh Easy Rider Commiteh" 

new time_s;

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
register_clcmd("say /countdown""countdown");


public 
event_round_start() 

    
time_s 5;


public 
countdown() 
{        
    
set_hudmessage(02550, -1.00.2821.11.10.010.01)    
    
show_hudmessage(0"---Warning---^nTime left before infection: "time_s[server]);
    
    
time_s--

    if(
time_s >= 1
    { 
        
set_task(1.0"countdown"
    } 

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-14-2010 , 13:27   Re: Countdown
Reply With Quote #5

Quote:
Originally Posted by benamo6 View Post
For some reason this countdown doesnt work. I type /countdown and nothing happens.
Please, avoid to post here and in Others forum. It's very annoying.

This is a kind of spam.

Decide if you want help in english or spanish.
All of your posts like this are duplicated between forums.

Thanks
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 03-14-2010 , 15:35   Re: Countdown
Reply With Quote #6

Time left Infection: %d, blabla );

Also use SyncMessage or a static hud channel.
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-15-2010 , 13:28   Re: Countdown
Reply With Quote #7

"--time_s" to "time_s--"
Thats all as far as I can see.
__________________
I am out of order!
grimvh2 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-15-2010 , 14:03   Re: Countdown
Reply With Quote #8

Quote:
Originally Posted by grimvh2 View Post
"--time_s" to "time_s--"
Thats all as far as I can see.
LoL, on a single line it's exactly the same.

I would suggest to not use the same callback for the task and the cmd.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-15-2010 at 14:05.
ConnorMcLeod is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 03-15-2010 , 14:21   Re: Countdown
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
LoL, on a single line it's exactly the same.
Didn't knew that :p Never even tried.
__________________
I am out of order!
grimvh2 is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 03-15-2010 , 23:50   Re: Countdown
Reply With Quote #10

it failed to compile
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave 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 08:47.


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