From 34e17ed6d23002cdfee2d4f22057060aa14cb166 Mon Sep 17 00:00:00 2001 From: BotoX Date: Wed, 3 May 2017 01:02:36 +0200 Subject: [PATCH] GlowColors: Fix last commit --- GlowColors/scripting/GlowColors.sp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/GlowColors/scripting/GlowColors.sp b/GlowColors/scripting/GlowColors.sp index ecb5c870..5bbb3d5c 100644 --- a/GlowColors/scripting/GlowColors.sp +++ b/GlowColors/scripting/GlowColors.sp @@ -291,8 +291,8 @@ public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams) } else if(StrEqual(sValue[aArgs[0]], "rendermode", false)) { - int renderMode = StringToInt(sValue[aArgs[1]]) & 0xFF; - if(renderMode == 0) + RenderMode renderMode = view_as(StringToInt(sValue[aArgs[1]]) & 0xFF); + if(renderMode == RENDER_NORMAL) { ApplyGlowColor(client); return MRES_Ignored; @@ -427,7 +427,7 @@ public void Event_ApplyGlowColor(Event event, const char[] name, bool dontBroadc if(!client) return; - RequestFrame(view_as(ApplyGlowColor), client); + CreateTimer(0.1, Timer_ApplyGlowcolor, client, TIMER_FLAG_NO_MAPCHANGE); } public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn) @@ -440,6 +440,12 @@ public void ZR_OnClientHumanPost(int client, bool respawn, bool protect) ApplyGlowColor(client); } +Action Timer_ApplyGlowcolor(Handle timer, int client) +{ + ApplyGlowColor(client); + return Plugin_Stop; +} + bool ApplyGlowColor(int client) { if(!IsClientInGame(client))