AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Player Models V0.7 By SHA[D]OW (https://forums.alliedmods.net/showthread.php?t=313694)

hamzashadow 01-18-2019 23:25

Player Models V0.7 By SHA[D]OW
 
1 Attachment(s)
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 ] );



fysiks 01-19-2019 02:47

Re: Player Models V0.7 By SHA[D]OW
 
Are you requesting something? Also, there is already a Player Models plugin that does this and more.


All times are GMT -4. The time now is 02:42.

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