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()
{
PrecacheModel( ARMS_T);
PrecacheModel( ARMS_CT);
}
public Event_PlayerSpawn(Handle event,const char[] name,bool dontBroadcast)
{
int client;
client = GetClientOfUserId(GetEventInt(event, "userid"));
if (IsValidClient(client))
{
CreateTimer(0.1,defarms, client);
PrintToChat(client, "Setting Armsmodel !!!");
}
}
public Action defarms(Handle timer ,any client)
{
int team = GetClientTeam(client);
if (team == 2)
{
// Set the Armsmodel
SetEntPropString(client, Prop_Send, "m_szArmsModel", ARMS_T);
}
else if (team == 3)
{
SetEntPropString(client, Prop_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);
}
__________________