Raised This Month: $ Target: $400
 0% 

Having a problem with my CD menu.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-24-2012 , 12:27   Having a problem with my CD menu.
Reply With Quote #1

It's not showing the hudmessages

PHP Code:
#define TASKID  1996
new iCountDown 
PHP Code:
case 2set_task(1.0"Cmd_StartCountDown"TASKID__"a"iCountDown
PHP Code:
case 0iCountDown 5
            
case 1iCountDown 10
            
case 2iCountDown 15
            
case 3iCountDown 30 
PHP Code:
if(task_exists(TASKID)) {
        return 
PLUGIN_HANDLED
    
}
    if(
iCountDown <= 0) {
        
set_hudmessage(02550, -1.00.5025.08.00.00.010)
        
show_hudmessage(0"Go Go Go!"
    }
    
    else {
        
set_hudmessage1201201200.500.5000.10.80.10.1, -)
        
show_hudmessage(0"%i"iCountDown--)
    } 
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-24-2012 , 12:45   Re: Having a problem with my CD menu.
Reply With Quote #2

Those snippets make no sense alone. Show your full code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-24-2012 , 13:17   Re: Having a problem with my CD menu.
Reply With Quote #3

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <dhudmessage>

#define PLUGIN "CountDown Menu"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

#define TASKID  1996

new iCountDown

new pPlugin

new iMenuItems[3][33] = {
    
"CountDown Seconds",
    
"Freeze Terrorists",
    
"Start CountDown"
}

new 
iCountDownSeconds[4][33] = {
    
"5",
    
"10",
    
"15",
    
"30"
}

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /cd""Cmd_CountDown")
    
    
pPlugin register_cvar("cd_enable""1")
}

public 
Cmd_CountDown(iPlayer) {
    if(!
get_pcvar_num(pPlugin))
        return 
PLUGIN_HANDLED
        
    
if(cs_get_user_team(iPlayer) == CS_TEAM_CT) {
        new 
menu menu_create("\r[ \y Advanced \r] \yCountDown Menu:""CountDown_handler")
        
        new 
szTemp[200], Key[10]
        for(new 
0sizeof(iMenuItems); i++) {
            
formatex(szTempcharsmax(szTemp), "%s"iMenuItems[i])
            
num_to_str(iKeycharsmax(Key))
            
menu_additem(menuszTempKey)
        }
        
menu_display(iPlayermenu)
    }
    else if(
cs_get_user_team(iPlayer) != CS_TEAM_CT) {
        
ColorChat(iPlayerGREEN"[CountDown]^x01 You need to be a^x03 CT^x01 to do this!")
    }
    return 
PLUGIN_CONTINUE
}

public 
CountDown_handler(iPlayermenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(
is_user_alive(iPlayer)) {
        switch(
item) {
            case 
0Cmd_CountDownSub(iPlayer)
            case 
1Cmd_FreezePlayers(iPlayer)
            case 
2set_task(1.0"Cmd_StartCountDown"TASKID__"a"iCountDown)
        }
    }
    else {
        
ColorChat(iPlayerGREEN"[CountDown]^x01 You need to be alive to do this!")
    }
    return 
PLUGIN_CONTINUE
}

public 
Cmd_CountDownSub(iPlayer) {
    
    new 
menu menu_create("CountDown Seconds""CountDownSeconds_handler")
    new 
szTemp[200], Key[10]
    
    for(new 
0sizeof(iCountDownSeconds); i++) {
        
formatex(szTempcharsmax(szTemp), "%s"iCountDownSeconds[i])
        
num_to_str(iKeycharsmax(Key))
        
menu_additem(menuszTempKey)
    }
    
menu_display(iPlayermenu)
}

public 
CountDownSeconds_handler(iPlayermenuitem) {
    if(
item == MENU_EXIT) {
        
menu_destroy(menu)
        
Cmd_CountDown(iPlayer)
        return 
PLUGIN_HANDLED
    
}
    
    if(
is_user_alive(iPlayer)) {
        switch(
item) {
            case 
0iCountDown 5
            
case 1iCountDown 10
            
case 2iCountDown 15
            
case 3iCountDown 30
        
}
    }
    
    
Cmd_CountDown(iPlayer)
    
    return 
PLUGIN_CONTINUE
}
// Not done "Cmd_FreezePlayers"
public Cmd_FreezePlayers(iPlayer) {
    
}

public 
Cmd_StartCountDown(iPlayer) {
    if(
task_exists(TASKID)) {
        return 
PLUGIN_HANDLED
    
}
    if(
iCountDown <= 0) {
        
set_hudmessage(02550, -1.00.5025.08.00.00.010)
        
show_hudmessage(0"Go Go Go!"
    }
    
    else {
        
set_hudmessage1201201200.500.5000.10.80.10.1, -)
        
show_hudmessage(0"%i"iCountDown--)
    }
    return 
PLUGIN_CONTINUE
        

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 04-24-2012 , 13:44   Re: Having a problem with my CD menu.
Reply With Quote #4

Channel -1?
Btw,
PHP Code:
#include <dhudmessage> 
You aint even using dhudmessage so why did u include that ?:O
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 04-24-2012 at 13:56.
Bilal Pro is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-24-2012 , 14:08   Re: Having a problem with my CD menu.
Reply With Quote #5

I think the problem is here:

if(task_exists(TASKID)) {
return PLUGIN_HANDLED
}

Because you are checking if the task exist in it's own function and stop it.
__________________

Last edited by <VeCo>; 04-24-2012 at 14:18.
<VeCo> is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-24-2012 , 14:30   Re: Having a problem with my CD menu.
Reply With Quote #6

Quote:
Originally Posted by <VeCo> View Post
I think the problem is here:

if(task_exists(TASKID)) {
return PLUGIN_HANDLED
}

Because you are checking if the task exist in it's own function and stop it.
Yep. That's why.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-24-2012 , 15:43   Re: Having a problem with my CD menu.
Reply With Quote #7

Will try it and edit my post if it works.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 07:54.


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