Quote:
Originally Posted by Mitchell
Found this snippet in one of my old repos:
Code:
public void OnPostThinkPost(int client) {
if(isMonster(client)) {
SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
}
}
I'd say if setting the render color of the weapon works, use that. That way you're not setting this prop on a Think callback.
|
PHP Code:
public Action:m_invisible(client, arg)
{
...................................
alpha(client, 0);
SetEntityRenderMode(client, RENDER_NONE);
SetEntityRenderColor(client, 0,0,0,0);
SDKHook(client, SDKHook_PostThinkPost, OnPostThinkPost);
CreateTimer(5.0, m_visible, client);
return Plugin_Continue;
}
alpha(client, alpha)
{
winvis(client,alpha);
}
winvis(client, alpha)
{
if(IsPlayerAlive(client))
{
new weapons = FindSendPropOffs("CBasePlayer", "m_hMyWeapons");
for(new i = 0, weapon; i < 47; i += 4)
{
weapon = GetEntDataEnt2(client, weapons + i);
if(weapon > -1 )
{
SetEntityRenderMode(weapon, RENDER_TRANSCOLOR);
SetEntityRenderColor(weapon, 255, 255, 255, alpha);
}
}
}
}
public Action m_visible(Handle timer, any:client)
{
alpha(client, 255);
SetEntityRenderMode(client, RENDER_TRANSCOLOR);
SetEntityRenderColor(client, 255,255,255,255);
SDKUnhook(client, SDKHook_PostThinkPost, OnPostThinkPost);
}
public OnPostThinkPost(client) SetEntProp(client, Prop_Send, "m_iAddonBits", 0);
?