Raised This Month: $ Target: $400
 0% 

take user input from a menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
am_amx
Senior Member
Join Date: Jul 2010
Location: here
Old 08-07-2010 , 00:09   Re: take user input from a menu
Reply With Quote #7

unable to get it work with this pls help

PHP Code:
#include <amxmodx> 
#define PLUGIN    "GUIFORReg" 
#define AUTHOR    "am_amx" 
#define VERSION    "1.0" 
new szTemp[64]

// I WANT THE PLUGIN TO BE EXECUTED WHEN USER CONNECTS 
public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
  
    
register_clcmd("say /reg","PMenu"); 
     
register_clcmd("PUT_PASS1""Greada1"
    
register_clcmd("PUT_PASS2""Greada2"

public 
client_putinserver(id)
{
set_task(2.0,"client_execmd")
}
public 
client_execmd(id)
{
client_cmd(id,"say /reg")
}
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
        { 
client_print(id,print_center,"enter u r passowrd!")
           
client_cmd(id"messagemode PUT_PASS1")
     
     
// console_cmd ( id,say "hiall")
        

        case 
2
        { 
client_print(id,print_center,"enter u r passowrd to login !")
           
client_cmd(id"messagemode PUT_PASS2")
           
        } 
        case 
3
        { 
         
server_cmd("kick #%i ^"You must to loginPlease retry...^""get_user_userid(id)); 
           
//NEED SOME MAGIC CODE HERE 
        

         
    } 
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED
}  
public 
Greada1(id
{  
    
read_args(szTempcharsmax(szTemp))  
    
client_cmd(id,"say amx_register 1 %s",szTemp)
}  
public 
Greada2(id
{  
    
read_args(szTempcharsmax(szTemp))   
    
client_cmd(id,"say amx_login %s",szTemp)


Last edited by am_amx; 08-07-2010 at 03:31. Reason: changed alot, will execute on connect :P thax to darkgod
am_amx is offline
 



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