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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-13-2010 , 16:20   Re: How to get username from one to another public method
Reply With Quote #6

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(iddata);

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
BanMenu1(idszTargetID[])
{
    new 
menu menu_create("\rDo you really want to ban this player?:""ban_handler1");
    
    
menu_additem(menu"\wYes, ban player"szTargetID0);
    
menu_additem(menu"\wNo, return to menu""0"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 
iTargetID str_to_num(data);
    if(
iTargetID)
    {
        
// Ban iTargetID
    
}

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

Also, ban by SteamID, it's much more reliable.
__________________
fysiks 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