fixed by adding pointdetour include

This commit is contained in:
christian 2021-08-15 13:27:59 +02:00
parent 20e73f0859
commit d65ccb60ee

View File

@ -1,18 +1,20 @@
#include <multicolors> #include <multicolors>
#include <sourcemod> #include <sourcemod>
#include <sdktools> #include <sdktools>
#include <pscd>
#pragma newdecls required
float roundStartedTime = -1.0; float roundStartedTime = -1.0;
int g_iTextChannel; int g_iTextChannel;
bool g_bDisabled; bool g_bDisabled;
ConVar g_cvEnabled; ConVar g_cvEnabled;
public Plugin:myinfo = public Plugin myinfo =
{ {
name = "UNLOZE Console Messages", name = "UNLOZE Console Messages",
description = "Make console messages printed by maps more fancy", description = "Make console messages printed by maps more fancy",
author = "zaCade, decompiled by neon and slightly modified by jenz", author = "zaCade, decompiled by Neon and slightly modified by jenz",
version = "1.1", version = "1.2",
url = "" url = ""
}; };
@ -24,12 +26,12 @@ public void OnPluginStart()
public void OnMapStart() public void OnMapStart()
{ {
new bool:bChannelTaken[6]; bool bChannelTaken[6];
new bool:bChannelFound; bool bChannelFound;
new entity = -1; int entity = -1;
while ((entity = FindEntityByClassname(entity, "game_text")) != -1) while ((entity = FindEntityByClassname(entity, "game_text")) != -1)
{ {
new channel = GetEntProp(entity, PropType:1, "m_textParms.channel", 4, 0); int channel = GetEntProp(entity, Prop_Data, "m_textParms.channel", 4, 0);
LogMessage("Checking channel: %d", channel); LogMessage("Checking channel: %d", channel);
if (channel < 6) if (channel < 6)
{ {
@ -40,7 +42,7 @@ public void OnMapStart()
} }
} }
} }
new channel; int channel;
while (channel < 6) while (channel < 6)
{ {
if (!bChannelTaken[channel]) if (!bChannelTaken[channel])
@ -65,7 +67,7 @@ public void OnMapStart()
return; return;
} }
public float GetRoundTimeAtTimerEnd(number) public float GetRoundTimeAtTimerEnd(int number)
{ {
float g = GetCurrentRoundTime() - number; float g = GetCurrentRoundTime() - number;
return g; return g;
@ -83,25 +85,24 @@ public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast
roundStartedTime = GetEngineTime(); roundStartedTime = GetEngineTime();
} }
public Action PointServerCommandForward(const char[] sCommand)
public Action PointServerCommandForward(String:sCommand[])
{ {
if (!strncmp("say", sCommand, 3, false)) if (!strncmp("say", sCommand, 3, false))
{ {
new String:sMessage[512]; char sMessage[512];
new i; char sSecondsAppend[32];
bool found_numeric = false;
int i;
while (strlen(sCommand) + -4 > i) while (strlen(sCommand) + -4 > i)
{ {
sMessage[i] = sCommand[i + 4]; sMessage[i] = sCommand[i + 4];
i++; i++;
} }
new String:sSecondsAppend[32];
bool found_numeric = false;
if (StrContains(sMessage, "sec", false) != -1) if (StrContains(sMessage, "sec", false) != -1)
{ {
new indexTracker = -1 int indexTracker = -1
new endIndexTracker = -1 int endIndexTracker = -1
for (new j = 0; j <= strlen(sMessage); ++j) for (int j = 0; j < strlen(sMessage); ++j)
{ {
if (IsCharNumeric(sMessage[j])) if (IsCharNumeric(sMessage[j]))
{ {
@ -123,12 +124,12 @@ public Action PointServerCommandForward(String:sCommand[])
{ {
endIndexTracker = strlen(sMessage); endIndexTracker = strlen(sMessage);
} }
new String:SecondsLocal[512]; char SecondsLocal[512];
for (new ij = indexTracker; ij <= endIndexTracker; ij++) for (int ij = indexTracker; ij < endIndexTracker; ij++)
{ {
StrCat(SecondsLocal, sizeof(SecondsLocal), sMessage[ij]); StrCat(SecondsLocal, sizeof(SecondsLocal), sMessage[ij]);
} }
new number = StringToInt(SecondsLocal); int number = StringToInt(SecondsLocal);
//PrintToChatAll("number: %i", number); //PrintToChatAll("number: %i", number);
if (GetRoundTimeAtTimerEnd(number) > 0.0) if (GetRoundTimeAtTimerEnd(number) > 0.0)
{ {
@ -151,7 +152,7 @@ public Action PointServerCommandForward(String:sCommand[])
{ {
if (g_cvEnabled.BoolValue) if (g_cvEnabled.BoolValue)
{ {
new Handle:hMessage = StartMessageAll("HudMsg", 0); Handle hMessage = StartMessageAll("HudMsg", 0);
if (hMessage) if (hMessage)
{ {
BfWriteByte(hMessage, g_iTextChannel); BfWriteByte(hMessage, g_iTextChannel);
@ -175,9 +176,9 @@ public Action PointServerCommandForward(String:sCommand[])
} }
} }
} }
return Action:4; return Plugin_Handled;
} }
return Action:0; return Plugin_Continue;
} }
stock void FormatPlayerTime(float Time, char[] result, int maxlength, bool showDash, int precision) stock void FormatPlayerTime(float Time, char[] result, int maxlength, bool showDash, int precision)