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

Request a plugin Admin Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KING of Gold
Member
Join Date: Dec 2017
Old 01-20-2018 , 13:50   Request a plugin Admin Menu
Reply With Quote #1

Hi
I want a plugin vip menu for cs 1.6, which is in the menu 2, one noclip and one unlimited clip
Example:

AdmiN Menu

1. Noclip [On/Off]
2. Unlimited Clip [On/Off]

9. Close


If you can please find me.
__________________
Cs KING of Gold
AlferD
KING of Gold is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-20-2018 , 17:35   Re: Request a plugin Admin Menu
Reply With Quote #2

https://forums.alliedmods.net/showpo...43&postcount=3
I refer to the concept that you're looking for but, the functions that are executed are another thing. So just edit some code into the post I've done way back. What you have to do is just pick up code from other sources and add it there.
__________________
Relaxing is offline
KING of Gold
Member
Join Date: Dec 2017
Old 01-21-2018 , 10:23   Re: Request a plugin Admin Menu
Reply With Quote #3

I did not succeed
__________________
Cs KING of Gold
AlferD
KING of Gold is offline
KING of Gold
Member
Join Date: Dec 2017
Old 01-22-2018 , 11:26   Re: Request a plugin Admin Menu
Reply With Quote #4

please help
__________________
Cs KING of Gold
AlferD
KING of Gold is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-22-2018 , 11:36   Re: Request a plugin Admin Menu
Reply With Quote #5

show us what you managed to do so far.
__________________
retired chump
DjSoftero is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-22-2018 , 13:27   Re: Request a plugin Admin Menu
Reply With Quote #6

try this:
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <fun> // CS Offsets #if cellbits == 32 const OFFSET_CLIPAMMO = 51 #else const OFFSET_CLIPAMMO = 65 #endif const OFFSET_LINUX_WEAPONS = 4 // Max Clip for weapons new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,             10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 } new g_szUnClipMenu[33] new g_szNoClipMenu[33] public plugin_init() {     register_plugin("aDmin Menu", "1.0", "DeXTeR")             register_concmd("adminmenu", "Show_aDmin_Menu", ADMIN_BAN)         register_message(get_user_msgid("CurWeapon"), "message_cur_weapon") } public Show_aDmin_Menu(id,level,cid) {     if(!cmd_access(id, level, cid, 1))         return PLUGIN_HANDLED;             if(!is_user_alive(id))         return PLUGIN_HANDLED         new szInfo[256], szUnClipMenu[256], szNoClipMenu[256];     formatex(szInfo, charsmax(szInfo), "AdmiN Menu");         new menu = menu_create(szInfo , "aDmin_Menu");         if(g_szUnClipMenu[id]) { formatex(szUnClipMenu, charsmax(szUnClipMenu), "Unlimited Clip \r[\yON\r]"); }     else { formatex(szUnClipMenu, charsmax(szUnClipMenu), "Unlimited Clip \r[\dOFF\r]"); }         if(g_szNoClipMenu[id]) { formatex(szNoClipMenu, charsmax(szNoClipMenu), "Noclip Clip \r[\yON\r]"); }     else { formatex(szNoClipMenu, charsmax(szNoClipMenu), "Noclip Clip \r[\dOFF\r]"); }         new szExit[15];     formatex(szExit, charsmax(szExit), "Close");         menu_setprop(menu, MPROP_EXITNAME, szExit);         menu_display(id , menu , 0); } public aDmin_Menu(id , menu , item) {     if (!is_user_alive(id))         return PLUGIN_HANDLED;             if(item == MENU_EXIT)     {         menu_destroy(menu);         return PLUGIN_HANDLED;     }     new data[6], iName[64];     new access, callback;     menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);     new item_id = str_to_num(data);         switch (item_id)     {         case 0:         {             if(!g_szUnClipMenu[id])             {                 g_szUnClipMenu[id] = 1;                  Show_aDmin_Menu(id);             }             else             {                 g_szUnClipMenu[id] = 0;                  Show_aDmin_Menu(id);             }         }         case 1:         {             if(!g_szNoClipMenu[id])             {                 g_szNoClipMenu[id] = 1;                  set_user_noclip(id, 1)                                 Show_aDmin_Menu(id);             }             else             {                 g_szNoClipMenu[id] = 0;                  set_user_noclip(id, 0)                                 Show_aDmin_Menu(id);             }         }     }     menu_destroy(menu);     return PLUGIN_HANDLED; } public client_putinserver(id) {     g_szUnClipMenu[id] = 0;     g_szNoClipMenu[id] = 0; } public client_disconnected(id) {     g_szUnClipMenu[id] = 0;     g_szNoClipMenu[id] = 0; } // Unlimited clip code public message_cur_weapon(msg_id, msg_dest, msg_entity) {     // Player doesn't have the unlimited clip upgrade     if (!g_szUnClipMenu[msg_entity])         return;         // Player not alive or not an active weapon     if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)         return;         static weapon, clip     weapon = get_msg_arg_int(2) // get weapon ID     clip = get_msg_arg_int(3) // get weapon clip         // Unlimited Clip Ammo     if (MAXCLIP[weapon] > 2) // skip grenades     {         set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]) // HUD should show full clip all the time                 if (clip < 2) // refill when clip is nearly empty         {             // Get the weapon entity             static wname[32], weapon_ent             get_weaponname(weapon, wname, sizeof wname - 1)             weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)                         // Set max clip on weapon             fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])         }     } } // Find entity by its owner (from fakemeta_util) stock fm_find_ent_by_owner(entity, const classname[], owner) {     while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}         return entity; } // Set Weapon Clip Ammo stock fm_set_weapon_ammo(entity, amount) {     set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS); }
__________________

Last edited by D3XT3R; 01-23-2018 at 06:49.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
KING of Gold
Member
Join Date: Dec 2017
Old 01-22-2018 , 15:16   Re: Request a plugin Admin Menu
Reply With Quote #7

PHP Code:
register_clcmd"adminmenu""Show_aDmin_Menu"
I added this code but it does not open me to me Why?
__________________
Cs KING of Gold
AlferD
KING of Gold is offline
Hey
Member
Join Date: Dec 2017
Old 01-22-2018 , 16:02   Re: Request a plugin Admin Menu
Reply With Quote #8

try this:

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

// weapons offsets
#define OFFSET_CLIPAMMO        51
#define OFFSET_LINUX_WEAPONS    4
#define fm_cs_get_weapon_ammo(%1,%2)    set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)

// players offsets
#define m_pActiveItem 373

const NOCLIP_WPN_BS    = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))

new const 
g_MaxClipAmmo[] = 
{
    
0,
    
13//CSW_P228
    
0,
    
10//CSW_SCOUT
    
0,  //CSW_HEGRENADE
    
7,  //CSW_XM1014
    
0,  //CSW_C4
    
30,//CSW_MAC10
    
30//CSW_AUG
    
0,  //CSW_SMOKEGRENADE
    
30,//CSW_ELITE
    
20,//CSW_FIVESEVEN
    
25,//CSW_UMP45
    
30//CSW_SG550
    
35//CSW_GALIL
    
25//CSW_FAMAS
    
12,//CSW_USP
    
20,//CSW_GLOCK18
    
10//CSW_AWP
    
30,//CSW_MP5NAVY
    
100,//CSW_M249
    
8,  //CSW_M3
    
30//CSW_M4A1
    
30,//CSW_TMP
    
20//CSW_G3SG1
    
0,  //CSW_FLASHBANG
    
7,  //CSW_DEAGLE
    
30//CSW_SG552
    
30//CSW_AK47
    
0,  //CSW_KNIFE
    
50//CSW_P90
}

new 
bool:Has_NoClip[32], bool:Has_UnlimitedClip[32];

public 
plugin_init()
{
    
register_plugin("Admin Menu""0.2""iTzMeHey / AlliedMods Codes");
    
    
register_clcmd("Admin_Menu""Menu");
    
register_event("CurWeapon" "Event_CurWeapon" "be" "1=1");
}
public 
client_connect(id)
{
    
Has_NoClip[id] = false;
    
Has_UnlimitedClip[id] = false;
}
public 
client_disconnected(id)
{
    
Has_NoClip[id] = false;
    
Has_UnlimitedClip[id] = false;
}
public 
Event_CurWeapon(id)
{
    new 
iWeapon read_data(2)
    if(
Has_UnlimitedClip[id])
    {
        if(!(
NOCLIP_WPN_BS & (1<<iWeapon)))
        {
            
fm_cs_get_weapon_ammoget_pdata_cbase(idm_pActiveItem) , g_MaxClipAmmoiWeapon ] )
        }
    }
}
public 
Menu(id)
{
    if(!
is_user_connected(id))
        return 
PLUGIN_HANDLED;
        
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        
OpMenu(id);
        
client_print(idprint_chat"[AMXX] Access granted");
    }
    else
    {
        
client_print(idprint_chat"[AMXX] you have no access");
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_HANDLED;
}
public 
OpMenu(id)
{
    new 
Text[34], menu menu_create("\rAdmin Menu""Menu_Handler");
    
formatex(Textcharsmax(Text), "NoClip[%s]"Has_NoClip[id] ? "\yON" "\rOff");
    
menu_additem(menuText""0);
    
formatex(Textcharsmax(Text), "Unlimited Clip[%s]"Has_UnlimitedClip[id] ? "\yON" "\rOff");
    
menu_additem(menuText""0);
    
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}
public 
Menu_Handler(idmenuitem)
{
    switch(
item)
    {
        case 
0:
        {
            
set_user_noclip(id, !Has_NoClip[id] ? true false);
            
Has_NoClip[id] = !Has_NoClip[id] ? true false;
            
client_print(idprint_chat"[AMXX] you just %s NoClip"Has_NoClip[id] ? "Enabled" "Disabled");
            
Menu(id);
            return 
PLUGIN_HANDLED;
        }
        case 
1:
        {
            
Has_UnlimitedClip[id] = !Has_UnlimitedClip[id] ? true false;
            
client_print(idprint_chat"[AMXX] you just %s Unlimited Clip"Has_UnlimitedClip[id] ? "Enabled" "Disabled");
            
Menu(id);
            return 
PLUGIN_HANDLED;
        }
        case 
MENU_EXIT:
        {
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
    }
    
// for saftey from memory leak
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

type Admin_Menu in console to open the menu also i set it to be opened if player has Admin Kick flag.
NOTE: i just wrote it from zero, also didn't test it.
Attached Files
File Type: sma Get Plugin or Get Source (Admin_Menu.sma - 496 views - 3.2 KB)

Last edited by Hey; 01-24-2018 at 18:30. Reason: ughh.. english. New: Code Updated.
Hey is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-23-2018 , 06:45   Re: Request a plugin Admin Menu
Reply With Quote #9

i fixet code try now
__________________

Last edited by D3XT3R; 01-23-2018 at 06:49.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 01-23-2018 , 06:52   Re: Request a plugin Admin Menu
Reply With Quote #10

Quote:
Originally Posted by Hey View Post
NOTE: i just wrote it from zero, also didn't test it.
if you wrote it from zero why you tell us that? also you didnt make it from zero you just stolen lines from https://forums.alliedmods.net/showpo...43&postcount=3 and some from me and some from others so dont try
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
Old 01-23-2018, 07:14
DjSoftero
This message has been deleted by asherkin.
Old 01-23-2018, 11:25
D3XT3R
This message has been deleted by asherkin.
Reply



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:43.


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