Raised This Month: $ Target: $400
 0% 

Need Help with Disarm Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sh0n3
Junior Member
Join Date: Mar 2012
Old 06-29-2012 , 23:49   Need Help with Disarm Plugin
Reply With Quote #1

Hey guys, i have disarm menu plugin on my server but the problem is that admin can disarm other admins Can anyone help me with the code so admins with immunity can't be choosed in the menu? Thanks in advance

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

public plugin_init()
{
    
register_plugin("Disarm Menu""v2""InsaNe")
    
register_clcmd("say /disarm""Disarm")
    
register_clcmd("say_team /disarm""Disarm")
}
public 
Disarm(id)
{
    new 
menu menu_create("\rDisarm Menu:""menu_handler");
    
    new 
players[32], pnumtempid;
    
    new 
szName[32], szTempid[10];
    
    
get_players(playerspnum);
    
    for( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        
get_user_name(tempidszNamecharsmax(szName));
        
num_to_str(tempidszTempidcharsmax(szTempid));
        
        
menu_additem(menuszNameszTempid0);
        
    }
    
    if(
get_user_flags(id) & ADMIN_BAN)
        
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED_MAIN
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    
    new 
tempid str_to_num(data);
    
    if(
is_user_alive(tempid))
        
{
    
strip_user_weapons(tempid)
    
give_item(tempid,"weapon_knife")
    
    
set_hudmessage(25500, -1.00.8622.07.0)
    
show_hudmessage(tempid"Admin te je disarm-ovao!")
}
    return 
PLUGIN_HANDLED;


Last edited by Sh0n3; 06-29-2012 at 23:49.
Sh0n3 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 15:20.


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