Raised This Month: $ Target: $400
 0% 

Simple Menu (Terms of Agreement)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-13-2011 , 17:15   Simple Menu (Terms of Agreement)
Reply With Quote #1

PHP Code:
public client_putinserver(id)
{
    
set_task0.5"show_terms"id )
}

public 
show_terms(id)
{
    new 
menu menu_create("\rTerms of Agreement^n\y-------------^n\
    \w1. Rule One.^n\
    2. Rule Two.^n\
    3. Rule 3.^n\
    4. Rule 4."
"terms_handler")
    
    
menu_additem(menu"I agree""1"0)
    
menu_additem(menu"I disagree \r(You will be kicked!)""2"0)
    
    
menu_display(idmenu0)
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
}

public 
terms_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
show_terms(id)
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdata6iName63callback )
    
    new 
key str_to_numdata );
    
    switch( 
key )
    {
        case 
1:
        {
            
Weapons_Menu(id);
        }
        
        case 
2:
        {
            
client_print(idprint_console"You have been kicked for denying our Terms of Agreement.")
            
client_cmd(id"toggleconsole")
            
client_cmd(id"disconnect")
        }
    }
    
    return 
PLUGIN_HANDLED;

The only issue I seem to be having is with the handler. The menu shows and what not, but none of the options work (exit, agree, disagree)

I've been trying everything I can to fix it, I suppose everything I have isn't enough. Anything you see wrong here?

Note:

5:46 PM ( I ran the menu on player spawn, and it works completely fine. It only has issues with set_task )
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 07-13-2011 at 17:49.
GXLZPGX is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-13-2011 , 17:28   Re: Simple Menu (Terms of Agreement)
Reply With Quote #2

Set the menu property before you display the menu.
__________________
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
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-13-2011 , 17:35   Re: Simple Menu (Terms of Agreement)
Reply With Quote #3

Quote:
Originally Posted by nikhilgupta345 View Post
Set the menu property before you display the menu.
That's not going to change anything at all bud, that's how I've always done it, and it has always worked. I have a server currently running with a menu set up exactly the way I showed in my first post, and the server is completely fine.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-14-2011 , 00:05   Re: Simple Menu (Terms of Agreement)
Reply With Quote #4

Quote:
Originally Posted by GXLZPGX View Post
That's not going to change anything at all bud, that's how I've always done it, and it has always worked.
That's because you are setting the property to it's default . IIRC
__________________
fysiks is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 07-14-2011 , 01:06   Re: Simple Menu (Terms of Agreement)
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
That's because you are setting the property to it's default . IIRC
Because I'm a pro.

The problem was solved anyways, thanks peeps.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 07-14-2011 , 01:20   Re: Simple Menu (Terms of Agreement)
Reply With Quote #6

Quote:
Originally Posted by GXLZPGX View Post
Because I'm a pro.
LOL!

Sorry, was that aloud?
__________________
Hi.
Kreation is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-13-2011 , 17:55   Re: Simple Menu (Terms of Agreement)
Reply With Quote #7

Make the task longer. "putinserver" is too early and the engine thinks that the pressed keys are for the team selection menu.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 01:10.


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