Fix too high values for GlowColors rainbow
This commit is contained in:
parent
caa37dc3fc
commit
106e04ae7e
@ -48,8 +48,8 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
RegAdminCmd("sm_rainbow", Command_Rainbow, ADMFLAG_CUSTOM1, "Enable rainbow glowcolors. sm_rainbow [frequency]");
|
RegAdminCmd("sm_rainbow", Command_Rainbow, ADMFLAG_CUSTOM1, "Enable rainbow glowcolors. sm_rainbow [frequency]");
|
||||||
|
|
||||||
HookEvent("player_spawn", Event_ApplyGlowcolor, EventHookMode_Post);
|
HookEvent("player_spawn", Event_ApplyGlowColor, EventHookMode_Post);
|
||||||
HookEvent("player_team", Event_ApplyGlowcolor, EventHookMode_Post);
|
HookEvent("player_team", Event_ApplyGlowColor, EventHookMode_Post);
|
||||||
|
|
||||||
g_Cvar_MinBrightness = CreateConVar("sm_glowcolor_minbrightness", "100", "Lowest brightness value for glowcolor.", 0, true, 0.0, true, 255.0);
|
g_Cvar_MinBrightness = CreateConVar("sm_glowcolor_minbrightness", "100", "Lowest brightness value for glowcolor.", 0, true, 0.0, true, 255.0);
|
||||||
|
|
||||||
@ -267,6 +267,8 @@ public Action Command_Rainbow(int client, int args)
|
|||||||
char sArg[32];
|
char sArg[32];
|
||||||
GetCmdArg(1, sArg, sizeof(sArg));
|
GetCmdArg(1, sArg, sizeof(sArg));
|
||||||
Frequency = StringToFloat(sArg);
|
Frequency = StringToFloat(sArg);
|
||||||
|
if(Frequency > 100.0)
|
||||||
|
Frequency = 100.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Frequency || (args < 1 && g_aRainbowFrequency[client]))
|
if(!Frequency || (args < 1 && g_aRainbowFrequency[client]))
|
||||||
@ -315,13 +317,21 @@ public int MenuHandler_GlowColorsMenu(Menu menu, MenuAction action, int param1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Event_ApplyGlowcolor(Event event, const char[] name, bool dontBroadcast)
|
public void Event_ApplyGlowColor(Event event, const char[] name, bool dontBroadcast)
|
||||||
{
|
{
|
||||||
int client = GetClientOfUserId(GetEventInt(event, "userid"));
|
int client = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
if(!client)
|
if(!client)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RequestFrame(view_as<RequestFrameCallback>(ApplyGlowColor), client);
|
RequestFrame(view_as<RequestFrameCallback>(ApplyGlowColor), client);
|
||||||
|
CreateTimer(5.0, Timer_ApplyGlowColor, GetClientSerial(client), TIMER_FLAG_NO_MAPCHANGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action Timer_ApplyGlowColor(Handle timer, int serial)
|
||||||
|
{
|
||||||
|
int client = GetClientFromSerial(serial);
|
||||||
|
if(client)
|
||||||
|
ApplyGlowColor(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
public int ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#pragma semicolon 1
|
#pragma semicolon 1
|
||||||
|
#pragma newdecls required
|
||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
#include <cstrike>
|
#include <cstrike>
|
||||||
|
|
||||||
#pragma newdecls required
|
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
name = "Spectate",
|
name = "Spectate",
|
||||||
|
Loading…
Reference in New Issue
Block a user