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

[Solved ]Menu does not appear


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-09-2015 , 17:32   [Solved ]Menu does not appear
Reply With Quote #1

read the title & see this script

Code:
#include <amxmodx> #define ADMIN_KICK_RANK "Basic Moderator" #define ADMIN_BAN_RANK "Co Moderator" /* #define Plug true */ /* #define GetPlayerBits(%1,%2)    ( %1 &     1 << ( %2 & 31 ) ) */ /* #define storefalse(%1) bIsbAdmin[%1] = true ; bIsbAdmin[%1] = true */ const KEYSMENU = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) /* enum _:CVAR_DATA {     LOGIN,     REGISTER,     YELLOW } new const g_cvarXtrem[ CVAR_DATA ][ ] ={     "xtrem_login",     "xtrem_pw_limit",     "xtrem_wrong_punish" }; new const g_cvarValues[ CVAR_DATA ] = {     1,     1,     3 } */ new Registerdata[] [] = {     "\yMain Menu Xtrem^n^n" ,     "\r1. \wLogin as a \rXtrem Admin \w[\y%s\w]^n" ,     "\r2 . \wLogin as a \rNormal Admin" } new g_Adminrank[20]     /* bool:i_xtrem */ new bool:bIsbAdmin[33],     bool:bIsmAdmin[33]             /* new g_cvarPointer[ CVAR_DATA ]; */ public plugin_init() {     register_plugin("Xtrem [2% Loading ...]", "", "Freezo")     /*for( new i = 0; i < CVAR_DATA; i++ )         g_cvarPointer[ i ] = register_cvar( g_cvarXtrem[ i ], g_cvarValues[ i ] );  */ } public client_authorized(id){         /* storefalse(id) */         } public client_connect(id) {         /*     new szName[32]     get_user_name(id,szName,charsmax(szName))     */     if(is_user_alive(id)){         if(has_flg(id,ADMIN_ALL)){                             g_Adminrank = ADMIN_KICK_RANK                 bIsbAdmin[id] = true                         }         else if (has_flg(id,ADMIN_RCON))         {                 g_Adminrank = ADMIN_BAN_RANK                 bIsmAdmin[id] = true         }                 Choose_menu(id)     }     } public Choose_menu(id) {     static szMenu[ 1500 ], Len ; Len = 0         Len += formatex( szMenu[ Len ], sizeof szMenu - 1 - Len, Registerdata[0] );         Len += formatex( szMenu[ Len ], sizeof szMenu - 1 - Len, Registerdata[1] , g_Adminrank);         Len += formatex( szMenu[ Len ], sizeof szMenu - 1 - Len, Registerdata[2] );         show_menu( id, KEYSMENU, szMenu, - 1, "handler_show_menu" ); } public handler_show_menu( id, item, page ) {     /* There is no option for exit 'destroy menu ' */        switch( item )     {         case 0:         {                     }     } }     stock has_flg(id, FLAG) {     return (get_user_flags(id) & FLAG) } /*stock MSG_Print( Printmsg[] ) {         server_print( "%s%s" , CONSOLE_MSG , Printmsg )     } */

Last edited by Freezo Begin; 01-09-2015 at 17:36.
Freezo Begin is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-09-2015 , 18:18   Re: Menu does not appear
Reply With Quote #2

Do you really think a player is alive when he is connecting to the server?

PHP Code:
public client_connect(id) {
    
    
/*
    new szName[32]
    get_user_name(id,szName,charsmax(szName))
    */
    
if(is_user_alive(id)){

        if(
has_flg(id,ADMIN_ALL)){
            
                
g_Adminrank ADMIN_KICK_RANK
                bIsbAdmin
[id] = true
                

        
}

        else if (
has_flg(id,ADMIN_RCON))
        {
                
g_Adminrank ADMIN_BAN_RANK
                bIsmAdmin
[id] = true
        
}
        
        
Choose_menu(id)
    }

__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-09-2015 , 18:46   Re: Menu does not appear
Reply With Quote #3

Lol i miss that !
Freezo Begin is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-09-2015 , 20:31   Re: Menu does not appear
Reply With Quote #4

Edit: So, to make it more clear:
PHP Code:
public client_connect(id) {
    
    
/*
    new szName[32]
    get_user_name(id,szName,charsmax(szName))
    */
    
if(is_user_alive(id)){

        if(
has_flg(id,ADMIN_ALL)){
            
                
g_Adminrank ADMIN_KICK_RANK
                bIsbAdmin
[id] = true
                

        
}

        else if (
has_flg(id,ADMIN_RCON))
        {
                
g_Adminrank ADMIN_BAN_RANK
                bIsmAdmin
[id] = true
        
}
        
        
Choose_menu(id)
    }

-->
PHP Code:
public client_putinserver(id
{
    if(
is_user_connected(id))
    {
        if(
has_flg(id,ADMIN_ALL)){
            
            
g_Adminrank ADMIN_KICK_RANK
            bIsbAdmin
[id] = true
        
}
        else if (
has_flg(id,ADMIN_RCON))
        {
            
g_Adminrank ADMIN_BAN_RANK
            bIsmAdmin
[id] = true
        
}
        
        
set_task(3.0"Choose_menu"id)
    }


Last edited by zmd94; 01-10-2015 at 06:46.
zmd94 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-09-2015 , 21:14   Re: Menu does not appear
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
PHP Code:
public client_connect(id
-->
PHP Code:
public client_putinserver(id
Quote:
Originally Posted by wickedd View Post
Do you really think a player is alive when he is connecting to the server?
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-10-2015 , 06:41   Re: Menu does not appear
Reply With Quote #6

Thanks for your reply .

Hey, zmd94 , your way is correct i don't understand why wickedd refuse it .

Back to the object , i don't have a problem with hooking client event i've just miss it .

what i wan't is : why the menu doesn't appear ?

Last edited by Freezo Begin; 01-10-2015 at 06:41.
Freezo Begin is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-10-2015 , 06:47   Re: Menu does not appear
Reply With Quote #7

I recommend you to use new AMXX menu system. Just learn about it. ;)

https://forums.alliedmods.net/showthread.php?t=46364
zmd94 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-10-2015 , 06:50   Re: Menu does not appear
Reply With Quote #8

Lol , i've already read it , but i prefer using a menu with keys ( PS : I've already test it with a simple menu in the first but its not working )
Freezo Begin is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-10-2015 , 06:56   Re: Menu does not appear
Reply With Quote #9

So, actually how this plugin is working?

Last edited by zmd94; 01-10-2015 at 06:56.
zmd94 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 01-10-2015 , 07:07   Re: Menu does not appear
Reply With Quote #10

Back , sorry zmd its working thanks .


EDIT : ( well its unfinished what i've post ) If a admin is connected he check the acces then every acces has a string value that string value will add in the menu

[Solved]

Last edited by Freezo Begin; 01-10-2015 at 07:09.
Freezo Begin 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 04:49.


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