Raised This Month: $29 Target: $400
 7% 

Admin Models V0.7 By SHA[D]OW


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hamzashadow
Junior Member
Join Date: Jul 2018
Old 01-18-2019 , 23:09   Admin Models V0.7 By SHA[D]OW
Reply With Quote #1

Name: admin Models
Plugin Author: SHA[D]OW
Plugin Version: 0.7
Modification: Counter - Strike
Category: Fun Stuff

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

#define STRING_ACCESS "u"

#if cellbits == 32
    #define OFFSET_TEAM 114
#else
    #define OFFSET_TEAM 139
#endif

new bool:hasAdmin[33] = { false, ... }

new 
g_model[] = "model"
new g_new_admin_te[] = "[BG]admin_te"
new g_new_admin_ct[] = "[BG]Admin_ct"

public plugin_precache()
{
    new 
temp[64]
    
format(tempsizeof temp -1"models/player/%s/%s.mdl"g_new_admin_teg_new_admin_te)
    
    if(!
precache_model(temp))
        
log_amx("Can't precache model '%s'"temp)
    
    
format(tempsizeof temp -1"models/player/%s/%s.mdl"g_new_admin_ctg_new_admin_ct)
    
    if(!
precache_model(temp))
        
log_amx("Can't precache model '%s'"temp)
}

public 
plugin_init()
{
    
register_plugin("New Admin Models""1.1""avtor xzn ne ja")
    
    
register_cvar(STRING_ACCESS"c")//Админов с какими флагами нужно переодевать (добавлен квар)
    
    
register_forward(FM_PlayerPostThink"fwd_PlayerPostThink")
    
register_forward(FM_ClientUserInfoChanged"fwd_ClientUserInfoChanged")
}

public 
client_putinserver(id)
    
set_task(2.0"cmdCheckUser"id)

public 
client_disconnect(id)
    
hasAdmin[id] = false

public cmdCheckUser(id)
{
    if(
is_user_connected(id))
    {
        static 
flags[28], iflag
        get_cvar_string
(STRING_ACCESSflagssizeof flags -1)
        
iflag read_flags(flags)
        
        if(
get_user_flags(id) & iflag)
        {
            
hasAdmin[id] = true
        
}
    }
}

public 
fwd_PlayerPostThink(id)
{
    if(!
hasAdmin[id] || !is_user_alive(id))
        return 
FMRES_IGNORED
    
    
switch(get_pdata_int(idOFFSET_TEAM))
    {
        case 
1engfunc(EngFunc_SetClientKeyValueidengfunc(EngFunc_GetInfoKeyBufferid), g_modelg_new_admin_te)
        case 
2engfunc(EngFunc_SetClientKeyValueidengfunc(EngFunc_GetInfoKeyBufferid), g_modelg_new_admin_ct)
    }
    
    return 
FMRES_HANDLED
}

public 
fwd_ClientUserInfoChanged(id)
    return 
FMRES_SUPERCEDE 
Attached Files
File Type: sma Get Plugin or Get Source (Admin_Models.sma - 267 views - 2.2 KB)

Last edited by hamzashadow; 01-18-2019 at 23:32.
hamzashadow is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-19-2019 , 02:48   Re: Admin Models V0.7 By SHA[D]OW
Reply With Quote #2

Are you requesting something? Also, there is a Player Models plugin that already does this and more.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 17:59.


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