Raised This Month: $ Target: $400
 0% 

Countdown function in menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 05-24-2010 , 04:14   Countdown function in menu
Reply With Quote #1

Is possible to add countdown to menu ?
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-24-2010 , 04:16   Re: Countdown function in menu
Reply With Quote #2

yes
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 05-24-2010 , 04:28   Re: Countdown function in menu
Reply With Quote #3

Can you show me some easy way
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-24-2010 , 05:04   Re: Countdown function in menu
Reply With Quote #4

Using new menus can be a waste of time if you don't use arrays for menu items and also the text must be formated before... but using old menus, just store all menu in a string and where you want counter put a "%d" and show a specific integer(which can be increased / decreased in a task).
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-24-2010 , 17:41   Re: Countdown function in menu
Reply With Quote #5

Quote:
Originally Posted by Alka View Post
Using new menus can be a waste of time if you don't use arrays for menu items and also the text must be formated before
If you create the menu (global) and then edit (menu_item_setname) and reshow the menu it might not be that bad.
__________________
fysiks is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-24-2010 , 05:55   Re: Countdown function in menu
Reply With Quote #6

I just want to know,what do u really want,a countdown and open a menu or a countdown in one of the cases of the menu?

Last edited by #8 SickneSS; 05-24-2010 at 06:56.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 05-24-2010 , 07:51   Re: Countdown function in menu
Reply With Quote #7

Quote:
Originally Posted by #8 SickneSS View Post
I just want to know,what do u really want,a countdown and open a menu or a countdown in one of the cases of the menu?
he want to have a countdown showed as menu like the countdown in galileo.


Search for galileo & see the code how you can add a countdown in this.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-24-2010 , 10:54   Re: Countdown function in menu
Reply With Quote #8

Oh!.. I See,I think is easy to do.
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
xakintosh
I run no-steam servers!
Join Date: Feb 2010
Location: Edge of nowhere
Old 05-24-2010 , 12:27   Re: Countdown function in menu
Reply With Quote #9

You can see where i want to put it.
PHP Code:
public x(id) {
    new 
x1[8]
    if(
id(id,x1)) {
        new 
menu menu_create("""menu_handler")
        
menu_additem(menu"1""1")
        
menu_additem(menu"2""2")
        
menu_additem(menu"3""3")
        
menu_additem(menu"4""4")
        
menu_additem(menu"5""5")
        
menu_additem(menu"6""6")
        
menu_additem(menu"(%d)sec.""7")
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
menu_display(idmenu0)
        } else {
        
ColorChat(id,GREEN,"This server is made by X?k!n7osh")
    }


Last edited by xakintosh; 05-24-2010 at 12:34.
xakintosh is offline
Send a message via Yahoo to xakintosh Send a message via Skype™ to xakintosh
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-24-2010 , 16:39   Re: Countdown function in menu
Reply With Quote #10

You must create a temporary string, maybe static, then format it like you wish...
PHP Code:
static szTemp[16];
formatex(szTempcharsmax(szTemp), "(%d)sec."iSeconds); //iSeconds it's your integer that hold seconds num.

menu_additem(menuszTemp"7");
... 
__________________
Still...lovin' . Connor noob! Hello
Alka 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 05:19.


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