// call task with render
set_task( 1.0, "CTask__UpdateUserGlowColor", pPlayer, .flags = "b" );
public CTask__UpdateUserGlowColor( const pPlayer )
{
if ( !is_user_alive( pPlayer ) )
{
remove_task( pPlayer );
return;
}
static iHueNow, Float: flColor[ 3 ];
HUEtoRGB( iHueNow, flColor );
if ( ( iHueNow += 5 ) && iHueNow >= 360 )
iHueNow = 0;
// render. цвет ставишь от flColor
}
stock HUEtoRGB(hue, Float:rgb[3])
{
rgb[0] = (hue / 255.0) + 1.0 / 3.0;
rgb[1] = (hue / 255.0);
rgb[2] = (hue / 255.0) - 1.0 / 3.0;
for (new i = 0; i < 3; i++)
{
if (rgb[i] < 0.0)
{
rgb[i] += 1.0;
}
if (rgb[i] > 1.0)
{
rgb[i] -= 1.0;
}
if (6.0 * rgb[i] < 1)
{
rgb[i] = rgb[i] * 6.0
continue;
}
if (2.0 * rgb[i] < 1)
{
rgb[i] = 1.0;
continue;
}
if (3.0 * rgb[i] < 2.0)
{
rgb[i] = ((2.0 / 3.0) - rgb[i]) * 6.0
continue;
}
rgb[i] = 0.0;
}
rgb[0] *= 255.0;
rgb[1] *= 255.0;
rgb[2] *= 255.0;
}
if(is_user_alive(id) && szPlayerHook[id])
{
if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & TwoFlag)
{
set_user_rendering(id, kRenderFxGlowShell, random_num(0, 255), random_num(0, 255), random_num(0, 255), kRenderNormal, 0)
set_task( 1.0, "CTask__UpdateUserGlowColor", id, .flags = "b" );
}
else if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & OneFlag)
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 0)
}
}
if(is_user_alive(id) && szPlayerHook[id])
{
if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & TwoFlag)
{
set_user_rendering(id, kRenderFxGlowShell, random_num(0, 255), random_num(0, 255), random_num(0, 255), kRenderNormal, 0)
set_task(1.0, "CTask__UpdateUserGlowColor", id + 1557, .flags = "b");
}
else if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & OneFlag)
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 0)
}
}
public CTask__UpdateUserGlowColor(const id)
{
if(!is_user_alive(id))
{
remove_task(id);
return;
}
static iHueNow, Float: flColor[3];
HUEtoRGB(iHueNow, flColor);
if ((iHueNow += 5) && iHueNow >= 360)
iHueNow = 0;
// render
}
public CTaskid__UpdateUserGlowColor(taskid)
{
new id = taskid - 1557
set_task(1.0, "CTask_UpdateUserGlowColor", id, .flags = "b")
}
set_user_rendering
убирать?set_task(1.0, "CTask__UpdateUserGlowColor", id + 1557, .flags = "b");
...
public CTask__UpdateUserGlowColor(id)
{
id -= 1557;
// выставляешь рендер
}
...
remove_task(id + 1557); // убираем таск в нужный момент
HUEtoRGB(iHueNow, flColor);
if ((iHueNow += 5) && iHueNow >= 360)
iHueNow = 0;
// render
public CTask__UpdateUserGlowColor(const id)
{
if(!is_user_alive(id))
{
remove_task(id);
return;
}
static iHueNow, Float: flColor[3];
HUEtoRGB(iHueNow, flColor);
if ((iHueNow += 5) && iHueNow >= 360)
iHueNow = 0;
// render
if(is_user_alive(id) && szPlayerHook[id])
{
if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & TwoFlag)
{
set_user_rendering(id, kRenderFxGlowShell, random_num(0, 255), random_num(0, 255), random_num(0, 255), kRenderNormal, 0)
set_task(1.0, "CTask__UpdateUserGlowColor", id + 1557, .flags = "b");
}
else if(is_user_alive(id) && szPlayerHook[id] && get_user_flags(id) & OneFlag)
{
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 0)
}
}
}
public DisableHook(id)
{
RemoveHook(id)
if(zp_get_user_nemesis(id)) return PLUGIN_HANDLED
set_user_rendering(id)
remove_task(id + 1557)
return PLUGIN_HANDLED
}