Not my code, i cant remember from where i took it.
It also needs this plugin in order to work:
https://forums.alliedmods.net/showthread.php?p=2140384
PHP Code:
SetGlow(client, r, g, b, a, style)
{
new String:szModel[PLATFORM_MAX_PATH]
GetClientModel(client, szModel, sizeof(szModel))
new skin = CPS_SetSkin(client, szModel, CPS_RENDER)
if(SDKHookEx(skin, SDKHook_SetTransmit, OnSetTransmit_GlowSkin))
{
new offset
if((offset = GetEntSendPropOffs(skin, "m_clrGlow")) != -1)
{
SetEntProp(skin, Prop_Send, "m_bShouldGlow", true, true)
SetEntProp(skin, Prop_Send, "m_nGlowStyle", style)
SetEntPropFloat(skin, Prop_Send, "m_flGlowMaxDist", 10000000.0)
SetEntData(skin, offset, r, _, true)
SetEntData(skin, offset + 1, g, _, true)
SetEntData(skin, offset + 2, b, _, true)
SetEntData(skin, offset + 3, a, _, true)
SetEntityRenderMode(skin, RENDER_GLOW)
SetEntityRenderColor(skin, 255, 255, 255, a)
SetEntityRenderMode(client, RENDER_GLOW)
SetEntityRenderColor(client, 255, 255, 255, a)
}
}
}
public Action:OnSetTransmit_GlowSkin(skin, client)
{
for(new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
if(!CPS_HasSkin(i))
{
continue
}
if(EntRefToEntIndex(CPS_GetSkin(i)) != skin)
{
continue
}
return Plugin_Continue
}
}
return Plugin_Handled
}
PHP Code:
RemoveGlow(client)
{
if(client > 0 && IsClientInGame(client))
{
new skin = CPS_GetSkin(client)
if(skin != INVALID_ENT_REFERENCE)
{
SetEntProp(skin, Prop_Send, "m_bShouldGlow", false, true)
SDKUnhook(skin, SDKHook_SetTransmit, OnSetTransmit_GlowSkin)
}
}
}