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

Close instantly Choose your appereance menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Apb hq
Senior Member
Join Date: Apr 2014
Old 08-02-2018 , 09:47   Close instantly Choose your appereance menu
Reply With Quote #1

Hi everyone i need help with this choose your apperance menu i want to detect when it's opened and i want to close it as soon as possible by selecting random player skin

I have found this code on the forum but it doesn't work i have tried client_cmd engclient_cmd etc nothing works has anyone an idea how to fix this thanks in advance

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

new const VERSION[] = "0.0.1" 

const EXTRAOFFSET_PLAYER    
const m_iMenuCode        205 
const SKIN_SELECT_MENU    

public plugin_init() 

    
register_plugin("Skin Menu"VERSION"ConnorMcLeod"

    
register_menucmd(register_menuid("Terrorist_Select"1), 31"ChooseSkinMenu"// 26, 27 
    
register_menucmd(register_menuid("CT_Select"1), 31"ChooseSkinMenu"

    
register_clcmd("joinclass""ClientCommand_JoinClass"
    
register_clcmd("menuselect""ClientCommand_MenuSelect"


public 
ChooseSkinMenu(idiKey

client_cmd(id,"slot5")
engclient_cmd(id"joinclass""5"



public 
ClientCommand_MenuSelectid 

    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU 
    { 
client_cmd(id,"slot5")
engclient_cmd(id"joinclass""5"

    } 


public 
ClientCommand_JoinClassid 

    if( 
get_pdata_int(idm_iMenuCodeEXTRAOFFSET_PLAYER) == SKIN_SELECT_MENU 
    { 
    
client_cmd(id,"slot5")
    
engclient_cmd(id"joinclass""5"

    } 


Last edited by Apb hq; 08-02-2018 at 09:47.
Apb hq is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 08-04-2018 , 17:47   Re: Close instantly Choose your appereance menu
Reply With Quote #2

I'm not so sure that the code you've got does what you think - joinclass is called when the player chooses a class, not when the menu appears. This should help:

PHP Code:
#include <amxmodx>

#define TERRORIST_SELECT    26
#define CT_SELECT        27

public plugin_init()
{
    
register_plugin"new plugin""0.0.1""hornet" );

    
register_messageget_user_msgid"ShowMenu" ), "Message_ShowMenu" );
    
register_messageget_user_msgid"VGUIMenu" ), "Message_VGUIMenu" );    
}

public 
client_disconnectid )
{
    
remove_taskid );
}

public 
Message_ShowMenuiMsgiDestid )
{
    new 
szMsg18 ];
    
get_msg_arg_string4szMsgcharsmaxszMsg ) );
    
    if( 
equalszMsg"#CT_Select" ) || equalszMsg"#Terrorist_Select" ) )
    {
        
set_task0.1"Task_JoinClass"id );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Message_VGUIMenuiMsgiDestid )
{  
    new 
iMenu get_msg_arg_int);
    
    if( 
iMenu == TERRORIST_SELECT || iMenu == CT_SELECT )
    {
        
set_task0.1"Task_JoinClass"id );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
Task_JoinClassid )
{
    
engclient_cmdid"joinclass""5" );

__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 08-04-2018 at 17:48.
hornet is offline
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 02:40.


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