mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-10 11:03:21 +00:00
Fix loading issue with l4d2-info-cmd
This commit is contained in:
parent
accb7234bf
commit
ef4c0ee212
2 changed files with 14 additions and 15 deletions
Binary file not shown.
|
@ -11,7 +11,6 @@
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
//#include <sdkhooks>
|
//#include <sdkhooks>
|
||||||
|
|
||||||
bool g_icAFK[MAXPLAYERS + 1];
|
|
||||||
char g_icDifficulty[16] = "Normal";
|
char g_icDifficulty[16] = "Normal";
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
|
@ -32,11 +31,19 @@ public OnPluginStart()
|
||||||
}
|
}
|
||||||
RegConsoleCmd("sm_gameinfo", PrintGameInfo, "Show the director main menu");
|
RegConsoleCmd("sm_gameinfo", PrintGameInfo, "Show the director main menu");
|
||||||
HookEvent("difficulty_changed", Event_DifficultyChanged);
|
HookEvent("difficulty_changed", Event_DifficultyChanged);
|
||||||
HookEvent("player_afk", Event_PlayerAfk);
|
|
||||||
HookEvent("player_bot_replace", Event_PlayerBotReplace);
|
|
||||||
FindConVar("z_difficulty").GetString(g_icDifficulty, sizeof(g_icDifficulty));
|
FindConVar("z_difficulty").GetString(g_icDifficulty, sizeof(g_icDifficulty));
|
||||||
|
CreateTimer(300.0, Timer_PrintInfoMessage, _, TIMER_REPEAT);
|
||||||
|
}
|
||||||
|
public OnClientPutInServer(client)
|
||||||
|
{
|
||||||
|
PrintToChat(client, "Welcome to the Manual Director server! For information or access the panel go to l4d2.jackz.me");
|
||||||
}
|
}
|
||||||
// print info
|
// print info
|
||||||
|
public Action Timer_PrintInfoMessage(Handle timer)
|
||||||
|
{
|
||||||
|
PrintToChatAll("This is the Manual Director server. Access the panel, and info about the server at l4d2.jackz.me");
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
public Action PrintGameInfo(int client, int args) {
|
public Action PrintGameInfo(int client, int args) {
|
||||||
//print server info
|
//print server info
|
||||||
ReplyToCommand(client, ">map,diff");
|
ReplyToCommand(client, ">map,diff");
|
||||||
|
@ -46,13 +53,12 @@ public Action PrintGameInfo(int client, int args) {
|
||||||
|
|
||||||
ReplyToCommand(client, "%s,%s",map,g_icDifficulty);
|
ReplyToCommand(client, "%s,%s",map,g_icDifficulty);
|
||||||
//print client info
|
//print client info
|
||||||
ReplyToCommand(client,">id,name,bot,health,status,afk,throwSlot,kitSlot,pillSlot,modelName");
|
ReplyToCommand(client,">id,name,bot,health,status,throwSlot,kitSlot,pillSlot,modelName");
|
||||||
for (int i = 1; i < MaxClients;i++) {
|
for (int i = 1; i < MaxClients;i++) {
|
||||||
if (!IsClientConnected(i)) continue;
|
if (!IsClientInGame(i)) continue;
|
||||||
if (GetClientTeam(i) != 2) continue;
|
if (GetClientTeam(i) != 2) continue;
|
||||||
int hp = GetClientRealHealth(i);
|
int hp = GetClientRealHealth(i);
|
||||||
int bot = GetSteamAccountID(i, false) == 0;
|
int bot = IsFakeClient(i);
|
||||||
int afk = g_icAFK[i];
|
|
||||||
bool incap = IsPlayerIncapped(i);
|
bool incap = IsPlayerIncapped(i);
|
||||||
bool blackandwhite = IsPlayerNearDead(i);
|
bool blackandwhite = IsPlayerNearDead(i);
|
||||||
|
|
||||||
|
@ -85,7 +91,7 @@ public Action PrintGameInfo(int client, int args) {
|
||||||
GetClientName(i, name, sizeof(name));
|
GetClientName(i, name, sizeof(name));
|
||||||
GetModelName(i, survType, sizeof(survType));
|
GetModelName(i, survType, sizeof(survType));
|
||||||
|
|
||||||
ReplyToCommand(client,"%d,%s,%d,%d,%s,%d,%s,%s,%s,%s", i, name, bot, hp, status, afk, throwType, kitType, pillType, survType);
|
ReplyToCommand(client,"%d,%s,%d,%d,%s,%s,%s,%s,%s", i, name, bot, hp, status, throwType, kitType, pillType, survType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -93,13 +99,6 @@ public Action PrintGameInfo(int client, int args) {
|
||||||
public void Event_DifficultyChanged(Event event, const char[] name, bool dontBroadcast) {
|
public void Event_DifficultyChanged(Event event, const char[] name, bool dontBroadcast) {
|
||||||
event.GetString("newDifficulty",g_icDifficulty,sizeof(g_icDifficulty));
|
event.GetString("newDifficulty",g_icDifficulty,sizeof(g_icDifficulty));
|
||||||
}
|
}
|
||||||
public void Event_PlayerAfk(Event event, const char[] name, bool dontBroadcast) {
|
|
||||||
g_icAFK[GetClientOfUserId(event.GetInt("player"))] = true;
|
|
||||||
}
|
|
||||||
public void Event_PlayerBotReplace(Event event, const char[] name, bool dontBroadcast) {
|
|
||||||
g_icAFK[GetClientOfUserId(event.GetInt("player"))] = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// METHODS //
|
// METHODS //
|
||||||
bool IsPlayerIncapped(int client)
|
bool IsPlayerIncapped(int client)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue