#include <sdkhooks>
#define TTARMS "models/weapons/t_arms.mdl"
#define CTARMS "models/weapons/ct_arms.mdl"
public void OnMapStart()
{
PrecacheModel(TTARMS, true), PrecacheModel(CTARMS, true);
}
public void OnClientPostAdminCheck(int iClient)
{
if(!IsFakeClient(iClient)) SDKHook(iClient, SDKHook_SpawnPost, SpawnPost);
}
public Action SpawnPost(int iClient)
{
CreateTimer(1.0, CheckGloves, iClient, TIMER_FLAG_NO_MAPCHANGE); // Надо
}
public Action CheckGloves(Handle timer, int iClient)
{
if(IsClientInGame(iClient))
{
char Buffer[32];
int iEntity = GetEntPropString(iClient, Prop_Send, "m_szArmsModel", Buffer, sizeof(Buffer));
if(IsValidEntity(iEntity) && !Buffer[0])
{
switch(GetClientTeam(iClient))
{
case 2: SetEntPropString(iClient, Prop_Send, "m_szArmsModel", TTARMS);
case 3: SetEntPropString(iClient, Prop_Send, "m_szArmsModel", CTARMS);
}
}
}
return Plugin_Stop;
}