Raised This Month: $ Target: $400
 0% 

Vip Model player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jievylook
Senior Member
Join Date: Sep 2018
Old 05-25-2019 , 01:20   Vip Model player
Reply With Quote #1

Hello everyone
I have this script but for some reason all the CT players get with the vip model and the TT players with the terrorist model

and I also need to know how to create the players vips


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

#define PLUGIN "VIP CT/TR Models"
#define VERSION "1.0"
#define AUTHOR "Unkolix"

new const VIP_CT[] = "vip_ct";
new const 
VIP_CT_MODEL[] = "models/player/vip_ct/vip_ct.mdl";
new const 
VIP_TR[] = "vip_tr";
new const 
VIP_TR_MODEL[] = "models/player/vip_tt/vip_tt.mdl";
new 
player_model[33][32];
new 
bool:g_model[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_SetClientKeyValue"fw_SetClientKeyValue")
    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
}

public 
plugin_precache() {
    
precache_model(VIP_TR_MODEL
    
precache_model(VIP_CT_MODEL)
}

public 
fwHamPlayerSpawnPost(id) {
    if(
cs_get_user_team(id) & CS_TEAM_T)
    {
        
copy(player_model[id], 31VIP_TR)
        
        new 
currentmodel[32];
        
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
            
        if(!
equal(currentmodelplayer_model[id]))
        {
            
fm_set_user_model(idplayer_model[id])
        }
    }
    else if(
cs_get_user_team(id) & CS_TEAM_CT)
    {
        
copy(player_model[id], 31VIP_CT)

        new 
currentmodel[32];
        
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
        
        if(!
equal(currentmodelplayer_model[id]))
        {
            
fm_set_user_model(idplayer_model[id])
        }
    }
}

public 
fw_SetClientKeyValue(idinfobufferkey[], value[])
{   
    if (
g_model[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
    
    
return FMRES_IGNORED
}

public 
fw_ClientUserInfoChanged(idinfobuffer)
{   
    if (!
g_model[id])
        return 
FMRES_IGNORED
    
    
new currentmodel[32]; 
    
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
    
    if(!
equal(currentmodelplayer_model[id]))
        
fm_set_user_model(idplayer_model[id]) 
    
    return 
FMRES_IGNORED
}

stock fm_set_user_model(playermodelname[])
{   
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_model[player] = true
}

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

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

jievylook 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 17:08.


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