Raised This Month: $38 Target: $400
 9% 

Player 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:25   Player Models V0.7 By SHA[D]OW
Reply With Quote #1

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

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

#pragma semicolon 1

#define PLUGIN        "Player Models"
#define VERSION        "0.7"

#define SetUserConnected(%1)             UserIsConnected[%1] = true
#define SetUserNotConnected(%1)         UserIsConnected[%1] = false

#define fm_cs_get_user_team_index(%1)        get_pdata_int(%1, 114)

new const CountersModel[ ] = "[BG] CT";
new const 
TerrorristsModel[ ] = "[BG] TE ";
new const 
Model[ ] = "model"// nu modifica
new bool:UserIsConnected33 ];
new 
UserModelName33 ][ 32 ];

public 
plugin_init( )
{
    
register_plugin(PLUGINVERSION"SHA[D]OW" );

    
register_forwardFM_SetClientKeyValue"SetClientKeyValue" );
    
register_messageget_user_msgid"ClCorpse" ), "Message_ClCorpse" );
}

public 
client_putinserverid )
{
    if( 
is_user_botid ) || is_user_hltvid ) ) return 0;
    
    
SetUserConnectedid );
    
copyUserModelNameid ], sizeof UserModelName[ ] ) -1"" );
    
    return 
0;
    
}

public 
client_disconnectid )
{
    if( 
is_user_botid ) || is_user_hltvid ) ) return 0;
    
    
SetUserNotConnectedid );
    
copyUserModelNameid ], sizeof UserModelName[ ] ) -1"" );
    
    return 
0;
    
}
    
public 
plugin_precache()
{
    new 
modelpath64 ];
    
    
formatexmodelpathsizeof modelpath ) -1,"models/player/%s/%s.mdl",CountersModel,CountersModel );
    
precache_modelmodelpath );
    
    
formatexmodelpathsizeof modelpath ) -1,"models/player/%s/%s.mdl",TerrorristsModel,TerrorristsModel );
    
precache_modelmodelpath );
    
}

public 
SetClientKeyValueid, const szInfoBuffer[ ], const szKey[ ], const szValue[ ] )
{
    
    if( 
equalszKeyModel ) && UserIsConnectedid ] )
    {
        new 
iTeam fm_cs_get_user_team_indexid );
        
        if( 
<= iTeam <= )
        {
            
            if( 
iTeam == )
            {
                
                if( !
equalszValueCountersModel ) )
                {
                    
                    
set_user_infoid"model"CountersModel );
                    
copyUserModelNameid ], sizeof UserModelName[ ] ) -1CountersModel );
                    return 
FMRES_SUPERCEDE;
                    
                }
            }
            
            else if( 
iTeam == )
            {
                
                if( !
equalszValueTerrorristsModel ) )
                {
                    
                    
set_user_infoid"model"TerrorristsModel );
                    
copyUserModelNameid ], sizeof UserModelName[ ] ) -1TerrorristsModel );
                    return 
FMRES_SUPERCEDE;
                    
                }
            }
        }
    }
    return 
FMRES_IGNORED;
}

public 
Message_ClCorpse( )
{
    
    new 
id get_msg_arg_int12 );
    
set_msg_arg_stringUserModelNameid ] );

Attached Files
File Type: sma Get Plugin or Get Source (PlayerModels.sma - 299 views - 2.4 KB)

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

Are you requesting something? Also, there is already a Player Models plugin that 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 18:53.


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