Raised This Month: $12 Target: $400
 3% 

Admin Menu By Natsheh


Post New Thread Reply   
 
Thread Tools Display Modes
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 10-06-2013 , 17:15   Re: Admin Menu :)
Reply With Quote #31

you have a stupid things in Menu -.-

when you upgread edit in thread. i will think about idea soon
Snitch is offline
Send a message via Skype™ to Snitch
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 10-06-2013 , 18:51   Re: Admin Menu :)
Reply With Quote #32

Quote:
Originally Posted by Natsheh View Post
if i remove the drugs ?? what will y do?
Problem isnt drugs at all. Your code is poor and what your menu has, others plugins already have (and better coded)
If you want this plugin to stop being unapproved, optimize the code and change totaly the menu items.
__________________
Jhob94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-07-2013 , 11:56   Re: Admin Menu :)
Reply With Quote #33

Quote:
Originally Posted by Jhob94 View Post
Problem isnt drugs at all. Your code is poor and what your menu has, others plugins already have (and better coded)
If you want this plugin to stop being unapproved, optimize the code and change totaly the menu items.
So.... Should i Change the menu to variable menu???

AND POWER UP THE CODES???

Last edited by Natsheh; 10-07-2013 at 12:08.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-07-2013 , 11:57   Re: Admin Menu :)
Reply With Quote #34

Quote:
Originally Posted by Snitch View Post
you have a stupid things in Menu -.-

when you upgread edit in thread. i will think about idea soon
like whaT?
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 10-07-2013 , 12:55   Re: Admin Menu :)
Reply With Quote #35

Quote:
Originally Posted by Natsheh View Post
So.... Should i Change the menu to variable menu???

AND POWER UP THE CODES???
I think you should optimize the code and make unique stuff. The problem here is that what your plugin has, anothers plugins has it too.
__________________
Jhob94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-07-2013 , 16:56   Re: Admin Menu :)
Reply With Quote #36

Quote:
Originally Posted by jhob94 View Post
i think you should optimize the code and make unique stuff. The problem here is that what your plugin has, anothers plugins has it too.
i will look of amx super and take some ideas
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Siiiiiiiiuu
Old 10-07-2013 , 16:59   Re: Admin Menu :)
Reply With Quote #37

Quote:
Originally Posted by Natsheh View Post
i will look of amx super and take some ideas
lol your ideas need to be unique, not copying items from anothers plugins...
__________________
Jhob94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-08-2013 , 04:37   Re: Admin Menu :)
Reply With Quote #38

Quote:
Originally Posted by Jhob94 View Post
lol your ideas need to be unique, not copying items from anothers plugins...
okay
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 05-01-2019 , 22:45   Re: Admin Menu By Natsheh
Reply With Quote #39

First of all sry for opening old thread but i need this.

@Natsheh i have problem with Ban/Kick Menu , i used to copy and paste the codes for Ban/Kick in new sma file and made a new plugin to add it in amxmodmenu and everything was good.

But it has only 1 problem, the ban option don't Ban the player, the information of steam id , length , nick of player goes in ban_list.cfg but the banned player can join the server with same steam id and nick!!

Codes of single Ban/Kick Menu Plugin :
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <colorchat>

#define PLUGIN "Admin~Menu"
#define VERSION "1.7"
#define AUTHOR "Natsheh"

#define IMMUNITY ADMIN_IMMUNITY

#define ACCESS ADMIN_LEVEL_A

#define MAX_LEN 64

new szBanList[] = "ban_list.cfg"

new const szAdminOption[][] = {
    
"Kick/Ban Menu"


new 
szKB[33]


new const 
szKBText[][] = {
    
"Kick",
    
"Ban"
}


new 
szReasons[33][32]

new 
szLengths[33][11]

new 
KBTiming[33]




public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_bankick""AdminMenu", -1"Open admin menu"ACCESS)
    
    
register_clcmd("Reason""KBReason", -1"Reason to kick/ban"ACCESS)
    
register_clcmd("Length""KBLength", -1"Length to ban"ACCESS)
}

public 
AdminMenu(id)
{
    if(!(
get_user_flags(id) & ACCESS))
    {
        
ColorChat(idNORMAL"^4You ^1Are ^3Not ^4Admin^3!")
        return 
PLUGIN_HANDLED
    
}
    
    new 
AMenu menu_create("Admin Menu^n\yChoose Option""AdminMenuHandle")
    
    new 
szAdminOptionNum[8]
    
    for( new 
0sizeof szAdminOption++ )
    {
        
num_to_str(iszAdminOptionNum7)
        
menu_additem(AMenuszAdminOption[i], szAdminOptionNum0)
    }
    
menu_display(idAMenu)
    return 
PLUGIN_CONTINUE
}
public 
AdminMenuHandle(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[9], name[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata8name63callback)
    
    new 
tempOption str_to_num(data)
    
    switch( 
tempOption )
    {
        case 
0KBMenu(id)
    }
    return 
PLUGIN_HANDLED
}

public 
KBMenu(id)
{
    new 
szText[64]
    
    
formatex(szTextcharsmax(szText), "Kick/Ban Menu")
    new 
KB menu_create(szText"KBMenuHandle")
    
    new 
players[32], numname[32], szTempid[32]
    
    if(
equal(szReasons[id], ""))
        
format(szReasons[id], 31"None")
    if(
equal(szLengths[id], ""))
        
format(szLengths[id], 10"0")
    
    
formatex(szTextcharsmax(szText), "\w%s \rPlayer"szKBText[szKB[id]])
    
menu_additem(KBszText"1"0)
    
    
formatex(szTextcharsmax(szText), "\rReason: \w%s"szReasons[id])
    
menu_additem(KBszText"2"0)
    
    if(
szKB[id] == 0)
        
formatex(szTextcharsmax(szText), "\dLength: %s %s"szLengths[id], equal(szLengths[id], "0") ? "Permanent":"Minute")
    if(
szKB[id] == 1)
        
formatex(szTextcharsmax(szText), "\rLength: \w%s %s"szLengths[id], equal(szLengths[id], "0") ? "Permanent":"Minute")
    
    
menu_additem(KBszText"3"0)
    
    
get_players(playersnum)
    
    for( new 
0numi++ )
    {
        new 
tempid players]
        
        
get_user_name(tempidnamecharsmax(name))
        
num_to_str(tempidszTempid31)
        
        if(
tempid == id || access(tempidIMMUNITY) || is_user_bot(tempid))
            
formatex(szTextcharsmax(szText), "\d%s \r%s"name, (is_user_bot(tempid) ? "Bot":"*"))
        else
            
formatex(szTextcharsmax(szText), "%s"name)
        
menu_additem(KBszTextszTempid0)
    }
    
menu_display(idKB)
    return 
PLUGIN_CONTINUE
}
public 
KBMenuHandle(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[5], name[64]
    new 
Accesscallback
    menu_item_getinfo
(menuitemAccessdata4name63callback)
    
    new 
tempid str_to_num(data)
    
    new 
szAdminName[32], szPlayerName[32], IPa[32], szAuthid[32]
    
get_user_name(idszAdminNamecharsmax(szAdminName))
    
get_user_name(tempidszPlayerNamecharsmax(szPlayerName))
    
get_user_ip(tempidIPacharsmax(IPa), 1)
    
get_user_authid(tempidszAuthidcharsmax(szAuthid))
    
    switch( 
item )
    {
        case 
0:
        {
            if(
szKB[id] == 0)
            {
                
szKB[id] = 1
                KBMenu
(id)
                return 
PLUGIN_HANDLED
            
}
            if(
szKB[id] == 1)
            {
                
szKB[id] = 0
                KBMenu
(id)
                return 
PLUGIN_HANDLED
            
}
        }
        case 
1:
        {
            
client_cmd(id"messagemode Reason")
            return 
PLUGIN_HANDLED
        
}
        case 
2:
        {
            if(
szKB[id] == 0)
            {
                
KBMenu(id)
                return 
PLUGIN_HANDLED
            
}
            if(
szKB[id] == 1)
            {
                
client_cmd(id"messagemode Length")
                return 
PLUGIN_HANDLED
            
}
        }
        default:
        {
            if(
tempid == id || access(tempidIMMUNITY) || is_user_bot(tempid))
            {
                
KBMenu(id)
                return 
PLUGIN_CONTINUE
            
}
            
            new 
KBMotd[2214], title[64], pos 0
            
            
if(szKB[id] == 0)
                
format(titlecharsmax(title), "You Have Been Kicked")
            if(
szKB[id] == 1)
                
format(titlecharsmax(title), "You Have Been Banned")
            
            
pos += format(KBMotd[pos],2213-pos"<html><head><style type=^"text/css^">pre{color:#FF0505;}body{background:#000000;margin-left:16px;margin-top:1px;}</style></head><pre><body>")
            
            if(
szKB[id] == 0)
                
pos += format(KBMotd[pos],2213-pos"<h1><center>You Have Been Kicked</center></h1>")
            if(
szKB[id] == 1)
                
pos += format(KBMotd[pos],2213-pos"<h1><center>You Have Been Banned</center></h1>")
            
            
pos += format(KBMotd[pos],2213-pos"<h2><center>Reason: %s</center></h2>"szReasons[id])
            
            if(
szKB[id] == 1)
                
pos += format(KBMotd[pos],2213-pos"<h2><center>Length: %s %s</center></h2>"szLengths[id], equal(szLengths[id], "0") ? "Permanent":"Minute")
            
            if(
szKB[id] == 0)
                
pos += format(KBMotd[pos],2213-pos"<h3><center>Kicked~By~Admin: %s</center></h3>"szAdminName)
            if(
szKB[id] == 1)
                
pos += format(KBMotd[pos],2213-pos"<h3><center>Banned~By~Admin: %s</center></h3>"szAdminName)
            
            if(
equal(szAuthid"STEAM_ID_LAN"))
                
pos += format(KBMotd[pos],2213-pos"<h1><center>IP: %s</center></h1>"IPa)
            else
                
pos += format(KBMotd[pos],2213-pos"<h1><center>Steam_ID: %s</center></h1>"szAuthid)
            
            
szKB[tempid] = szKB[id]
            
szLengths[tempid] = szLengths[id]
            
KBTiming[tempid] = 5
            
            
if(szKB[id] == 0)
            {
                
ColorChat(0NORMAL"^4Admin ^1%s^3: ^1Has ^3Kicked ^4%s^3|^1Reason: ^4%s^3!"szAdminNameszPlayerNameszReasons[id])
                
log_amx("%s Has Kicked %s Reason %s"szAdminNameszPlayerNameszReasons[id])
            }
            if(
szKB[id] == 1)
            {
                
ColorChat(0NORMAL"^4Admin ^1%s^3: ^1Has ^3Banned ^4%s^3|^1Reason: ^4%s^3|^1Length: ^4%s %s^3!"szAdminNameszPlayerNameszReasons[id], szLengths[id], equal(szLengths[id], "0") ? "Permanent":"Minute")
                
log_amx("%s Has Banned %s Reason %s Length %s %s"szAdminNameszPlayerNameszReasons[id], szLengths[id], equal(szLengths[id], "0") ? "Permanent":"Minute")
            }
            
show_motd(tempidKBMotdtitle)
            
set_task(1.0"KBTime"tempid__"b")
        }
    }
    return 
PLUGIN_HANDLED
}
public 
KBTime(id)
{
    static 
name[32], IPa[32], authid[32], szLogBan[MAX_LEN]
    
get_user_name(idnamecharsmax(name))
    
get_user_ip(idIPacharsmax(IPa), 1)
    
get_user_authid(idauthidcharsmax(authid))
    
    if(
KBTiming[id] > 0)
    {
        
set_hudmessage(42170255, -1.0, -1.006.01.00.50.52)
        
show_hudmessage(id"Leaving in %i Seconds"KBTiming[id])
        
        new 
szWord[32]
        
num_to_word(KBTiming[id], szWord31)
        
client_cmd(id"spk %s"szWord)
        
        
KBTiming[id] --
        return 
PLUGIN_CONTINUE
    
}
    
    
remove_task(id)
    
    if(
szKB[id] == 0)
    {
        
server_cmd("kick ^"%s^""name)
        return 
PLUGIN_HANDLED
    
}
    if(
szKB[id] == 1)
    {
        if (
equal("4294967295"authid)
            || 
equal("HLTV"authid)
            || 
equal("STEAM_ID_LAN"authid)
            || 
equali("VALVE_ID_LAN"authid))
        {
            
format(szLogBanMAX_LEN"^n^"IP^" ^"%s^" ^"%s^" ^"%s^""szLengths[id], IPaname)
            
write_file(szBanListszLogBan, -1)
            
server_cmd("addip %s ^"%s^""szLengths[id], IPa)
            return 
PLUGIN_HANDLED
        
}
        else
        {
            
format(szLogBanMAX_LEN"^n^"ID^" ^"%s^" ^"%s^" ^"%s^""szLengths[id], authidname)
            
write_file(szBanListszLogBan, -1)
            
server_cmd("banid %s ^"%s^""szLengths[id], authid)
            return 
PLUGIN_HANDLED
        
}            
    }
    return 
PLUGIN_HANDLED
}
public 
KBReason(id)
{
    new 
Reason[53]
    
read_args(Reason52)
    
    
remove_quotes(Reason)
    
    new 
len strlen(Reason)
    
    for( new 
0leni++ )
    {
        if(!
isalpha(Reason[i]) && !isspace(Reason[i]) && Reason[i] != '+')
        {
            
client_print(idprint_center"Only Alphabet")
            
KBMenu(id)
            return
        }
    }
    
    if(
equal(Reason""))
        
format(szReasons[id], 52"None")
    else
        
format(szReasons[id], 52"%s"Reason)
    
    
KBMenu(id)
}
public 
KBLength(id)
{
    new 
Length[11]
    
read_args(Length10)
    
    
remove_quotes(Length)
    
    new 
len strlen(Length)
    
    for( new 
0leni++ )
    {
        if(!
isdigit(Length[i]))
        {
            
client_print(idprint_center"Only Numbers")
            
KBMenu(id)
            return
        }
    }
    
    if(
equal(Length"") || equal(Length"00"1))
        
format(szLengths[id], 10"0")
    else
        
format(szLengths[id], 10"%s"Length)
    
    
KBMenu(id)

I will upload ScreenShots so you can see what i made : https://anonfile.com/xbU5Kdl3n6/Ban_...creenshots_rar

and the sma file also :
Attached Files
File Type: sma Get Plugin or Get Source (KBmenu.sma - 388 views - 8.9 KB)
LearninG is offline
Reply


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


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