Page 1 of 1

vip glow

Posted: 10 Oct 2018, 05:49
by shady101852
I copied the code for the leader glow into the vip system plugin and modified the names of the cvars etc. The glow works when im alone in the server but after another player joins my glow is removed after a round restart. Does anyone know what I need to do to keep the glow? below is the code minus the cvars.
  1. public glow()
  2. {
  3.     for(new id = 1; id <= g_iMaxPlayers; id++)
  4.     {
  5.         if (!is_user_alive(id))
  6.             continue
  7.            
  8.         if (get_pcvar_num(g_pCvarVipGlow) != 0)
  9.         {
  10.             // Set Glow For VIP Players
  11.             for (new i = 1; i <= g_iMaxPlayers; i++)
  12.             {
  13.                 if (!is_user_alive(i))
  14.                     continue
  15.                 if (ze_get_vip_flags(id) & VIP_A) // if user is vip
  16.  
  17.                 {
  18.                     if (get_pcvar_num(g_pCvarVipGlowRandom) == 0)
  19.                     {
  20.                         Set_Rendering(i, kRenderFxGlowShell, get_pcvar_num(g_pCvarVipGlowColors[Red]), get_pcvar_num(g_pCvarVipGlowColors[Green]), get_pcvar_num(g_pCvarVipGlowColors[Blue]), kRenderNormal, 40)
  21.                     }
  22.                     else
  23.                     {
  24.                         Set_Rendering(i, kRenderFxGlowShell, random(256), random(256), random(256), kRenderNormal, 40)
  25.                     }  
  26.                 }
  27.                 else
  28.                 {
  29.                     Set_Rendering(i)
  30.                 }
  31.             }
  32.         }
  33.     }  
  34. }

Re: vip glow

Posted: 10 Oct 2018, 08:14
by Mohamed Alaa

Code: Select all

public glow()
{
	if (get_pcvar_num(g_pCvarVipGlow) != 0)
	{
		for (new id = 1; id <= g_iMaxPlayers; id++)
		{
			if (!is_user_alive(id))
				continue
			   
			if (ze_get_vip_flags(id) & VIP_A) // if user is vip
			{
				if (get_pcvar_num(g_pCvarVipGlowRandom) == 0)
				{
					Set_Rendering(i, kRenderFxGlowShell, get_pcvar_num(g_pCvarVipGlowColors[Red]), get_pcvar_num(g_pCvarVipGlowColors[Green]), get_pcvar_num(g_pCvarVipGlowColors[Blue]), kRenderNormal, 40)
				}
				else
				{
					Set_Rendering(i, kRenderFxGlowShell, random(256), random(256), random(256), kRenderNormal, 40)
				}  
			}
			else
			{
				Set_Rendering(i)
			}
		}
	}
}

Re: vip glow

Posted: 10 Oct 2018, 15:22
by shady101852
I will try it when I get home thanks

Re: vip glow

Posted: 11 Oct 2018, 00:08
by shady101852
thanks it worked