View Single Post
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-30-2016 , 22:28   Re: [CS:GO] Hide new arms?
Reply With Quote #18

Quote:
Originally Posted by TheWho View Post
Setting a custom player model and changing m_szArmsModel on player_spawn EventHookMode_Post will still overlap with default arms.
Not: I'm stripping players weapons before changing m_szArmsModel.

m_szArmsModel will soon be deprecated, valve isn't using this at all.
I was talking about changing the player model, not m_szArmsModel. You don't need to touch m_szArmsModel.

Here is an example plugin you can use on maps that don't use Swat for the CT players. Note how we change the player's model to a non-custom player model. If we changed it to a custom player model (a model not shipped with CSGO) then the arms would appear since custom models use the Leet arms no matter what. Follow the rules I outlined in my original post and you should be good.

PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools_functions>

#pragma semicolon 1

new const String:PLAYER_MODEL[] = "models/player/custom_player/legacy/ctm_swat_variantd.mdl";

public 
OnMapStart()
{
    
PrecacheModel(PLAYER_MODEL);
}

public 
OnClientPutInServer(iClient)
{
    
SDKHook(iClientSDKHook_SpawnPostOnSpawnPost);
}

public 
OnSpawnPost(iClient)
{
    if(
IsClientObserver(iClient) || !IsPlayerAlive(iClient))
        return;
    
    
SetEntityModel(iClientPLAYER_MODEL);

hlstriker is offline