Hello I am trying to make player glow function with glows. Function is not mine but I found it on forums. So question is what is wrong here because it is not working. Thanks for help
PHP Code:
SetGlow(int client, int r, int g, int b, int a, int style)
{
char szModel[PLATFORM_MAX_PATH];
GetClientModel(client, szModel, sizeof(szModel));
int skin = CPS_SetSkin(client, szModel, CPS_RENDER);
if (skin != -1)
{
if (SDKHookEx(skin, SDKHook_SetTransmit, OnSetTransmit_GlowSkin))
{
int offset = GetEntSendPropOffs(skin, "m_clrGlow")
SetEntProp(skin, Prop_Send, "m_bShouldGlow", true, true);
SetEntProp(skin, Prop_Send, "m_nGlowStyle", style);
SetEntPropFloat(skin, Prop_Send, "m_flGlowMaxDist", 100.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(int skin, int client)
{
for (int 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;
}