Senior Member
Join Date: Dec 2020
Location: Brazil
|
06-15-2021
, 20:22
[L4D2]Plugin command looping
|
#1
|
hi guys, i need help with this scripting, when i say the command !rainbow, the plugin starts giving me random colors but i want it to stay infinitely until my character dies, if anyone can help me i'm very grateful
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <sdktools_functions>
public Plugin myinfo =
{
name = "[L4D2]Random color",
author = "King",
description = "",
version = "2.0.0",
url = "www.sourcemod.net"
};
public OnPluginStart()
{
RegConsoleCmd("sm_rainbow", Rainbow, "rainbow for survivors");
}
public Action Rainbow(client, args)
{
CreateTimer(0.5, Random1, client);
CreateTimer(1.0, Random2, client);
CreateTimer(1.5, Random3, client);
CreateTimer(2.0, Random4, client);
CreateTimer(2.5, Random5, client);
CreateTimer(3.0, Random6, client);
CreateTimer(3.5, Random7, client);
CreateTimer(4.0, Random8, client);
CreateTimer(4.5, Random9, client);
CreateTimer(5.0, Random10, client);
return Plugin_Handled;
}
public Action Random1(Handle Timer, client)
{
SetEntityRenderColor(client, 0, 255, 0, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 0 + (255 * 256) + (0 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random2(Handle Timer, client)
{
SetEntityRenderColor(client, 7, 19, 250, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 7 + (19 * 256) + (250 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random3(Handle Timer, client)
{
SetEntityRenderColor(client, 249, 19, 250, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 249 + (19 * 256) + (250 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
}
public Action Random4(Handle Timer, client)
{
SetEntityRenderColor(client, 66, 250, 250, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 66 + (250 * 256) + (250 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random5(Handle Timer, client)
{
SetEntityRenderColor(client, 255, 0, 0, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 255 + (0 * 256) + (0 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random6(Handle Timer, client)
{
SetEntityRenderColor(client, 50, 50, 50, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 75 + (75 * 256) + (75 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random7(Handle Timer, client)
{
SetEntityRenderColor(client, 255, 255, 0, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 255 + (255 * 256) + (0 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random8(Handle Timer, client)
{
SetEntityRenderColor(client, 128, 255, 0, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 128 + (255 * 256) + (0 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random9(Handle Timer, client)
{
SetEntityRenderColor(client, 128, 0, 0, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 128 + (0 * 256) + (0 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
public Action Random10(Handle Timer, client)
{
SetEntityRenderColor(client, 0, 128, 128, 255);
SetEntProp(client, Prop_Send, "m_glowColorOverride", 0 + (128 * 256) + (128 * 65536));
SetEntProp(client, Prop_Send, "m_iGlowType", 3);
SetEntProp(client, Prop_Send, "m_nGlowRange", 99999);
SetEntProp(client, Prop_Send, "m_nGlowRangeMin", 0);
}
Last edited by King_OXO; 06-16-2021 at 06:39.
|
|