Raised This Month: $51 Target: $400
 12% 

New AMXX Menu System


Post New Thread Reply   
 
Thread Tools Display Modes
iplayz
Junior Member
Join Date: Oct 2011
Old 10-06-2011 , 05:36   Re: New AMXX Menu System
Reply With Quote #341

This is the official EndVote, and what I want is to set a task when the first option received most votes
I thought , simply a set_task(0.0 "test") after this line:

PHP Code:
        client_print(0print_chat"First option recieved most votes (%d)"gVotes[0] ); 
But that gives an error

PHP Code:
public EndVote()
 {
    
//If the first option recieved the most votes
    
if( gVotes[0] > gVotes[1] )
    
        
client_print(0print_chat"First option recieved most votes (%d)"gVotes[0] );

    
//Else if the second option recieved the most votes
    
else if( gVotes[0] < gVotes[1] )
        
client_print(0print_chat"Second option recieved most votes (%d)"gVotes[1] );

    
//Otherwise the vote tied
    
else
        
client_print(0print_chat"The vote tied at %d votes each."gVotes[0] );

    
//Don't forget to destroy the menu now that we are completely done with it
    
menu_destroy(gVoteMenu);

    
//Reset that no players are voting
    
gVoting 0;
 } 
Could you please help me?

Thanks in advance,

iPlayz
iplayz is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-07-2011 , 02:28   Re: New AMXX Menu System
Reply With Quote #342

PHP Code:
public EndVote()
 {
    
//If the first option recieved the most votes
    
if( gVotes[0] > gVotes[1] )
    {
        
client_print(0print_chat"First option recieved most votes (%d)"gVotes[0] );

        
// call your func here (do not use a task for this)
    
}
    
//Else if the second option recieved the most votes
    
else if( gVotes[0] < gVotes[1] )
    {
        
client_print(0print_chat"Second option recieved most votes (%d)"gVotes[1] );
    }
    
//Otherwise the vote tied
    
else
    {
        
client_print(0print_chat"The vote tied at %d votes each."gVotes[0] );
    }

    
//Don't forget to destroy the menu now that we are completely done with it
    
menu_destroy(gVoteMenu);

    
//Reset that no players are voting
    
gVoting 0;
 } 
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
V I R U S
Senior Member
Join Date: Jul 2004
Location: Russia / Germany
Old 10-08-2011 , 08:44   Re: New AMXX Menu System
Reply With Quote #343

How can we grayout(disable) the user who called the menu out?

// Found it...
__________________

Last edited by V I R U S; 10-08-2011 at 08:58.
V I R U S is offline
Send a message via ICQ to V I R U S
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-08-2011 , 12:43   Re: New AMXX Menu System
Reply With Quote #344

Quote:
Originally Posted by V I R U S View Post
How can we grayout(disable) the user who called the menu out?
For others, you use a call back and there is a post in this thread by Exolent that shows how to do it.
__________________
fysiks is offline
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 10-09-2011 , 06:58   Re: New AMXX Menu System
Reply With Quote #345

I've made a public for adding items in the menu and it gives me an argument mismatch type error:
EDIT: Fixed...

Last edited by ROKronoS; 10-09-2011 at 07:09.
ROKronoS is offline
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-12-2011 , 13:55   Re: New AMXX Menu System
Reply With Quote #346

Hey guys, I need to show the timeleft in the title, how I can do it? I tried few methods, but none of them worked.
dark_style is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-12-2011 , 18:01   Re: New AMXX Menu System
Reply With Quote #347

Quote:
Originally Posted by dark_style View Post
Hey guys, I need to show the timeleft in the title, how I can do it? I tried few methods, but none of them worked.
You have to show a new menu with a new title that has the new time in it. Update every second if you want it updated that much. IMO, it's probably too much hassle for such little gain but you can try it if you really want to do so.
__________________

Last edited by Emp`; 10-12-2011 at 23:29. Reason: typo
fysiks is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-12-2011 , 18:18   Re: New AMXX Menu System
Reply With Quote #348

Quote:
Originally Posted by fysiks View Post
You have to have to show a new menu with a new title that has the new time in it. Update every second if you want it updated that much. IMO, it's probably too much hassle for such little gain but you can try it if you really want to do so.
I find it easier to use the old style menu when dealing with dynamic menu options + titles.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
dark_style
Senior Member
Join Date: Jul 2009
Location: Bulgaria
Old 10-13-2011 , 00:13   Re: New AMXX Menu System
Reply With Quote #349

Quote:
Originally Posted by fysiks View Post
You have to show a new menu with a new title that has the new time in it. Update every second if you want it updated that much. IMO, it's probably too much hassle for such little gain but you can try it if you really want to do so.
It won't be such a big problem if it doesn't update the timeleft. What I need is when I open the menu to have the timeleft as it's title and when I re-open it to shows me again the timeleft, but not with the same value as before? The problem is that I am not able to add it to the title.. I tried few methods with formatex, but none of them worked..

Nikhil, maybe you're right, but I'm not familiar with the old menu. And I would prefer the new one if it's possible to do it with it.

What I've tried was:

PHP Code:
static menutimeleft64 ]

formatextimeleftcharsmaxtimeleft ), "Timeleft: %d"get_timeleft() )

menu menu_createtimeleft"menu_handler" 

Last edited by dark_style; 10-13-2011 at 00:31.
dark_style is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-13-2011 , 00:35   Re: New AMXX Menu System
Reply With Quote #350

Should work (you may convert seconds to something more friendly though).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 04:09.


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