Hi, i tried to do glow only for TE, and everything work fine, but if i respawn i see this
PHP Code:
#define EF_BONEMERGE (1 << 0)
#define EF_NOSHADOW (1 << 4)
#define EF_NORECEIVESHADOW (1 << 6)
#define EF_PARENT_ANIMATES (1 << 9)
#define CPS_RENDER (1 << 0)
#define CPS_NOATTACHMENT (1 << 1)
#define CPS_IGNOREDEATH (1 << 2)
void SetGlowing(int clientIndex)
{
char model[PLATFORM_MAX_PATH];
GetClientModel(clientIndex, model, sizeof(model));
int skin = CreatePlayerModelProp(clientIndex, model);
SetEntProp(skin, Prop_Send, "m_bShouldGlow", true, true);
SetEntProp(skin, Prop_Send, "m_nGlowStyle", 0);
SetEntPropFloat(skin, Prop_Send, "m_flGlowMaxDist", 10000000.0);
// So now setup given glow colors for the skin
SetEntData(skin, GetEntSendPropOffs(skin, "m_clrGlow"), 192, _, true); // Red
SetEntData(skin, GetEntSendPropOffs(skin, "m_clrGlow") + 1, 160, _, true); // Green
SetEntData(skin, GetEntSendPropOffs(skin, "m_clrGlow") + 2, 96, _, true); // Blue
SetEntData(skin, GetEntSendPropOffs(skin, "m_clrGlow") + 3, 64, _, true); // Alpha
}
int CreatePlayerModelProp(int client, char[] sModel)
{
RemoveSkin(client);
int Ent = CreateEntityByName("prop_dynamic_override");
DispatchKeyValue(Ent, "model", sModel);
DispatchKeyValue(Ent, "disablereceiveshadows", "1");
DispatchKeyValue(Ent, "disableshadows", "1");
DispatchKeyValue(Ent, "solid", "0");
DispatchKeyValue(Ent, "spawnflags", "256");
SetEntProp(Ent, Prop_Send, "m_CollisionGroup", 11);
DispatchSpawn(Ent);
SetEntProp(Ent, Prop_Send, "m_fEffects", EF_BONEMERGE|EF_NOSHADOW|EF_NORECEIVESHADOW|EF_PARENT_ANIMATES);
SetVariantString("!activator");
AcceptEntityInput(Ent, "SetParent", client, Ent, 0);
SetVariantString("primary");
AcceptEntityInput(Ent, "SetParentAttachment", Ent, Ent, 0);
gPlayerModels[client] = EntIndexToEntRef(Ent);
SDKHook(Ent, SDKHook_SetTransmit, OnShouldDisplay);
return Ent;
}
void RemoveSkin(int client)
{
if(IsValidEntity(gPlayerModels[client]))
{
AcceptEntityInput(gPlayerModels[client], "Kill");
}
SetEntityRenderMode(client, RENDER_NORMAL);
gPlayerModels[client] = INVALID_ENT_REFERENCE;
}
public Action OnShouldDisplay(int Ent, int Client)
{
return (GetClientTeam(Client) == CS_TEAM_CT) ? Plugin_Handled : Plugin_Continue;
}