ExtraCommands: Make OutputInfo optional.
This commit is contained in:
parent
2367266604
commit
9aefd25b20
@ -4,11 +4,16 @@
|
|||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
#include <sdkhooks>
|
#include <sdkhooks>
|
||||||
#include <cstrike>
|
#include <cstrike>
|
||||||
#include <outputinfo>
|
|
||||||
#include <halflife>
|
#include <halflife>
|
||||||
|
|
||||||
|
#undef REQUIRE_EXTENSIONS
|
||||||
|
#tryinclude <outputinfo>
|
||||||
|
#define REQUIRE_EXTENSIONS
|
||||||
|
|
||||||
#pragma newdecls required
|
#pragma newdecls required
|
||||||
|
|
||||||
|
bool g_Extension_OutputInfo = false;
|
||||||
|
|
||||||
bool g_bInBuyZoneAll = false;
|
bool g_bInBuyZoneAll = false;
|
||||||
bool g_bInBuyZone[MAXPLAYERS + 1] = {false, ...};
|
bool g_bInBuyZone[MAXPLAYERS + 1] = {false, ...};
|
||||||
|
|
||||||
@ -84,6 +89,26 @@ public void OnPluginStart()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnAllPluginsLoaded()
|
||||||
|
{
|
||||||
|
g_Extension_OutputInfo = LibraryExists("OutputInfo");
|
||||||
|
|
||||||
|
LogMessage("ExtraCommands capabilities:\nOutputInfo: %s",
|
||||||
|
(g_Extension_OutputInfo ? "loaded" : "not loaded"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnLibraryAdded(const char[] name)
|
||||||
|
{
|
||||||
|
if(StrEqual(name, "OutputInfo"))
|
||||||
|
g_Extension_OutputInfo = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnLibraryRemoved(const char[] name)
|
||||||
|
{
|
||||||
|
if(StrEqual(name, "OutputInfo"))
|
||||||
|
g_Extension_OutputInfo = false;
|
||||||
|
}
|
||||||
|
|
||||||
public void OnMapStart()
|
public void OnMapStart()
|
||||||
{
|
{
|
||||||
g_bInBuyZoneAll = false;
|
g_bInBuyZoneAll = false;
|
||||||
@ -1213,20 +1238,23 @@ stock void WAILA(int client, int iEntity)
|
|||||||
PrintToConsole(client, "Entity Index: %i\nOrigin: %.f %.f %.f\nHammer ID: %d\nTarget name: %s\nModel Path: %s\nModel Index: %i\nClass Name: %s\nNet Class Name: %s",
|
PrintToConsole(client, "Entity Index: %i\nOrigin: %.f %.f %.f\nHammer ID: %d\nTarget name: %s\nModel Path: %s\nModel Index: %i\nClass Name: %s\nNet Class Name: %s",
|
||||||
iEntity, fvecOrigin[0], fvecOrigin[1], fvecOrigin[2], iHammerID, sTargetname, sModelPath, iEntityModelIdx, sClsName, sNetClsName);
|
iEntity, fvecOrigin[0], fvecOrigin[1], fvecOrigin[2], iHammerID, sTargetname, sModelPath, iEntityModelIdx, sClsName, sNetClsName);
|
||||||
|
|
||||||
char sOutputName[128];
|
if(g_Extension_OutputInfo)
|
||||||
for(int index = 0; ; index++)
|
|
||||||
{
|
{
|
||||||
sOutputName[0] = 0;
|
char sOutputName[128];
|
||||||
int len = GetOutputNames(iEntity, index, sOutputName, sizeof(sOutputName));
|
for(int index = 0; ; index++)
|
||||||
if(len < 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
int count = GetOutputCount(iEntity, sOutputName);
|
|
||||||
for(int i = 0; i < count; i++)
|
|
||||||
{
|
{
|
||||||
char sFormatted[1024];
|
sOutputName[0] = 0;
|
||||||
GetOutputFormatted(iEntity, sOutputName, i, sFormatted, sizeof(sFormatted));
|
int len = GetOutputNames(iEntity, index, sOutputName, sizeof(sOutputName));
|
||||||
PrintToConsole(client, "%s: %s", sOutputName, sFormatted);
|
if(len < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
int count = GetOutputCount(iEntity, sOutputName);
|
||||||
|
for(int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
char sFormatted[1024];
|
||||||
|
GetOutputFormatted(iEntity, sOutputName, i, sFormatted, sizeof(sFormatted));
|
||||||
|
PrintToConsole(client, "%s: %s", sOutputName, sFormatted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user