public void OnPluginStart()
{
HookEvent("player_spawn", PlayerSpawn);
}
public void OnMapStart()
{
PrecacheModel("models/player/custom_player/vad36Christmas/tm_phoenix.mdl");
PrecacheModel("models/player/custom_player/vad36Christmas/ctm_fbi.mdl");
PrecacheModel("models/weapons/fbi_crhands.mdl");
}
public Action OnChangeEntityModelPre(int iEntity, const char[] sOldModel, char[] sNewModel, int iSize)
{
if(iEntity <= MaxClients)
{
if(StrContains(sNewModel, "models/player/custom_player/legacy/") != -1 && StrContains(sNewModel, "santa") == -1)
{
switch(GetClientTeam(iEntity))
{
case 2:
{
strcopy(sNewModel, iSize, "models/player/custom_player/vad36Christmas/tm_phoenix.mdl");
return Plugin_Changed;
}
case 3:
{
strcopy(sNewModel, iSize, "models/player/custom_player/vad36Christmas/ctm_fbi.mdl");
return Plugin_Changed;
}
}
}
}
return Plugin_Continue;
}
public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int iClient = GetClientOfUserId(GetEventInt(event, "userid"));
if(GetClientTeam(iClient) == 3) SetEntPropString(iClient, Prop_Send, "m_szArmsModel", "models/weapons/fbi_crhands.mdl");
}