AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hats only for admin level h (https://forums.alliedmods.net/showthread.php?t=172934)

LightScribe16 11-27-2011 17:02

hats only for admin level h
 
Hello all, i need make this plugin to work that hats should be only those who have t flag (ADMIN_LEVEL_H)

here is source
PHP Code:

#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 

new g_Enable;
new 
g_bwEnt[33];
new 
g_CachedStringInfoTarget;

public 
plugin_init() {
    
register_plugin"Santa Hat""1.2""xPaw" );
    
register_cvar("santa_hat""1.2"FCVAR_SERVER);
    
g_Enable register_cvar("amx_santahat""1");

    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
g_CachedStringInfoTarget engfuncEngFunc_AllocString"info_target" );
}

public 
plugin_precache()
    
precache_model("models/santa_hat.mdl");

public 
fwHamPlayerSpawnPost( const player ) {
    if ( 
get_pcvar_numg_Enable ) && is_user_aliveplayer ) ) {
        new 
iEnt g_bwEntplayer ];
        if( !
pev_validiEnt ) ) {
            
g_bwEntplayer ] = iEnt engfunc EngFunc_CreateNamedEntityg_CachedStringInfoTarget );
            
set_peviEntpev_movetypeMOVETYPE_FOLLOW );
            
set_peviEntpev_aimentplayer );
            
engfuncEngFunc_SetModeliEnt"models/santa_hat.mdl" );
        }
    }



fysiks 11-28-2011 03:44

Re: hats only for admin level h
 
Add this to the if condition in the spawn function:

PHP Code:

&& get_user_flags(player) & ADMIN_LEVEL_H 



All times are GMT -4. The time now is 08:30.

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