Raised This Month: $ Target: $400
 0% 

How to get username from one to another public method


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
reinert
Veteran Member
Join Date: Feb 2007
Old 05-13-2010 , 09:21   Re: How to get username from one to another public method
Reply With Quote #5

PHP Code:
#include <amxmodx>
 #include <fun>

 
public plugin_init()
 {
    
register_clcmd"inch_banmenu","BanMenu");
 }
 public 
BanMenu(id)
 {
    new 
menu menu_create("\rSelect a player to ban!:""ban_handler");

    new 
players[32], pnumtempid;

    new 
szName[32], szTempid[10];

    
get_players(playerspnum);

    for( new 
ii<pnumi++ )
    {
        
tempid players[i];

        
get_user_name(tempidszName31);
        
num_to_str(tempidszTempid9);

        
menu_additem(menuszNameszTempid0);

    }

    
menu_display(idmenu0);
 }
public 
ban_handler(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    
BanMenu1(id);

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 }
 
  public 
BanMenu1(id)
 {
    new 
menu menu_create("\rDo you really want to ban this player?:""ban_handler1");
    
    
menu_additem(menu"\wYes, ban player""0"0);
    
menu_additem(menu"\wNo, return to menu""1"0);

    
menu_display(idmenu0);
 }

public 
ban_handler1(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 
0:
        {
        new 
tempid str_to_num(data);
            
server_cmd("amx_banip %s 720 Banned for 12 hours"tempid)
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
1:
        {
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 

Not working
reinert 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 03:33.


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