Raised This Month: $ Target: $400
 0% 

take user input from a menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 08-06-2010 , 09:42   take user input from a menu
Reply With Quote #1

hi

i'm new to this scripting

after going through the tuts by red and PvtSmithFSSF .. i want to add a front end to some plugin(user registration ). here is my menu i was able to get it display in game

Code:
.::WELCOME::.
1.pass protect ur nick(new comers ) 
2.login
but now comes the hard part for me

1.how to execute/run the plugin after user connects automatically(like that of join/left plugin)?

2.suppose user chose 1 or 2 option how to read the input frm user(password) and store it temporarily


PHP Code:
#include <amxmodx>
#define PLUGIN    "GUIFORReg"
#define AUTHOR    "am_amx"
#define VERSION    "1.0"

// I WANT THE PLUGIN TO BE EXECUTED WHEN USER CONNECTS
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
register_clcmd("say /reg","PMenu");
}
public 
PMenu(id)
{
    new 
menu menu_create("\r.:: WELCOME ::. ""menu_handler");
    
menu_additem(menu"\yREGISTER(NEW USER )""1"0);
    
menu_additem(menu"\yLOGIN""2"0);
    
menu_additem(menu"\yGET U R ASS KIKCED ""3"0);
 
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
           
//NEED SOME MAGIC CODE HERE
          //GRRR
         // LIKE SHOULD ASK USER TO ENTER PASSWORD  AND STORE IN 
         //SAY 'PASS'(VARIABLE)
        
[URL="http://forums.alliedmods.net/showthread.php?t=59596"]amx_register[/URL1 PASS //COMPLETED THE REGISTRATION 
        
}
        case 
2:
        {
            
//NEED SOME MAGIC CODE HERE
            //ENTER THE PASSWORD AND STORE IT IN VARIABLE 'PASSWOR'
       
[URL="http://forums.alliedmods.net/showthread.php?t=59596"]amx_login[/URLPASSWOR  //   TO login with ALREADY REGISTRED password.
        
}
        case 
3:
        {
           
//NEED SOME MAGIC CODE HERE
        
}
        
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


Last edited by am_amx; 08-06-2010 at 12:02. Reason: ADDED CODE
am_amx is offline
 


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 00:11.


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