Thread: [CSGO] ArmsFix
View Single Post
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 12-02-2019 , 16:58   Re: [CSGO] ArmsFix
Reply With Quote #32

you can try this together with the extension:

PHP Code:
#pragma semicolon 1
 
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define PLUGIN_VERSION "1.0"

// Default models / arms - community maps
#define ARMS_T            "models/weapons/t_arms_phoenix.mdl"
#define ARMS_CT            "models/weapons/ct_arms_sas.mdl"



public OnPluginStart()
{
    
CreateConVar("sm_def_arms"PLUGIN_VERSION" SM DEF ARMS Version"FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
    
HookEvent("player_spawn"Event_PlayerSpawn);    
}

public 
void OnMapStart()
{
    
PrecacheModelARMS_T);
    
PrecacheModelARMS_CT);
}

public 
Event_PlayerSpawn(Handle event,const char[] name,bool dontBroadcast)
{
    
int client;
    
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
IsValidClient(client))
    {
        
CreateTimer(0.1,defarmsclient);
        
PrintToChat(client"Setting Armsmodel !!!");
    }
}    

public 
Action defarms(Handle timer ,any client)
{
    
int team GetClientTeam(client);
    
    if (
team == 2)
    {
    
// Set the Armsmodel
        
SetEntPropString(clientProp_Send"m_szArmsModel"ARMS_T);
    }
    else if (
team == 3)
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel"ARMS_CT);
    }
}    

stock bool IsValidClient(int client)
{
    if (
client <= 0) return false;
    if (
client MaxClients) return false;
    if (!
IsClientConnected(client)) return false;
    return 
IsClientInGame(client);

__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 12-02-2019 at 17:12.
andi67 is offline