leader2 + ZombieManager + Status: fix
This commit is contained in:
parent
b1c309ffc0
commit
59c5e45970
@ -38,13 +38,9 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
public Action Command_Status(int client, const char[] command, int args)
|
public Action Command_Status(int client, const char[] command, int args)
|
||||||
{
|
{
|
||||||
if(!client)
|
if(!client || !IsClientInGame(client))
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
|
|
||||||
// hopefully fixing some dumb exploit?!
|
|
||||||
if(!IsClientInGame(client))
|
|
||||||
return Plugin_Stop;
|
|
||||||
|
|
||||||
static char sServerName[128];
|
static char sServerName[128];
|
||||||
static char sServerTags[128];
|
static char sServerTags[128];
|
||||||
static char sServerAdress[128];
|
static char sServerAdress[128];
|
||||||
|
@ -14,7 +14,7 @@ public Plugin myinfo =
|
|||||||
name = "Zombie Manager",
|
name = "Zombie Manager",
|
||||||
author = "Dogan",
|
author = "Dogan",
|
||||||
description = "Tools to manage testround and zombies",
|
description = "Tools to manage testround and zombies",
|
||||||
version = "1.0.0",
|
version = "1.1.0",
|
||||||
url = ""
|
url = ""
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,11 +56,27 @@ public void ZR_OnClientHumanPost(int client, bool respawn, bool protect)
|
|||||||
g_bMotherZM[client] = false;
|
g_bMotherZM[client] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action ZR_OnClientInfect(int &client, int &attacker, bool &motherInfect, bool &respawnOverride, bool &respawn)
|
||||||
|
{
|
||||||
|
if(g_bTestRound)
|
||||||
|
return Plugin_Handled;
|
||||||
|
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
|
|
||||||
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
||||||
{
|
{
|
||||||
g_bMotherZM[client] = motherInfect;
|
g_bMotherZM[client] = motherInfect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action ZR_OnInfectCountdown()
|
||||||
|
{
|
||||||
|
if(g_bTestRound)
|
||||||
|
return Plugin_Handled;
|
||||||
|
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
|
|
||||||
public void OnClientSpawn(Event hEvent, const char[] sName, bool bDontBroadcast)
|
public void OnClientSpawn(Event hEvent, const char[] sName, bool bDontBroadcast)
|
||||||
{
|
{
|
||||||
int client = GetClientOfUserId(hEvent.GetInt("userid"));
|
int client = GetClientOfUserId(hEvent.GetInt("userid"));
|
||||||
@ -72,11 +88,8 @@ public Action OnPlayerTeam(Event event, const char[] name, bool dontBroadcast)
|
|||||||
{
|
{
|
||||||
int client = GetClientOfUserId(GetEventInt(event, "userid"));
|
int client = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
|
|
||||||
if(g_bMotherZM[client])
|
|
||||||
{
|
|
||||||
g_bMotherZM[client] = false;
|
g_bMotherZM[client] = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public bool Filter_Motherzombies(const char[] sPattern, Handle hClients, int client)
|
public bool Filter_Motherzombies(const char[] sPattern, Handle hClients, int client)
|
||||||
{
|
{
|
||||||
@ -123,7 +136,7 @@ public Action Command_DisplayMotherzombies(int client, int args)
|
|||||||
|
|
||||||
public Action Command_Testround(int client, int args)
|
public Action Command_Testround(int client, int args)
|
||||||
{
|
{
|
||||||
if(GetClientTeam(client) == CS_TEAM_SPECTATOR)
|
/*if(GetClientTeam(client) == CS_TEAM_SPECTATOR)
|
||||||
{
|
{
|
||||||
ReplyToCommand(client, "[SM] Please join a Team first.");
|
ReplyToCommand(client, "[SM] Please join a Team first.");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
@ -133,7 +146,7 @@ public Action Command_Testround(int client, int args)
|
|||||||
{
|
{
|
||||||
ReplyToCommand(client, "[SM] Please respawn yourself first.");
|
ReplyToCommand(client, "[SM] Please respawn yourself first.");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
ToggleTestRound(client);
|
ToggleTestRound(client);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
@ -159,12 +172,9 @@ public void ToggleTestRound(int client)
|
|||||||
CPrintToChatAll("[SM] %N activated a Test Round!", client);
|
CPrintToChatAll("[SM] %N activated a Test Round!", client);
|
||||||
LogAction(client, -1, "\"%L\" activated a Test Round.", client);
|
LogAction(client, -1, "\"%L\" activated a Test Round.", client);
|
||||||
|
|
||||||
if(ZR_IsClientHuman(client))
|
|
||||||
ZR_InfectClient(client);
|
|
||||||
|
|
||||||
for(int i = 1; i <= MaxClients; i++)
|
for(int i = 1; i <= MaxClients; i++)
|
||||||
{
|
{
|
||||||
if(i != client && IsClientInGame(i) && !IsFakeClient(i))
|
if(IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i) && ZR_IsClientZombie(i))
|
||||||
{
|
{
|
||||||
ZR_HumanClient(i, false, false);
|
ZR_HumanClient(i, false, false);
|
||||||
}
|
}
|
||||||
@ -172,6 +182,14 @@ public void ToggleTestRound(int client)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason)
|
||||||
|
{
|
||||||
|
if(g_bTestRound)
|
||||||
|
return Plugin_Handled;
|
||||||
|
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
|
|
||||||
public Action ZR_OnClientRespawn(int &client, ZR_RespawnCondition &condition)
|
public Action ZR_OnClientRespawn(int &client, ZR_RespawnCondition &condition)
|
||||||
{
|
{
|
||||||
if(g_bTestRound)
|
if(g_bTestRound)
|
||||||
|
@ -495,7 +495,17 @@ public Action Leader(int client, int args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(IsPlayerAlive(target))
|
if(!IsPlayerAlive(target))
|
||||||
|
{
|
||||||
|
ReplyToCommand(client, "[SM] The target has to be alive!");
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
else if(ZR_IsClientZombie(target))
|
||||||
|
{
|
||||||
|
ReplyToCommand(client, "[SM] The target has to be a human!");
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLeader(target);
|
SetLeader(target);
|
||||||
PrintToChatAll("[SM] %N is the new leader!", target);
|
PrintToChatAll("[SM] %N is the new leader!", target);
|
||||||
@ -503,11 +513,6 @@ public Action Leader(int client, int args)
|
|||||||
LeaderMenu(target);
|
LeaderMenu(target);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ReplyToCommand(client, "[SM] The target has to be alive!");
|
|
||||||
return Plugin_Handled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(args == 0)
|
else if(args == 0)
|
||||||
@ -517,7 +522,17 @@ public Action Leader(int client, int args)
|
|||||||
LeaderMenu(client);
|
LeaderMenu(client);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
if(IsPlayerAlive(client))
|
if(!IsPlayerAlive(client))
|
||||||
|
{
|
||||||
|
ReplyToCommand(client, "[SM] The target has to be alive!");
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
else if(ZR_IsClientZombie(client))
|
||||||
|
{
|
||||||
|
ReplyToCommand(client, "[SM] The target has to be a human!");
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetLeader(client);
|
SetLeader(client);
|
||||||
PrintToChatAll("[SM] %N is the new leader!", client);
|
PrintToChatAll("[SM] %N is the new leader!", client);
|
||||||
@ -525,11 +540,6 @@ public Action Leader(int client, int args)
|
|||||||
LeaderMenu(client);
|
LeaderMenu(client);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
ReplyToCommand(client, "[SM] The target has to be alive!");
|
|
||||||
return Plugin_Handled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user