AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Glow with Adminflag (https://forums.alliedmods.net/showthread.php?t=117868)

SpokY 02-05-2010 13:28

Glow with Adminflag
 
Hello Guy's

I have found this Plugin

Code:

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    register_plugin("JailBreak Glow Menu", "1.1", "izzle")
    register_clcmd( "say /glow","JBGlowMenu");
    register_clcmd( "say_team /glow","JBGlowMenu");
   
    RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
}

public fw_PlayerSpawn_Post(id)
{
    set_user_rendering(id)   
}

public JBGlowMenu(id)
{
    if (cs_get_user_team(id) != CS_TEAM_CT || !is_user_alive(id))
    { 
        return PLUGIN_HANDLED;
    }
    new menu = menu_create("\rJB Glow Menu:", "sub_menu");
   
    new players[32], pnum, tempid;
    new szName[32], szTempid[10];
   
    get_players(players, pnum, "a");
   
    for( new i; i<pnum; i++ )
    {
        tempid = players[i];
       
        if (cs_get_user_team(tempid) != CS_TEAM_T)
        {
            continue;
        }
       
        get_user_name(tempid, szName, 31);
        num_to_str(tempid, szTempid, 9);
        menu_additem(menu, szName, szTempid, 0);
    }
   
    menu_display(id, menu);
    return PLUGIN_HANDLED;
}

public sub_menu(id, menu, item)
{
    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 tempid = str_to_num(data);
    new szName[32], szName2[32];
    get_user_name(id, szName, 31);
    get_user_name(tempid, szName2, 31);
    set_user_rendering(tempid, kRenderFxGlowShell, 255, 140, 0, kRenderNormal, 20)
    set_hudmessage(0, 255, 0)
    show_hudmessage(0, "[JBGM] %s gab %s^n einen Freeday und er ist nun am Leuchten!", szName, szName2);
   
    menu_destroy(menu);
    return PLUGIN_HANDLED;

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

have i can make it that only users with for example X adminflag on the users.ini can use this plugin?

Thanks a lot

master4life 02-05-2010 14:35

Re: Glow with Adminflag
 
PHP Code:

#include <amxmodx> 
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 

public plugin_init() 

    
register_plugin("JailBreak Glow Menu""1.1""izzle"
    
register_clcmd"say /glow","JBGlowMenu"); 
    
register_clcmd"say_team /glow","JBGlowMenu"); 
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1


public 
fw_PlayerSpawn_Post(id

    
set_user_rendering(id)    


public 
JBGlowMenu(id

    if( !(
get_user_flagsid ) & ADMIN_KICK) ) 
        return 
PLUGIN_CONTINUE;

    new 
menu menu_create("\rJB Glow Menu:""sub_menu"); 
    
    new 
players[32], pnumtempid
    new 
szName[32], szTempid[10]; 
    
    
get_players(playerspnum"a"); 
    
    for( new 
ii<pnumi++ ) 
    { 
        
tempid players[i]; 
        
        if (
cs_get_user_team(tempid) != CS_TEAM_T
        { 
            continue; 
        } 
        
        
get_user_name(tempidszName31); 
        
num_to_str(tempidszTempid9); 
        
menu_additem(menuszNameszTempid0); 
    } 
    
    
menu_display(idmenu); 
    return 
PLUGIN_HANDLED


public 
sub_menu(idmenuitem

    if( 
item == MENU_EXIT 
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    
    new 
data[6], iName[64]; 
    new 
accesscallback
    
menu_item_getinfo(menuitemaccessdata,5iName63callback); 
    
    new 
tempid str_to_num(data); 
    new 
szName[32], szName2[32]; 
    
get_user_name(idszName31); 
    
get_user_name(tempidszName231); 
    
set_user_rendering(tempidkRenderFxGlowShell2551400kRenderNormal20
    
set_hudmessage(02550
    
show_hudmessage(0"[JBGM] %s gab %s^n einen Freeday und er ist nun am Leuchten!"szNameszName2); 
    
    
menu_destroy(menu); 
    return 
PLUGIN_HANDLED



SpokY 02-05-2010 15:17

Re: Glow with Adminflag
 
which line?

Seta00 02-05-2010 15:45

Re: Glow with Adminflag
 
Quote:

Originally Posted by SpokY (Post 1079784)
which line?

Quote:

Originally Posted by master4life (Post 1079548)
PHP Code:

public JBGlowMenu(id

    if( !(
get_user_flagsid ) & ADMIN_KICK 
        return 
PLUGIN_CONTINUE



SpokY 02-05-2010 18:13

Re: Glow with Adminflag
 
the adminflags are abcdef......

can u make it only for l or ö or something?

thanks

fysiks 02-05-2010 18:16

Re: Glow with Adminflag
 
Code:

#define ADMIN_ALL                0        /* everyone */
#define ADMIN_IMMUNITY                (1<<0)        /* flag "a" */
#define ADMIN_RESERVATION        (1<<1)        /* flag "b" */
#define ADMIN_KICK                (1<<2)        /* flag "c" */
#define ADMIN_BAN                (1<<3)        /* flag "d" */
#define ADMIN_SLAY                (1<<4)        /* flag "e" */
#define ADMIN_MAP                (1<<5)        /* flag "f" */
#define ADMIN_CVAR                (1<<6)        /* flag "g" */
#define ADMIN_CFG                (1<<7)        /* flag "h" */
#define ADMIN_CHAT                (1<<8)        /* flag "i" */
#define ADMIN_VOTE                (1<<9)        /* flag "j" */
#define ADMIN_PASSWORD                (1<<10)        /* flag "k" */
#define ADMIN_RCON                (1<<11)        /* flag "l" */
#define ADMIN_LEVEL_A                (1<<12)        /* flag "m" */
#define ADMIN_LEVEL_B                (1<<13)        /* flag "n" */
#define ADMIN_LEVEL_C                (1<<14)        /* flag "o" */
#define ADMIN_LEVEL_D                (1<<15)        /* flag "p" */
#define ADMIN_LEVEL_E                (1<<16)        /* flag "q" */
#define ADMIN_LEVEL_F                (1<<17)        /* flag "r" */
#define ADMIN_LEVEL_G                (1<<18)        /* flag "s" */
#define ADMIN_LEVEL_H                (1<<19)        /* flag "t" */
#define ADMIN_MENU                (1<<20)        /* flag "u" */
#define ADMIN_ADMIN                (1<<24)        /* flag "y" */
#define ADMIN_USER                (1<<25)        /* flag "z" */


Seta00 02-05-2010 18:16

Re: Glow with Adminflag
 
Quote:

Originally Posted by SpokY (Post 1079784)
the adminflags are abcdef......

can u make it only for l or ö or something?

thanks

PHP Code:

public JBGlowMenu(id

    if( ~
get_user_flagsid ) & (ADMIN_RCON ADMIN_LEVEL_C ADMIN_LEVEL_SOMETHING) )
        return 
PLUGIN_CONTINUE


fysiks 02-05-2010 18:17

Re: Glow with Adminflag
 
Quote:

Originally Posted by Seta00 (Post 1079788)
PHP Code:

public JBGlowMenu(id

    if( !(
get_user_flagsid ) & (ADMIN_LEVEL_L ADMIN_LEVEL_O ADMIN_LEVEL_SOMETHING) )
        return 
PLUGIN_CONTINUE


Wow, Seta, that is so wrong.

Seta00 02-05-2010 18:19

Re: Glow with Adminflag
 
Sorry, forgot the order. Edited original post.

SpokY 02-05-2010 18:47

Re: Glow with Adminflag
 
Code:

public JBGlowMenu(id)
{
    if( !(
get_user_flags( id ) & ADMIN_LEVEL_H )
        return
PLUGIN_CONTINUE;



thats correct ?

thanks :)


All times are GMT -4. The time now is 07:27.

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