Raised This Month: $ Target: $400
 0% 

Suggestion / Subplugin Request [REQ/HELP] VIP Model on ADMIN_LEVEL_H


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GraviAnt
Senior Member
Join Date: Oct 2010
Old 10-31-2014 , 14:15   [REQ/HELP] VIP Model on ADMIN_LEVEL_H
Reply With Quote #1

Can somebody make this plugin compatible with ZM mod?

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

#define ACCESS_FLAG ADMIN_LEVEL_H
#define TASK_DELAY 0.5
#define TASK_MODEL 100
#define MODEL_PLAYER "vip"

new const VERSION[] = "1.0"

new pcvar_on

new g_has_custom_model[33],g_player_model[33][32],Float:g_models_counter

public plugin_init()
{
    
register_plugin("Inny model"VERSION"FakeNick")
    
pcvar_on register_cvar("model_on","1")
    if(
get_pcvar_num(pcvar_on))
    {
        
register_logevent("event_round_end"2"1=Round_End")
        
        
RegisterHam(Ham_Spawn,"player","func_spawn",1)
        
        
register_forward(FM_SetClientKeyValue"fw_key_value")
        
register_forward(FM_ClientUserInfoChanged"fw_user_info_changed")
    }
}
public 
plugin_precache()
{
    new 
path[100]
    
formatex(path,sizeof path 1,"models/player/playcs/%s.mdl",MODEL_PLAYER)
    
engfunc(EngFunc_PrecacheModel,path)
}
public 
func_spawn(id)
{
    if(
is_user_alive(id))
    {
        if(
get_user_flags(id) & ACCESS_FLAG)
        {
            
copy(g_player_model[id], sizeof g_player_model[] - 1MODEL_PLAYER)
        
            new 
currentmodel[32]
            
fm_get_user_model(idcurrentmodelsizeof currentmodel 1)
        
            if (!
equal(currentmodelg_player_model[id]))
            {
                
set_task(1.0 g_models_counter"task_set_model"id+TASK_MODEL)
            
                
g_models_counter += TASK_DELAY
            
}
        }else if (
g_has_custom_model[id])
        {
            
fm_reset_user_model(id)
        }
    }
}
public 
event_round_end()
{
    
g_models_counter 0.0
}
public 
fw_key_value(id, const infobuffer[], const key[])
{   
    if (
g_has_custom_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
        
    
return FMRES_IGNORED
}
public 
fw_ClientUserInfoChanged(id)
{
    if (!
g_has_custom_model[id])
        return 
FMRES_IGNORED

    
static currentmodel[32]
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1)
    
    if (!
equal(currentmodelg_player_model[id]))
        
fm_set_user_model(idg_player_model[id])
    
    return 
FMRES_IGNORED
}
public 
task_set_model(id)
{
    
id -= TASK_MODEL
    
    fm_set_user_model
(idg_player_model[id])
}
stock fm_set_user_model(player, const modelname[])
{
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_has_custom_model[player] = true
}

stock fm_get_user_model(playermodel[], len)
{
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player)
{
    
g_has_custom_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))

GraviAnt is offline
 



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 19:44.


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