Raised This Month: $ Target: $400
 0% 

Help with skin menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-28-2022 , 15:17   Re: Help with skin menu
Reply With Quote #2

PHP Code:
enum _:ModelInfo
{
    
szModelName[64],
    
CsTeams:szTeam,
    
iGender,
    
szModelPath[64]
}

enum {
    
Male 1,
    
Female 2


new const 
g_eModels[][ModelInfo] =
{
    { 
"Special_CT",  CS_TEAM_CTMale"models/player/Special_CT/Special_CT.mdl" },
    { 
"Special_CT2"CS_TEAM_CTFemale"models/player/Special_CT2/Special_CT2.mdl" },
    { 
"Special_T",   CS_TEAM_TFemale"models/player/Special_T/Special_T.mdl" },
    { 
"Special_T2",  CS_TEAM_TMale"models/player/Special_T2/Special_T2.mdl" }
}

new 
g_iUserGender[MAX_PLAYERS 1];

public 
plugin_precache()
{
    for(new 
isizeof(g_eModels); i++)
    {
        if(
file_exists(g_eModels[i][szModelPath]))
        {
            
precache_model(g_eModels[i][szModelPath]);
        } else 
log_amx("Error! Model ^"%s^" does not exists!"g_eModels[i][szModelPath]);
    }
}

public 
client_putinserver(id)
{
    
g_iUserGender[id] == Male//

and this is how you set model:
PHP Code:
public set_model(id)
{
    for(new 
ii<sizeof(g_eModels); i++)
    {
        if(
g_eModels[id][szTeam] == cs_get_user_team(id) && g_eModels[id][iGender] == g_iUserGender[id])
        {
            
cs_set_user_model(idg_eModels[id][szModelPath]);
            
client_print(idprint_chat"Your %s model has been set"g_eModels[id][szModelName]);
            break;
        }
    }

lexzor 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 21:18.


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