Added python scripts for easier compiling

Fixed bunch of includes and a warnings
Added ip addresses for admins to status
KnifeAlert prints to everyone now if someone gets infected due to a knifed zombie
Fixed WeaponCleaner not registering weapons if somebody disconnects
Refactored custom-chatcolors to new syntax, added autoreplace and some fixes
Added GFLClan.ru support to immunityreservedslots
added nominate_removemap to mapchooser_extended and fixed a bug for recently played maps
This commit is contained in:
BotoX 2016-04-26 12:36:03 +02:00
parent 29855d6669
commit 11aefe731b
29 changed files with 1639 additions and 1331 deletions

View File

@ -253,6 +253,7 @@ public APIWebResponse(const char[] sData, int client)
if(!Response.ImportFromString(sData, "SteamAPIResponse")) if(!Response.ImportFromString(sData, "SteamAPIResponse"))
{ {
LogError("ImportFromString(sData, \"SteamAPIResponse\") failed."); LogError("ImportFromString(sData, \"SteamAPIResponse\") failed.");
delete Response;
return; return;
} }

View File

@ -6,7 +6,7 @@
native int IsClientFriend(int client, int friend); native int IsClientFriend(int client, int friend);
native int ReadClientFriends(int client); native int ReadClientFriends(int client);
public SharedPlugin:__pl_AdvancedTargeting = public SharedPlugin __pl_AdvancedTargeting =
{ {
name = "AdvancedTargeting", name = "AdvancedTargeting",
file = "AdvancedTargeting.smx", file = "AdvancedTargeting.smx",
@ -18,7 +18,7 @@ public SharedPlugin:__pl_AdvancedTargeting =
}; };
#if !defined REQUIRE_PLUGIN #if !defined REQUIRE_PLUGIN
public __pl_myfile_SetNTVOptional() public __pl_AdvancedTargeting_SetNTVOptional()
{ {
MarkNativeAsOptional("IsClientFriend"); MarkNativeAsOptional("IsClientFriend");
MarkNativeAsOptional("ReadClientFriends"); MarkNativeAsOptional("ReadClientFriends");

View File

@ -26,36 +26,36 @@ public Plugin myinfo =
name = "Good AFK Manager", name = "Good AFK Manager",
author = "BotoX", author = "BotoX",
description = "A good AFK manager?", description = "A good AFK manager?",
version = "1.0", version = "1.1",
url = "" url = ""
}; };
public Cvar_KickTime(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_KickTime(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_fKickTime = GetConVarFloat(cvar); g_fKickTime = GetConVarFloat(cvar);
} }
public Cvar_MoveTime(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_MoveTime(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_fMoveTime = GetConVarFloat(cvar); g_fMoveTime = GetConVarFloat(cvar);
} }
public Cvar_WarnTime(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_WarnTime(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_fWarnTime = GetConVarFloat(cvar); g_fWarnTime = GetConVarFloat(cvar);
} }
public Cvar_KickMinPlayers(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_KickMinPlayers(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_iKickMinPlayers = GetConVarInt(cvar); g_iKickMinPlayers = GetConVarInt(cvar);
} }
public Cvar_MoveMinPlayers(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_MoveMinPlayers(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_iMoveMinPlayers = GetConVarInt(cvar); g_iMoveMinPlayers = GetConVarInt(cvar);
} }
public Cvar_Immunity(Handle:cvar, const String:oldvalue[], const String:newvalue[]) public void Cvar_Immunity(Handle:cvar, const char[] oldvalue, const char[] newvalue)
{ {
g_iImmunity = GetConVarInt(cvar); g_iImmunity = GetConVarInt(cvar);
} }
public OnPluginStart() public void OnPluginStart()
{ {
Handle cvar; Handle cvar;
HookConVarChange((cvar = CreateConVar("sm_afk_move_min", "4", "Min players for AFK move")), Cvar_MoveMinPlayers); HookConVarChange((cvar = CreateConVar("sm_afk_move_min", "4", "Min players for AFK move")), Cvar_MoveMinPlayers);
@ -85,24 +85,21 @@ public OnPluginStart()
AutoExecConfig(true, "plugin.AfkManager"); AutoExecConfig(true, "plugin.AfkManager");
} }
public OnMapStart() public void OnMapStart()
{ {
CreateTimer(AFK_CHECK_INTERVAL, Timer_CheckPlayer, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); CreateTimer(AFK_CHECK_INTERVAL, Timer_CheckPlayer, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
for (int Index = 1; Index <= MaxClients; Index++)
{
g_Players_bEnabled[Index] = false;
if (IsClientConnected(Index) && IsClientInGame(Index) && !IsFakeClient(Index))
InitializePlayer(Index);
}
} }
CheckAdminImmunity(Index) int CheckAdminImmunity(int Index)
{ {
if(!IsClientAuthorized(Index))
return false;
AdminId Id = GetUserAdmin(Index); AdminId Id = GetUserAdmin(Index);
return GetAdminFlag(Id, Admin_Generic); return GetAdminFlag(Id, Admin_Generic);
} }
ResetPlayer(Index) void ResetPlayer(int Index)
{ {
g_Players_bEnabled[Index] = false; g_Players_bEnabled[Index] = false;
g_Players_bFlagged[Index] = false; g_Players_bFlagged[Index] = false;
@ -113,9 +110,9 @@ ResetPlayer(Index)
g_Players_iSpecTarget[Index] = 0; g_Players_iSpecTarget[Index] = 0;
} }
InitializePlayer(Index) void InitializePlayer(int Index)
{ {
if (!(g_iImmunity == 1 && CheckAdminImmunity(Index))) if(!(g_iImmunity == 1 && CheckAdminImmunity(Index)))
{ {
ResetPlayer(Index); ResetPlayer(Index);
g_Players_iLastAction[Index] = GetTime(); g_Players_iLastAction[Index] = GetTime();
@ -123,36 +120,37 @@ InitializePlayer(Index)
} }
} }
public OnClientPostAdminCheck(Index) public void OnClientConnected(int client)
{ {
if (!IsFakeClient(Index)) ResetPlayer(client);
}
public void OnClientPostAdminCheck(int Index)
{
if(!IsFakeClient(Index))
InitializePlayer(Index); InitializePlayer(Index);
} }
public OnClientDisconnect(Index) public void OnClientDisconnect(int Index)
{ {
ResetPlayer(Index); ResetPlayer(Index);
} }
public Action:Event_PlayerTeamPost(Handle:event, const String:name[], bool:dontBroadcast) public Action Event_PlayerTeamPost(Handle event, const char[] name, bool dontBroadcast)
{ {
int Index = GetClientOfUserId(GetEventInt(event, "userid")); int Index = GetClientOfUserId(GetEventInt(event, "userid"));
if (Index > 0 && !IsFakeClient(Index)) if(Index > 0 && !IsFakeClient(Index))
{
if (!g_Players_bEnabled[Index])
InitializePlayer(Index);
g_Players_iLastAction[Index] = GetTime(); g_Players_iLastAction[Index] = GetTime();
}
} }
public Action:Command_Say(Index, const String:Command[], Args) public Action Command_Say(Index, const char[] Command, Args)
{ {
g_Players_iLastAction[Index] = GetTime(); g_Players_iLastAction[Index] = GetTime();
} }
public Action:OnPlayerRunCmd(Index, &iButtons, &iImpulse, Float:fVel[3], Float:fAngles[3], &iWeapon) public Action OnPlayerRunCmd(int Index, int &iButtons, int &iImpulse, float fVel[3], float fAngles[3], int &iWeapon)
{ {
if (((g_Players_fEyePosition[Index][0] != fAngles[0]) || if(((g_Players_fEyePosition[Index][0] != fAngles[0]) ||
(g_Players_fEyePosition[Index][1] != fAngles[1]) || (g_Players_fEyePosition[Index][1] != fAngles[1]) ||
(g_Players_fEyePosition[Index][2] != fAngles[2])) (g_Players_fEyePosition[Index][2] != fAngles[2]))
&& g_Players_iSpecMode[Index] != 4) // OBS_MODE_IN_EYE && g_Players_iSpecMode[Index] != 4) // OBS_MODE_IN_EYE
@ -172,33 +170,33 @@ public Action:OnPlayerRunCmd(Index, &iButtons, &iImpulse, Float:fVel[3], Float:f
return Plugin_Continue; return Plugin_Continue;
} }
public Action:Timer_CheckPlayer(Handle:Timer, any:Data) public Action Timer_CheckPlayer(Handle Timer, any Data)
{ {
int Index; int Index;
int Clients = 0; int Clients = 0;
for (Index = 1; Index <= MaxClients; Index++) for(Index = 1; Index <= MaxClients; Index++)
{ {
if (IsClientInGame(Index) && !IsFakeClient(Index)) if(IsClientInGame(Index) && !IsFakeClient(Index))
Clients++; Clients++;
} }
bool bMovePlayers = (Clients >= g_iMoveMinPlayers && g_fMoveTime > 0.0); bool bMovePlayers = (Clients >= g_iMoveMinPlayers && g_fMoveTime > 0.0);
bool bKickPlayers = (Clients >= g_iKickMinPlayers && g_fKickTime > 0.0); bool bKickPlayers = (Clients >= g_iKickMinPlayers && g_fKickTime > 0.0);
if (!bMovePlayers && !bKickPlayers) if(!bMovePlayers && !bKickPlayers)
return Plugin_Continue; return Plugin_Continue;
for (Index = 1; Index <= MaxClients; Index++) for(Index = 1; Index <= MaxClients; Index++)
{ {
if (!g_Players_bEnabled[Index] || !IsClientInGame(Index)) // Is this player actually in the game? if(!g_Players_bEnabled[Index] || !IsClientInGame(Index))
continue; continue;
int iTeamNum = GetClientTeam(Index); int iTeamNum = GetClientTeam(Index);
if (IsClientObserver(Index)) if(IsClientObserver(Index))
{ {
if (iTeamNum > CS_TEAM_SPECTATOR && !IsPlayerAlive(Index)) if(iTeamNum > CS_TEAM_SPECTATOR && !IsPlayerAlive(Index))
continue; continue;
int iSpecMode = g_Players_iSpecMode[Index]; int iSpecMode = g_Players_iSpecMode[Index];
@ -207,68 +205,66 @@ public Action:Timer_CheckPlayer(Handle:Timer, any:Data)
g_Players_iSpecMode[Index] = GetEntProp(Index, Prop_Send, "m_iObserverMode"); g_Players_iSpecMode[Index] = GetEntProp(Index, Prop_Send, "m_iObserverMode");
g_Players_iSpecTarget[Index] = GetEntPropEnt(Index, Prop_Send, "m_hObserverTarget"); g_Players_iSpecTarget[Index] = GetEntPropEnt(Index, Prop_Send, "m_hObserverTarget");
if ((iSpecMode && g_Players_iSpecMode[Index] != iSpecMode) || (iSpecTarget && g_Players_iSpecTarget[Index] != iSpecTarget)) if((iSpecMode && g_Players_iSpecMode[Index] != iSpecMode) || (iSpecTarget && g_Players_iSpecTarget[Index] != iSpecTarget))
g_Players_iLastAction[Index] = GetTime(); g_Players_iLastAction[Index] = GetTime();
} }
int IdleTime = GetTime() - g_Players_iLastAction[Index]; int IdleTime = GetTime() - g_Players_iLastAction[Index];
if (g_Players_bFlagged[Index] && (g_fKickTime - IdleTime) > 0.0) if(g_Players_bFlagged[Index] && (g_fKickTime - IdleTime) > 0.0)
{ {
PrintCenterText(Index, "Welcome back!"); PrintCenterText(Index, "Welcome back!");
PrintToChat(Index, "\x04[AFK] \x01You have been un-flagged for being inactive."); PrintToChat(Index, "\x04[AFK]\x01 You have been un-flagged for being inactive.");
g_Players_bFlagged[Index] = false; g_Players_bFlagged[Index] = false;
} }
if (bMovePlayers && iTeamNum > CS_TEAM_SPECTATOR && ( !g_iImmunity || g_iImmunity == 2 || !CheckAdminImmunity(Index))) if(bMovePlayers && iTeamNum > CS_TEAM_SPECTATOR && (!g_iImmunity || g_iImmunity == 2 || !CheckAdminImmunity(Index)))
{ {
float iTimeleft = g_fMoveTime - IdleTime; float iTimeleft = g_fMoveTime - IdleTime;
if (iTimeleft > 0.0) if(iTimeleft > 0.0)
{ {
if(iTimeleft <= g_fWarnTime) if(iTimeleft <= g_fWarnTime)
{ {
PrintCenterText(Index, "Warning: If you do not move in %d seconds, you will be moved to spectate.", RoundToFloor(iTimeleft)); PrintCenterText(Index, "Warning: If you do not move in %d seconds, you will be moved to spectate.", RoundToFloor(iTimeleft));
PrintToChat(Index, "\x04[AFK] \x01Warning: If you do not move in %d seconds, you will be moved to spectate.", RoundToFloor(iTimeleft)); PrintToChat(Index, "\x04[AFK]\x01 Warning: If you do not move in %d seconds, you will be moved to spectate.", RoundToFloor(iTimeleft));
} }
} }
else else
{ {
decl String:f_Name[MAX_NAME_LENGTH+4]; PrintToChatAll("\x04[AFK] \x03%N\x01 was moved to spectate for being AFK too long.", Index);
Format(f_Name, sizeof(f_Name), "\x03%N\x01", Index);
PrintToChatAll("\x04[AFK] \x01%s was moved to spectate for being AFK too long.", f_Name);
ForcePlayerSuicide(Index); ForcePlayerSuicide(Index);
ChangeClientTeam(Index, CS_TEAM_SPECTATOR); ChangeClientTeam(Index, CS_TEAM_SPECTATOR);
} }
} }
else if (g_fKickTime > 0.0 && (!g_iImmunity || g_iImmunity == 3 || !CheckAdminImmunity(Index))) else if(g_fKickTime > 0.0 && (!g_iImmunity || g_iImmunity == 3 || !CheckAdminImmunity(Index)))
{ {
float iTimeleft = g_fKickTime - IdleTime; float iTimeleft = g_fKickTime - IdleTime;
if (iTimeleft > 0.0) if(iTimeleft > 0.0)
{ {
if (iTimeleft <= g_fWarnTime) if(iTimeleft <= g_fWarnTime)
{ {
PrintCenterText(Index, "Warning: If you do not move in %d seconds, you will be kick-flagged for being inactive.", RoundToFloor(iTimeleft)); PrintCenterText(Index, "Warning: If you do not move in %d seconds, you will be kick-flagged for being inactive.", RoundToFloor(iTimeleft));
PrintToChat(Index, "\x04[AFK] \x01Warning: If you do not move in %d seconds, you will be kick-flagged for being inactive.", RoundToFloor(iTimeleft)); PrintToChat(Index, "\x04[AFK]\x01 Warning: If you do not move in %d seconds, you will be kick-flagged for being inactive.", RoundToFloor(iTimeleft));
} }
} }
else else
{ {
if (!g_Players_bFlagged[Index]) if(!g_Players_bFlagged[Index])
{ {
PrintToChat(Index, "\x04[AFK] \x01You have been kick-flagged for being inactive."); PrintToChat(Index, "\x04[AFK]\x01 You have been kick-flagged for being inactive.");
g_Players_bFlagged[Index] = true; g_Players_bFlagged[Index] = true;
} }
int FlaggedPlayers = 0; int FlaggedPlayers = 0;
int Position = 1; int Position = 1;
for (int Index_ = 1; Index_ <= MaxClients; Index_++) for(int Index_ = 1; Index_ <= MaxClients; Index_++)
{ {
if (!g_Players_bFlagged[Index_]) if(!g_Players_bFlagged[Index_])
continue; continue;
FlaggedPlayers++; FlaggedPlayers++;
int IdleTime_ = GetTime() - g_Players_iLastAction[Index_]; int IdleTime_ = GetTime() - g_Players_iLastAction[Index_];
if (IdleTime_ > IdleTime) if(IdleTime_ > IdleTime)
Position++; Position++;
} }
PrintCenterText(Index, "You have been kick-flagged for being inactive. [%d/%d]", Position, FlaggedPlayers); PrintCenterText(Index, "You have been kick-flagged for being inactive. [%d/%d]", Position, FlaggedPlayers);
@ -281,27 +277,24 @@ public Action:Timer_CheckPlayer(Handle:Timer, any:Data)
int InactivePlayer = -1; int InactivePlayer = -1;
int InactivePlayerTime = 0; int InactivePlayerTime = 0;
for (Index = 1; Index <= MaxClients; Index++) for(Index = 1; Index <= MaxClients; Index++)
{ {
if (!g_Players_bFlagged[Index]) if(!g_Players_bEnabled[Index] || !g_Players_bFlagged[Index])
continue; continue;
int IdleTime = GetTime() - g_Players_iLastAction[Index]; int IdleTime = GetTime() - g_Players_iLastAction[Index];
if(IdleTime >= g_fKickTime && IdleTime > InactivePlayerTime)
if (IdleTime > InactivePlayerTime)
{ {
InactivePlayer = Index; InactivePlayer = Index;
InactivePlayerTime = IdleTime; InactivePlayerTime = IdleTime;
} }
} }
if (InactivePlayer == -1) if(InactivePlayer == -1)
break; break;
else else
{ {
decl String:f_Name[MAX_NAME_LENGTH+4]; PrintToChatAll("\x04[AFK] \x03%N\x01 was kicked for being AFK too long. (%d seconds)", InactivePlayer, InactivePlayerTime);
Format(f_Name, sizeof(f_Name), "\x03%N\x01", InactivePlayer);
PrintToChatAll("\x04[AFK] %s was kicked for being AFK too long. (%d seconds)", f_Name, InactivePlayerTime);
KickClient(InactivePlayer, "[AFK] You were kicked for being AFK too long. (%d seconds)", InactivePlayerTime); KickClient(InactivePlayer, "[AFK] You were kicked for being AFK too long. (%d seconds)", InactivePlayerTime);
Clients--; Clients--;
g_Players_bFlagged[InactivePlayer] = false; g_Players_bFlagged[InactivePlayer] = false;

View File

@ -27,13 +27,13 @@ public OnPluginStart()
{ {
LoadTranslations("common.phrases"); LoadTranslations("common.phrases");
RegAdminCmd("sm_hp", Command_Health, ADMFLAG_GENERIC, "sm_hp <#userid|name> <value>"); RegAdminCmd("sm_hp", Command_Health, ADMFLAG_GENERIC, "sm_hp <#userid|name> <value>");
RegAdminCmd("sm_kevlar", Command_Kevlar, ADMFLAG_GENERIC, "sm_kevlar <#userid|name> <value>"); RegAdminCmd("sm_armor", Command_Armor, ADMFLAG_GENERIC, "sm_armor <#userid|name> <value>");
RegAdminCmd("sm_weapon", Command_Weapon, ADMFLAG_GENERIC, "sm_weapon <#userid|name> <name> [clip] [ammo]"); RegAdminCmd("sm_weapon", Command_Weapon, ADMFLAG_GENERIC, "sm_weapon <#userid|name> <name> [clip] [ammo]");
RegAdminCmd("sm_give", Command_Weapon, ADMFLAG_GENERIC, "sm_give <#userid|name> <name> [clip] [ammo]"); RegAdminCmd("sm_give", Command_Weapon, ADMFLAG_GENERIC, "sm_give <#userid|name> <name> [clip] [ammo]");
RegAdminCmd("sm_strip", Command_Strip, ADMFLAG_GENERIC, "sm_strip <#userid|name>"); RegAdminCmd("sm_strip", Command_Strip, ADMFLAG_GENERIC, "sm_strip <#userid|name>");
RegAdminCmd("sm_buyzone", Command_BuyZone, ADMFLAG_CUSTOM3, "sm_buyzone <#userid|name> <0|1>"); RegAdminCmd("sm_buyzone", Command_BuyZone, ADMFLAG_GENERIC, "sm_buyzone <#userid|name> <0|1>");
RegAdminCmd("sm_iammo", Command_InfAmmo, ADMFLAG_CUSTOM3, "sm_iammo <#userid|name> <0|1>"); RegAdminCmd("sm_iammo", Command_InfAmmo, ADMFLAG_GENERIC, "sm_iammo <#userid|name> <0|1>");
RegAdminCmd("sm_speed", Command_Speed, ADMFLAG_CUSTOM3, "sm_speed <#userid|name> <0|1>"); RegAdminCmd("sm_speed", Command_Speed, ADMFLAG_GENERIC, "sm_speed <#userid|name> <0|1>");
HookEvent("bomb_planted", Event_BombPlanted, EventHookMode_Pre); HookEvent("bomb_planted", Event_BombPlanted, EventHookMode_Pre);
HookEvent("bomb_defused", Event_BombDefused, EventHookMode_Pre); HookEvent("bomb_defused", Event_BombDefused, EventHookMode_Pre);
@ -229,11 +229,11 @@ public Action:Command_Health(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
public Action:Command_Kevlar(client, args) public Action:Command_Armor(client, args)
{ {
if(args < 2) if(args < 2)
{ {
ReplyToCommand(client, "[SM] Usage: sm_kevlar <#userid|name> <value>"); ReplyToCommand(client, "[SM] Usage: sm_armor <#userid|name> <value>");
return Plugin_Handled; return Plugin_Handled;
} }
@ -365,6 +365,11 @@ public Action:Command_Weapon(client, args)
for(new i = 0; i < target_count; i++) for(new i = 0; i < target_count; i++)
SetEntProp(target_list[i], Prop_Send, "m_bHasNightVision", 1, 1); SetEntProp(target_list[i], Prop_Send, "m_bHasNightVision", 1, 1);
} }
else if(StrEqual(weapon, "item_defuser", false))
{
for(new i = 0; i < target_count; i++)
SetEntProp(target_list[i], Prop_Send, "m_bHasDefuser", 1);
}
else else
{ {
for(new i = 0; i < target_count; i++) for(new i = 0; i < target_count; i++)

View File

@ -25,6 +25,8 @@ public Plugin:myinfo =
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
public OnPluginStart() public OnPluginStart()
{ {
LoadTranslations("common.phrases");
RegAdminCmd("sm_forceinput", Command_ForceInput, ADMFLAG_ROOT); RegAdminCmd("sm_forceinput", Command_ForceInput, ADMFLAG_ROOT);
RegAdminCmd("sm_forceinputplayer", Command_ForceInputPlayer, ADMFLAG_ROOT); RegAdminCmd("sm_forceinputplayer", Command_ForceInputPlayer, ADMFLAG_ROOT);
} }
@ -53,7 +55,7 @@ public Action:Command_ForceInputPlayer(client, args)
client, client,
target_list, target_list,
MAXPLAYERS, MAXPLAYERS,
COMMAND_FILTER_ALIVE, 0,
target_name, target_name,
sizeof(target_name), sizeof(target_name),
tn_is_ml)) <= 0) tn_is_ml)) <= 0)

View File

@ -14,7 +14,7 @@ public Plugin myinfo =
name = "Knife Notifications", name = "Knife Notifications",
author = "Obus + BotoX", author = "Obus + BotoX",
description = "Notify administrators when zombies have been knifed by humans.", description = "Notify administrators when zombies have been knifed by humans.",
version = "2.1", version = "2.2",
url = "" url = ""
}; };
@ -106,12 +106,8 @@ public Action Event_PlayerHurt(Handle hEvent, const char[] name, bool dontBroadc
else else
LogMessage("%L killed %L (Recently knifed by a disconnected player [%s])", attacker, victim, g_sAttackerSID[attacker]); LogMessage("%L killed %L (Recently knifed by a disconnected player [%s])", attacker, victim, g_sAttackerSID[attacker]);
for(int i = 1; i <= MaxClients; i++) CPrintToChatAll("{green}[SM] {red}%N {green}(%s){default} killed {blue}%N{default} - knifed by {blue}%s {green}(%s)",
{ attacker, sAtkSID, victim, (pOldKnifer != -1) ? sAtkAttackerName : "a disconnected player", g_sAttackerSID[attacker]);
if(IsClientConnected(i) && IsClientInGame(i) && (IsClientSourceTV(i) || GetAdminFlag(GetUserAdmin(i), Admin_Generic)))
CPrintToChat(i, "{green}[SM] {red}%N {green}(%s){default} killed {blue}%N{default} - knifed by {blue}%s {green}(%s)",
attacker, sAtkSID, victim, (pOldKnifer != -1) ? sAtkAttackerName : "a disconnected player", g_sAttackerSID[attacker]);
}
} }
} }
} }

View File

@ -34,7 +34,7 @@ public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
public OnPluginStart() public OnPluginStart()
{ {
// Convars. // Convars.
new Handle:hCvar = CreateConVar("sm_napalmlagfix_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD); new Handle:hCvar = CreateConVar("sm_napalmlagfix_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_NOTIFY|FCVAR_DONTRECORD);
SetConVarString(hCvar, PLUGIN_VERSION); SetConVarString(hCvar, PLUGIN_VERSION);
// Gamedata. // Gamedata.

View File

@ -13,6 +13,7 @@
"restore" "restore"
{ {
"AddOutput" "OnUser1 leveling_counter,Add,1,0,-1" "AddOutput" "OnUser1 leveling_counter,Add,1,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"m_iFrags" "10" "m_iFrags" "10"
} }
} }
@ -29,6 +30,8 @@
"restore" "restore"
{ {
"AddOutput" "OnUser1 leveling_counter,Add,2,0,-1" "AddOutput" "OnUser1 leveling_counter,Add,2,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"m_iFrags" "20" "m_iFrags" "20"
} }
} }
@ -45,6 +48,9 @@
"restore" "restore"
{ {
"AddOutput" "OnUser1 leveling_counter,Add,3,0,-1" "AddOutput" "OnUser1 leveling_counter,Add,3,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"AddOutput" "OnUser4 score10,ApplyScore,,0,-1"
"m_iFrags" "30" "m_iFrags" "30"
} }
} }

View File

@ -19,7 +19,7 @@ bool g_Plugin_zombiereloaded = false;
bool g_Plugin_voiceannounce_ex = false; bool g_Plugin_voiceannounce_ex = false;
bool g_Plugin_AdvancedTargeting = false; bool g_Plugin_AdvancedTargeting = false;
#define PLUGIN_VERSION "2.0" #define PLUGIN_VERSION "2.0.1"
public Plugin myinfo = public Plugin myinfo =
{ {
@ -50,6 +50,8 @@ char g_PlayerNames[MAXPLAYERS+1][MAX_NAME_LENGTH];
public void OnPluginStart() public void OnPluginStart()
{ {
LoadTranslations("common.phrases");
CreateConVar("sm_selfmute_version", PLUGIN_VERSION, "Version of Self-Mute", FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); CreateConVar("sm_selfmute_version", PLUGIN_VERSION, "Version of Self-Mute", FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
RegConsoleCmd("sm_sm", Command_SelfMute, "Mute player by typing !sm [playername]"); RegConsoleCmd("sm_sm", Command_SelfMute, "Mute player by typing !sm [playername]");
@ -803,84 +805,94 @@ void DisplayUnMuteMenu(int client)
/* /*
* HOOKS * HOOKS
*/ */
int g_MsgDest; #define MAX_MESSAGES 8
int g_MsgClient;
char g_MsgName[256];
char g_MsgParam1[256];
char g_MsgParam2[256];
char g_MsgParam3[256];
char g_MsgParam4[256];
int g_MsgPlayersNum;
int g_MsgPlayers[MAXPLAYERS + 1];
int g_TimerDerp = 0; int g_MsgDest[MAX_MESSAGES];
int g_MsgClient[MAX_MESSAGES] = {-1, ...};
char g_MsgName[MAX_MESSAGES][256];
char g_MsgParam1[MAX_MESSAGES][256];
char g_MsgParam2[MAX_MESSAGES][256];
char g_MsgParam3[MAX_MESSAGES][256];
char g_MsgParam4[MAX_MESSAGES][256];
int g_MsgPlayersNum[MAX_MESSAGES];
int g_MsgPlayers[MAX_MESSAGES][MAXPLAYERS + 1];
int g_NumMessages = 0;
public Action Hook_UserMessageRadioText(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init) public Action Hook_UserMessageRadioText(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init)
{ {
g_MsgDest = BfReadByte(bf); if(g_NumMessages >= MAX_MESSAGES)
g_MsgClient = BfReadByte(bf); return Plugin_Handled; // Silently drop
BfReadString(bf, g_MsgName, sizeof(g_MsgName), false);
BfReadString(bf, g_MsgParam1, sizeof(g_MsgParam1), false);
BfReadString(bf, g_MsgParam2, sizeof(g_MsgParam2), false);
BfReadString(bf, g_MsgParam3, sizeof(g_MsgParam3), false);
BfReadString(bf, g_MsgParam4, sizeof(g_MsgParam4), false);
g_MsgPlayersNum = playersNum; g_MsgDest[g_NumMessages] = BfReadByte(bf);
g_MsgClient[g_NumMessages] = BfReadByte(bf);
BfReadString(bf, g_MsgName[g_NumMessages], sizeof(g_MsgName[]), false);
BfReadString(bf, g_MsgParam1[g_NumMessages], sizeof(g_MsgParam1[]), false);
BfReadString(bf, g_MsgParam2[g_NumMessages], sizeof(g_MsgParam2[]), false);
BfReadString(bf, g_MsgParam3[g_NumMessages], sizeof(g_MsgParam3[]), false);
BfReadString(bf, g_MsgParam4[g_NumMessages], sizeof(g_MsgParam4[]), false);
g_MsgPlayersNum[g_NumMessages] = playersNum;
for(int i = 0; i < playersNum; i++) for(int i = 0; i < playersNum; i++)
g_MsgPlayers[i] = players[i]; g_MsgPlayers[g_NumMessages][i] = players[i];
if(!g_TimerDerp)
CreateTimer(0.1, Timer_PlayerRadio);
g_TimerDerp++;
if(g_TimerDerp > 1)
PrintToServer("DEBUG: Timer_PlayerRadio derped! (%d)", g_TimerDerp);
return Plugin_Handled; return Plugin_Handled;
} }
char g_MsgRadioSound[256]; char g_MsgRadioSound[MAX_MESSAGES][256];
public Action Hook_UserMessageSendAudio(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init) public Action Hook_UserMessageSendAudio(UserMsg msg_id, Handle bf, const int[] players, int playersNum, bool reliable, bool init)
{ {
BfReadString(bf, g_MsgRadioSound, sizeof(g_MsgRadioSound), false); if(g_NumMessages >= MAX_MESSAGES)
return Plugin_Handled; // Silently drop
BfReadString(bf, g_MsgRadioSound[g_NumMessages], sizeof(g_MsgRadioSound[]), false);
if(!g_NumMessages)
CreateTimer(0.1, Timer_PlayerRadio);
g_NumMessages++;
return Plugin_Handled; return Plugin_Handled;
} }
public Action Timer_PlayerRadio(Handle timer) public Action Timer_PlayerRadio(Handle timer)
{ {
g_TimerDerp = 0; for(int NumMsg = 0; NumMsg < g_NumMessages; NumMsg++)
if(g_MsgClient == -1)
return Plugin_Continue;
int[] players = new int[g_MsgPlayersNum + 1];
int playersNum = 0;
for(int i = 0; i < g_MsgPlayersNum; i++)
{ {
int client = g_MsgPlayers[i]; if(g_MsgClient[NumMsg] == -1)
if(IsClientInGame(client) && !GetIgnored(client, g_MsgClient)) continue;
players[playersNum++] = client;
int[] players = new int[g_MsgPlayersNum[NumMsg] + 1];
int playersNum = 0;
for(int i = 0; i < g_MsgPlayersNum[NumMsg]; i++)
{
int client = g_MsgPlayers[NumMsg][i];
if(IsClientInGame(client) && !GetIgnored(client, g_MsgClient[NumMsg]))
players[playersNum++] = client;
}
Handle RadioText = StartMessage("RadioText", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
BfWriteByte(RadioText, g_MsgDest[NumMsg]);
BfWriteByte(RadioText, g_MsgClient[NumMsg]);
BfWriteString(RadioText, g_MsgName[NumMsg]);
BfWriteString(RadioText, g_MsgParam1[NumMsg]);
BfWriteString(RadioText, g_MsgParam2[NumMsg]);
BfWriteString(RadioText, g_MsgParam3[NumMsg]);
BfWriteString(RadioText, g_MsgParam4[NumMsg]);
EndMessage();
Handle SendAudio = StartMessage("SendAudio", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS);
BfWriteString(SendAudio, g_MsgRadioSound[NumMsg]);
EndMessage();
g_MsgClient[NumMsg] = -1;
} }
Handle RadioText = StartMessage("RadioText", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS); g_NumMessages = 0;
BfWriteByte(RadioText, g_MsgDest);
BfWriteByte(RadioText, g_MsgClient);
BfWriteString(RadioText, g_MsgName);
BfWriteString(RadioText, g_MsgParam1);
BfWriteString(RadioText, g_MsgParam2);
BfWriteString(RadioText, g_MsgParam3);
BfWriteString(RadioText, g_MsgParam4);
EndMessage();
Handle SendAudio = StartMessage("SendAudio", players, playersNum, USERMSG_RELIABLE | USERMSG_BLOCKHOOKS); return Plugin_Stop;
BfWriteString(SendAudio, g_MsgRadioSound);
EndMessage();
g_MsgClient = -1;
return Plugin_Continue;
} }
/* /*

View File

@ -27,7 +27,7 @@ public Plugin myinfo =
name = "Status Fixer", name = "Status Fixer",
author = "zaCade + BotoX", author = "zaCade + BotoX",
description = "Fixes the 'status' command", description = "Fixes the 'status' command",
version = "1.1", version = "1.2",
url = "" url = ""
}; };
@ -98,7 +98,7 @@ public Action Command_Status(int client, const char[] command, int args)
Format(sSendBuffer, sizeof(sSendBuffer), "%stags : %s\n", sSendBuffer, sServerTags); Format(sSendBuffer, sizeof(sSendBuffer), "%stags : %s\n", sSendBuffer, sServerTags);
Format(sSendBuffer, sizeof(sSendBuffer), "%s%edicts : %d/%d/%d (used/max/free)\n", sSendBuffer, GetEntityCount(), GetMaxEntities(), GetMaxEntities() - GetEntityCount()); Format(sSendBuffer, sizeof(sSendBuffer), "%s%edicts : %d/%d/%d (used/max/free)\n", sSendBuffer, GetEntityCount(), GetMaxEntities(), GetMaxEntities() - GetEntityCount());
Format(sSendBuffer, sizeof(sSendBuffer), "%splayers : %d humans | %d bots (%d/%d)\n", sSendBuffer, iRealClients, iFakeClients, iTotalClients, MaxClients); Format(sSendBuffer, sizeof(sSendBuffer), "%splayers : %d humans | %d bots (%d/%d)\n", sSendBuffer, iRealClients, iFakeClients, iTotalClients, MaxClients);
Format(sSendBuffer, sizeof(sSendBuffer), "%s# %8s %40s %24s %12s %4s %4s %s", sSendBuffer, "userid", "name", "uniqueid", "connected", "ping", "loss", "state"); Format(sSendBuffer, sizeof(sSendBuffer), "%s# %8s %40s %24s %12s %4s %4s %s %s", sSendBuffer, "userid", "name", "uniqueid", "connected", "ping", "loss", "state", "addr");
g_hPlayerList[client] = CreateArray(ByteCountToCells(1000)); g_hPlayerList[client] = CreateArray(ByteCountToCells(1000));
@ -117,6 +117,7 @@ public Action Command_Status(int client, const char[] command, int args)
char sPlayerPing[4]; char sPlayerPing[4];
char sPlayerLoss[4]; char sPlayerLoss[4];
static char sPlayerState[16]; static char sPlayerState[16];
char sPlayerAddr[16];
Format(sPlayerID, sizeof(sPlayerID), "%d", GetClientUserId(player)); Format(sPlayerID, sizeof(sPlayerID), "%d", GetClientUserId(player));
Format(sPlayerName, sizeof(sPlayerName), "\"%N\"", player); Format(sPlayerName, sizeof(sPlayerName), "\"%N\"", player);
@ -144,8 +145,11 @@ public Action Command_Status(int client, const char[] command, int args)
else else
Format(sPlayerState, sizeof(sPlayerState), "spawning"); Format(sPlayerState, sizeof(sPlayerState), "spawning");
if(GetAdminFlag(GetUserAdmin(client), Admin_Ban))
GetClientIP(player, sPlayerAddr, sizeof(sPlayerAddr));
static char sFormatted[128]; static char sFormatted[128];
Format(sFormatted, sizeof(sFormatted), "# %8s %40s %24s %12s %4s %4s %s\n", sPlayerID, sPlayerName, sPlayerAuth, sPlayerTime, sPlayerPing, sPlayerLoss, sPlayerState); Format(sFormatted, sizeof(sFormatted), "# %8s %40s %24s %12s %4s %4s %s %s\n", sPlayerID, sPlayerName, sPlayerAuth, sPlayerTime, sPlayerPing, sPlayerLoss, sPlayerState, sPlayerAddr);
int iFormattedLength = strlen(sFormatted); int iFormattedLength = strlen(sFormatted);
if(iBufLength + iFormattedLength >= 1000) if(iBufLength + iFormattedLength >= 1000)

View File

@ -10,12 +10,12 @@ Handle g_hTimer = INVALID_HANDLE;
ConVar g_CVar_MaxWeapons; ConVar g_CVar_MaxWeapons;
ConVar g_CVar_WeaponLifetime; ConVar g_CVar_WeaponLifetime;
new g_RealRoundStartedTime; int g_RealRoundStartedTime;
new g_MaxWeapons; int g_MaxWeapons;
new g_MaxWeaponLifetime; int g_MaxWeaponLifetime;
#define MAX_WEAPONS MAXPLAYERS #define MAX_WEAPONS MAXPLAYERS
new G_WeaponArray[MAX_WEAPONS][2]; int G_WeaponArray[MAX_WEAPONS][2];
public Plugin myinfo = public Plugin myinfo =
@ -23,19 +23,17 @@ public Plugin myinfo =
name = "WeaponCleaner", name = "WeaponCleaner",
author = "BotoX", author = "BotoX",
description = "Clean unneeded weapons", description = "Clean unneeded weapons",
version = "2.0", version = "2.1",
url = "" url = ""
}; };
public void OnPluginStart() public void OnPluginStart()
{ {
RegAdminCmd("sm_sweep", Command_CleanupWeapons, ADMFLAG_GENERIC, "Cleans up all the weapons on the map unless they have a HammerID attached to them.");
g_CVar_MaxWeapons = CreateConVar("sm_weaponcleaner_max", "5", "The maximum amount of weapons allowed in the game.", 0, true, 0.0, true, MAX_WEAPONS - 1.0); g_CVar_MaxWeapons = CreateConVar("sm_weaponcleaner_max", "5", "The maximum amount of weapons allowed in the game.", 0, true, 0.0, true, MAX_WEAPONS - 1.0);
g_MaxWeapons = g_CVar_MaxWeapons.IntValue; g_MaxWeapons = g_CVar_MaxWeapons.IntValue;
g_CVar_MaxWeapons.AddChangeHook(OnConVarChanged); g_CVar_MaxWeapons.AddChangeHook(OnConVarChanged);
g_CVar_WeaponLifetime = CreateConVar("sm_weaponcleaner_lifetime", "15", "The maximum amount of time in seconds a weapon is allowed in the game.", 0, true, 0.0); g_CVar_WeaponLifetime = CreateConVar("sm_weaponcleaner_lifetime", "15", "The maximum number of seconds a weapon is allowed in the game.", 0, true, 0.0);
g_MaxWeaponLifetime = g_CVar_WeaponLifetime.IntValue; g_MaxWeaponLifetime = g_CVar_WeaponLifetime.IntValue;
g_CVar_WeaponLifetime.AddChangeHook(OnConVarChanged); g_CVar_WeaponLifetime.AddChangeHook(OnConVarChanged);
@ -51,10 +49,10 @@ public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] n
if(StringToInt(newValue) < StringToInt(oldValue)) if(StringToInt(newValue) < StringToInt(oldValue))
{ {
// Need to shrink list and kill items // Need to shrink list and kill items
new d = StringToInt(oldValue) - StringToInt(newValue); int d = StringToInt(oldValue) - StringToInt(newValue);
// Kill items that don't have space anymore // Kill items that don't have space anymore
for(new i = 0; d && i < g_MaxWeapons; i++) for(int i = 0; d && i < g_MaxWeapons; i++)
{ {
if(!G_WeaponArray[i][0]) if(!G_WeaponArray[i][0])
continue; continue;
@ -101,6 +99,14 @@ public void OnClientDisconnect(int client)
{ {
SDKUnhook(client, SDKHook_WeaponDropPost, OnWeaponDrop); SDKUnhook(client, SDKHook_WeaponDropPost, OnWeaponDrop);
SDKUnhook(client, SDKHook_WeaponEquipPost, OnWeaponEquip); SDKUnhook(client, SDKHook_WeaponEquipPost, OnWeaponEquip);
// Simulate dropping all equipped weapons
for(int i = 0; i < 5; i++)
{
int weapon = GetPlayerWeaponSlot(client, i);
if(weapon != -1)
OnWeaponDrop(client, weapon);
}
} }
public void OnEntityCreated(int entity, const char[] classname) public void OnEntityCreated(int entity, const char[] classname)
@ -118,7 +124,7 @@ public void OnEntityDestroyed(int entity)
public void OnWeaponSpawned(int entity) public void OnWeaponSpawned(int entity)
{ {
new HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID"); int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID");
// Should not be cleaned since it's a map spawned weapon // Should not be cleaned since it's a map spawned weapon
if(HammerID) if(HammerID)
return; return;
@ -133,7 +139,7 @@ public Action OnWeaponEquip(int client, int entity)
if(!IsValidEntity(entity)) if(!IsValidEntity(entity))
return; return;
new HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID"); int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID");
// Should not be cleaned since it's a map spawned weapon // Should not be cleaned since it's a map spawned weapon
if(HammerID) if(HammerID)
return; return;
@ -147,7 +153,7 @@ public Action OnWeaponDrop(int client, int entity)
if(!IsValidEntity(entity)) if(!IsValidEntity(entity))
return; return;
new HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID"); int HammerID = GetEntProp(entity, Prop_Data, "m_iHammerID");
// Should not be cleaned since it's a map spawned weapon // Should not be cleaned since it's a map spawned weapon
if(HammerID) if(HammerID)
return; return;
@ -167,7 +173,7 @@ public Action OnWeaponDrop(int client, int entity)
bool InsertWeapon(int entity) bool InsertWeapon(int entity)
{ {
// Try to find a free slot // Try to find a free slot
for(new i = 0; i < g_MaxWeapons; i++) for(int i = 0; i < g_MaxWeapons; i++)
{ {
if(G_WeaponArray[i][0]) if(G_WeaponArray[i][0])
continue; continue;
@ -192,14 +198,14 @@ bool InsertWeapon(int entity)
bool RemoveWeapon(int entity) bool RemoveWeapon(int entity)
{ {
// Find the Weapon // Find the Weapon
for(new i = 0; i < g_MaxWeapons; i++) for(int i = 0; i < g_MaxWeapons; i++)
{ {
if(G_WeaponArray[i][0] == entity) if(G_WeaponArray[i][0] == entity)
{ {
G_WeaponArray[i][0] = 0; G_WeaponArray[i][1] = 0; G_WeaponArray[i][0] = 0; G_WeaponArray[i][1] = 0;
// Move list items in front of this index back by one // Move list items in front of this index back by one
for(new j = i + 1; j < g_MaxWeapons; j++) for(int j = i + 1; j < g_MaxWeapons; j++)
{ {
G_WeaponArray[j - 1][0] = G_WeaponArray[j][0]; G_WeaponArray[j - 1][0] = G_WeaponArray[j][0];
G_WeaponArray[j - 1][1] = G_WeaponArray[j][1]; G_WeaponArray[j - 1][1] = G_WeaponArray[j][1];
@ -217,12 +223,12 @@ bool RemoveWeapon(int entity)
bool CheckWeapons() bool CheckWeapons()
{ {
for(new i = 0; i < g_MaxWeapons; i++) for(int i = 0; i < g_MaxWeapons; i++)
{ {
if(!G_WeaponArray[i][0]) if(!G_WeaponArray[i][0])
continue; continue;
if(GetTime() - G_WeaponArray[i][1] >= g_MaxWeaponLifetime) if(g_MaxWeaponLifetime && GetTime() - G_WeaponArray[i][1] >= g_MaxWeaponLifetime)
{ {
// Kill it // Kill it
AcceptEntityInput(G_WeaponArray[i][0], "Kill"); AcceptEntityInput(G_WeaponArray[i][0], "Kill");
@ -235,27 +241,12 @@ bool CheckWeapons()
return true; return true;
} }
void CleanupWeapons()
{
for(new i = 0; i < g_MaxWeapons; i++)
{
if(!G_WeaponArray[i][0])
continue;
// Kill it
AcceptEntityInput(G_WeaponArray[i][0], "Kill");
// This implicitly calls OnEntityDestroyed() which calls RemoveWeapon()
// Move index backwards (since the list was modified by removing it)
i--;
}
}
public Action Event_RoundStart(Handle:event, const char[] name, bool:dontBroadcast) public Action Event_RoundStart(Handle:event, const char[] name, bool:dontBroadcast)
{ {
for(new i = 0; i < MAX_WEAPONS; i++) for(new i = 0; i < MAX_WEAPONS; i++)
{ {
G_WeaponArray[i][0] = 0; G_WeaponArray[i][1] = 0; G_WeaponArray[i][0] = 0;
G_WeaponArray[i][1] = 0;
} }
g_RealRoundStartedTime = GetTime() + GetConVarInt(FindConVar("mp_freezetime")); g_RealRoundStartedTime = GetTime() + GetConVarInt(FindConVar("mp_freezetime"));
} }
@ -264,11 +255,3 @@ public Action Timer_CleanupWeapons(Handle:timer)
{ {
CheckWeapons(); CheckWeapons();
} }
public Action Command_CleanupWeapons(client, args)
{
CleanupWeapons();
LogAction(client, -1, "%L performed a weapons cleanup", client);
PrintToChat(client, "[SM] Weapons cleaned successfully!");
}

View File

@ -22,8 +22,8 @@ public Plugin myinfo =
public void OnPluginStart() public void OnPluginStart()
{ {
g_hCvar_WeaponSecondary = CreateConVar("sm_weaponequip_secondary", "weapon_elite", "The name of the secondary weapon to give.", FCVAR_PLUGIN); g_hCvar_WeaponSecondary = CreateConVar("sm_weaponequip_secondary", "weapon_elite", "The name of the secondary weapon to give.");
g_hCvar_WeaponPrimary = CreateConVar("sm_weaponequip_primary", "weapon_p90", "The name of the secondary weapon to give.", FCVAR_PLUGIN); g_hCvar_WeaponPrimary = CreateConVar("sm_weaponequip_primary", "weapon_p90", "The name of the secondary weapon to give.");
AutoExecConfig(true, "plugin.WeaponEquip"); AutoExecConfig(true, "plugin.WeaponEquip");
} }

37
compile-all.py Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/python3
import os
import sys
import subprocess
SM_INCLUDES = "includes"
SPCOMP = "./spcomp"
if __name__ == "__main__":
Plugins = []
Path, Directories, Files = next(os.walk("."))
for Directory in Directories:
if Directory != ".git" and Directory != "include" and Directory != "includes" and Directory != "plugins":
Plugins.append(Directory)
for Plugin in Plugins:
print("Compiling {0}".format(Plugin))
SourcePath = os.path.join(Plugin, "scripting")
Path, Directories, Files = next(os.walk(SourcePath))
for File in Files:
if File.endswith(".sp"):
SourcePath = os.path.join(Path, File)
IncludePath = os.path.join(Path, "include")
OutDir = "plugins"
OutPath = os.path.join(OutDir, os.path.splitext(os.path.basename(SourcePath))[0] + ".smx")
Compiler = [SPCOMP, "-i" + SM_INCLUDES]
if os.path.isdir(IncludePath):
Compiler.append("-i" + IncludePath)
Compiler.append(SourcePath)
Compiler.append("-o" + OutPath)
try:
subprocess.run(Compiler, check=True)
except Exception:
sys.exit(1)

36
compile.py Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/python3
import os
import sys
import subprocess
SM_INCLUDES = "includes"
SPCOMP = "./spcomp"
if __name__ == "__main__":
Plugins = []
for Directory in sys.argv[1:]:
if Directory != ".git" and Directory != "include" and Directory != "includes" and Directory != "plugins":
Plugins.append(Directory)
for Plugin in Plugins:
print("Compiling {0}".format(Plugin))
SourcePath = os.path.join(Plugin, "scripting")
Path, Directories, Files = next(os.walk(SourcePath))
for File in Files:
if File.endswith(".sp"):
SourcePath = os.path.join(Path, File)
IncludePath = os.path.join(Path, "include")
OutDir = "plugins"
OutPath = os.path.join(OutDir, os.path.splitext(os.path.basename(SourcePath))[0] + ".smx")
Compiler = [SPCOMP, "-i" + SM_INCLUDES]
if os.path.isdir(IncludePath):
Compiler.append("-i" + IncludePath)
Compiler.append(SourcePath)
Compiler.append("-o" + OutPath)
try:
subprocess.run(Compiler, check=True)
except Exception:
sys.exit(1)

View File

@ -0,0 +1,17 @@
"AutoReplace"
{
"teh" "the"
":lenny:" "( ͡° ͜ʖ ͡°)"
":feel:" " ´_ゝ`"
":chill:" "( ≖‿≖)"
":cute:" "(´・ω・`)"
":shrug:" "¯\_(ツ)_/¯"
":smile:" "( ・◡・)"
":sad:" "( ´`)"
":happy:" "(´∀`)"
":3:" "( ¯3¯)"
":dunno:" "┐(´д`)┌"
":please:" "(人・_・) pleaseeee!"
":table:" "(╯°□°)╯︵ ┻━┻"
":?:" "ヽ( ゚Д゚)ノ?"
}

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ enum CCC_ColorType {
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native CCC_GetColor(client, CCC_ColorType:type, &bool:alpha = false); native int CCC_GetColor(int client, CCC_ColorType type, bool &alpha = false);
/** /**
* Sets a client's color as a hexadecimal integer. * Sets a client's color as a hexadecimal integer.
@ -44,7 +44,7 @@ native CCC_GetColor(client, CCC_ColorType:type, &bool:alpha = false);
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native bool:CCC_SetColor(client, CCC_ColorType:type, color, bool:alpha); native int CCC_SetColor(int client, CCC_ColorType type, int color, bool alpha);
/** /**
* Gets a client's tag * Gets a client's tag
@ -56,7 +56,7 @@ native bool:CCC_SetColor(client, CCC_ColorType:type, color, bool:alpha);
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native CCC_GetTag(client, String:buffer[], maxlen); native int CCC_GetTag(int client, char[] buffer, int maxlen);
/** /**
* Sets a client's tag * Sets a client's tag
@ -67,7 +67,7 @@ native CCC_GetTag(client, String:buffer[], maxlen);
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native CCC_SetTag(client, const String:tag[]); native void CCC_SetTag(int client, const char[] tag);
/** /**
* Resets a client's color to the value in the config file. * Resets a client's color to the value in the config file.
@ -78,7 +78,7 @@ native CCC_SetTag(client, const String:tag[]);
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native CCC_ResetColor(client, CCC_ColorType:type); native int CCC_ResetColor(int client, CCC_ColorType type);
/** /**
* Resets a client's tag to the value in the config file. * Resets a client's tag to the value in the config file.
@ -88,7 +88,7 @@ native CCC_ResetColor(client, CCC_ColorType:type);
* *
* On error/errors: Invalid client index or client is not in game * On error/errors: Invalid client index or client is not in game
*/ */
native CCC_ResetTag(client); native int CCC_ResetTag(int client);
/** /**
* Called when a cilent's name is about to be colored * Called when a cilent's name is about to be colored
@ -97,8 +97,8 @@ native CCC_ResetTag(client);
* @param client Client index * @param client Client index
* @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring * @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring
*/ */
#pragma deprecated Use CCC_OnColor instead //#pragma deprecated Use CCC_OnColor instead
forward Action:CCC_OnNameColor(client); //forward Action:CCC_OnNameColor(client);
/** /**
* Called when a client's chat is about to be colored * Called when a client's chat is about to be colored
@ -107,8 +107,8 @@ forward Action:CCC_OnNameColor(client);
* @param client Client index * @param client Client index
* @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring * @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring
*/ */
#pragma deprecated Use CCC_OnColor instead //#pragma deprecated Use CCC_OnColor instead
forward Action:CCC_OnChatColor(client); //forward Action:CCC_OnChatColor(client);
/** /**
* Called when a client's name is about to be tagged * Called when a client's name is about to be tagged
@ -117,8 +117,8 @@ forward Action:CCC_OnChatColor(client);
* @param client Client index * @param client Client index
* @return Plugin_Handled to prevent tagging, Plugin_Continue to allow tagging * @return Plugin_Handled to prevent tagging, Plugin_Continue to allow tagging
*/ */
#pragma deprecated Use CCC_OnColor instead //#pragma deprecated Use CCC_OnColor instead
forward Action:CCC_OnTagApplied(client); //forward Action:CCC_OnTagApplied(client);
/** /**
* Called when a client's name is about to be tagged * Called when a client's name is about to be tagged
@ -129,7 +129,7 @@ forward Action:CCC_OnTagApplied(client);
* @param type What type of color will be applied. If this is CCC_TagColor, it controls whether the tag will be applied at all, not whether the tag will be colored. * @param type What type of color will be applied. If this is CCC_TagColor, it controls whether the tag will be applied at all, not whether the tag will be colored.
* @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring * @return Plugin_Handled to prevent coloring, Plugin_Continue to allow coloring
*/ */
forward Action:CCC_OnColor(client, const String:message[], CCC_ColorType:type); //forward Action:CCC_OnColor(client, const String:message[], CCC_ColorType:type);
/** /**
* Called when a message has been fully colored and will be sent, unless further plugins modify it through Simple Chat Processor * Called when a message has been fully colored and will be sent, unless further plugins modify it through Simple Chat Processor
@ -139,7 +139,7 @@ forward Action:CCC_OnColor(client, const String:message[], CCC_ColorType:type);
* @param maxlen Maximum length of message buffer * @param maxlen Maximum length of message buffer
* @noreturn * @noreturn
*/ */
forward CCC_OnChatMessage(author, String:message[], maxlen); //forward CCC_OnChatMessage(author, String:message[], maxlen);
/** /**
* Called when a client's colors and tag are about to be loaded from the config file * Called when a client's colors and tag are about to be loaded from the config file
@ -148,7 +148,7 @@ forward CCC_OnChatMessage(author, String:message[], maxlen);
* @param client Client index * @param client Client index
* @return Plugin_Handled or Plugin_Stop to prevent loading, Plugin_Continue or Plugin_Changed to allow * @return Plugin_Handled or Plugin_Stop to prevent loading, Plugin_Continue or Plugin_Changed to allow
*/ */
forward Action:CCC_OnUserConfigPreLoaded(client); forward Action CCC_OnUserConfigPreLoaded(int client);
/** /**
* Called when a client's colors and tag have been loaded from the config file * Called when a client's colors and tag have been loaded from the config file
@ -156,18 +156,19 @@ forward Action:CCC_OnUserConfigPreLoaded(client);
* @param client Client index * @param client Client index
* @noreturn * @noreturn
*/ */
forward CCC_OnUserConfigLoaded(client); forward void CCC_OnUserConfigLoaded(int client);
/** /**
* Called when the configuration file is reloaded with the sm_reloadccc command * Called when the configuration file is reloaded with the sm_reloadccc command
* *
* @noreturn * @noreturn
*/ */
forward CCC_OnConfigReloaded(); forward void CCC_OnConfigReloaded();
native void CCC_UpdateIgnoredArray(bool IgnoredArray[(MAXPLAYERS + 1) * (MAXPLAYERS + 1)]); native int CCC_UpdateIgnoredArray(bool IgnoredArray[(MAXPLAYERS + 1) * (MAXPLAYERS + 1)]);
public SharedPlugin:__pl_ccc = { public SharedPlugin __pl_ccc =
{
name = "ccc", name = "ccc",
file = "custom-chatcolors.smx", file = "custom-chatcolors.smx",
#if defined REQUIRE_PLUGIN #if defined REQUIRE_PLUGIN
@ -187,4 +188,4 @@ public __pl_ccc_SetNTVOptional() {
MarkNativeAsOptional("CCC_ResetTag"); MarkNativeAsOptional("CCC_ResetTag");
MarkNativeAsOptional("CCC_UpdateIgnoredArray"); MarkNativeAsOptional("CCC_UpdateIgnoredArray");
} }
#endif #endif

View File

@ -3,51 +3,56 @@
"Cstrike_Chat_CT_Loc" "Cstrike_Chat_CT_Loc"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}" "en" "(Counter-Terrorist) {1} : {2}"
} }
"Cstrike_Chat_CT" "Cstrike_Chat_CT"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "(Counter-Terrorist) {1} : {2}" "en" "(Counter-Terrorist) {1} : {2}"
} }
"Cstrike_Chat_T_Loc" "Cstrike_Chat_T_Loc"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}" "en" "(Terrorist) {1} : {2}"
} }
"Cstrike_Chat_T" "Cstrike_Chat_T"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "(Terrorist) {1} : {2}" "en" "(Terrorist) {1} : {2}"
} }
"Cstrike_Chat_CT_Dead" "Cstrike_Chat_CT_Dead"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "*DEAD*(Counter-Terrorist) {1} : {2}" "en" "*DEAD*(Counter-Terrorist) {1} : {2}"
} }
"Cstrike_Chat_T_Dead" "Cstrike_Chat_T_Dead"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "*DEAD*(Terrorist) {1} : {2}" "en" "*DEAD*(Terrorist) {1} : {2}"
} }
"Cstrike_Chat_Spec" "Cstrike_Chat_Spec"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "(Spectator) {1} : {2}" "en" "(Spectator) {1} : {2}"
} }
"Cstrike_Chat_All" "Cstrike_Chat_All"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "{1} : {2}" "en" "{1} : {2}"
} }
"Cstrike_Chat_AllDead" "Cstrike_Chat_AllDead"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "*DEAD* {1} : {2}" "en" "*DEAD* {1} : {2}"
} }
"Cstrike_Chat_AllSpec" "Cstrike_Chat_AllSpec"
{ {
"#format" "{1:s},{2:s}" "#format" "{1:s},{2:s}"
"en" "*SPEC* {1} : {2}" "en" "*SPEC* {1} : {2}"
}
"Cstrike_Chat_Me"
{
"#format" "{1:s},{2:s}"
"en" "* {1} {2}"
} }
} }

View File

@ -123,9 +123,10 @@
#undef REQUIRE_PLUGIN #undef REQUIRE_PLUGIN
#include <donator> #include <donator>
#include <entWatch> #include <entWatch>
#include <GFLClanru>
#define REQUIRE_PLUGIN #define REQUIRE_PLUGIN
#define PLUGIN_VERSION "2.0.9" #define PLUGIN_VERSION "2.1.0"
// Toggle build here. // Toggle build here.
#define EXT_CBASE 0 #define EXT_CBASE 0
@ -154,6 +155,7 @@ new bool:b_lateLoad;
new bool:b_loaded; new bool:b_loaded;
new bool:b_useDonator; new bool:b_useDonator;
new bool:b_useEntWatch; new bool:b_useEntWatch;
new bool:b_useGFLClanru;
new bool:b_canKickSpec[MAXPLAYERS+1]; new bool:b_canKickSpec[MAXPLAYERS+1];
new g_HIPCount; new g_HIPCount;
@ -212,62 +214,62 @@ public OnPluginStart()
#if EXT_CONNECT #if EXT_CONNECT
Format(desc, sizeof(desc), "%t", "irs_autopassword"); Format(desc, sizeof(desc), "%t", "irs_autopassword");
cvar_AutoPassword = CreateConVar("sm_irs_autopassword", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 2.0); cvar_AutoPassword = CreateConVar("sm_irs_autopassword", "0", desc, _, true, 0.0, true, 2.0);
Format(desc, sizeof(desc), "%t", "irs_rejectreason_enable"); Format(desc, sizeof(desc), "%t", "irs_rejectreason_enable");
cvar_RejectReasonEnable = CreateConVar("sm_irs_rejectreason_enable", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_RejectReasonEnable = CreateConVar("sm_irs_rejectreason_enable", "0", desc, _, true, 0.0, true, 1.0);
Format(desc, sizeof(desc), "%t", "irs_rejectreason"); Format(desc, sizeof(desc), "%t", "irs_rejectreason");
cvar_RejectReason = CreateConVar("sm_irs_rejectreason", "default", desc, FCVAR_PLUGIN); cvar_RejectReason = CreateConVar("sm_irs_rejectreason", "default", desc, _);
cvar_GameTypeMVM = FindConVar("tf_gamemode_mvm"); cvar_GameTypeMVM = FindConVar("tf_gamemode_mvm");
#endif #endif
Format(desc, sizeof(desc), "%t", "irs_version"); Format(desc, sizeof(desc), "%t", "irs_version");
CreateConVar("sm_irs_version", PLUGIN_VERSION, desc, FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD); CreateConVar("sm_irs_version", PLUGIN_VERSION, desc, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
Format(desc, sizeof(desc), "%t", "irs_kicktype"); Format(desc, sizeof(desc), "%t", "irs_kicktype");
cvar_KickType = CreateConVar("sm_irs_kicktype", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 3.0); cvar_KickType = CreateConVar("sm_irs_kicktype", "0", desc, _, true, 0.0, true, 3.0);
Format(desc, sizeof(desc), "%t", "irs_kickreason"); Format(desc, sizeof(desc), "%t", "irs_kickreason");
cvar_KickReason = CreateConVar("sm_irs_kickreason", "default", desc, FCVAR_PLUGIN); cvar_KickReason = CreateConVar("sm_irs_kickreason", "default", desc, _);
Format(desc, sizeof(desc), "%t", "irs_kickreason_immunity"); Format(desc, sizeof(desc), "%t", "irs_kickreason_immunity");
cvar_KickReasonImmunity = CreateConVar("sm_irs_kickreason_immunity", "default", desc, FCVAR_PLUGIN); cvar_KickReasonImmunity = CreateConVar("sm_irs_kickreason_immunity", "default", desc, _);
Format(desc, sizeof(desc), "%t", "irs_kicklist_file"); Format(desc, sizeof(desc), "%t", "irs_kicklist_file");
cvar_KickListFile = CreateConVar("sm_irs_kicklist_file", "default", desc, FCVAR_PLUGIN); cvar_KickListFile = CreateConVar("sm_irs_kicklist_file", "default", desc, _);
Format(desc, sizeof(desc), "%t", "irs_kicklist_mode"); Format(desc, sizeof(desc), "%t", "irs_kicklist_mode");
cvar_KickListMode = CreateConVar("sm_irs_kicklist_mode", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 2.0); cvar_KickListMode = CreateConVar("sm_irs_kicklist_mode", "0", desc, _, true, 0.0, true, 2.0);
Format(desc, sizeof(desc), "%t", "irs_log"); Format(desc, sizeof(desc), "%t", "irs_log");
cvar_Logging = CreateConVar("sm_irs_log", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 2.0); cvar_Logging = CreateConVar("sm_irs_log", "0", desc, _, true, 0.0, true, 2.0);
Format(desc, sizeof(desc), "%t", "irs_immunity"); Format(desc, sizeof(desc), "%t", "irs_immunity");
cvar_Immunity = CreateConVar("sm_irs_immunity", "1", desc, FCVAR_PLUGIN, true, 0.0, true, 2.0); cvar_Immunity = CreateConVar("sm_irs_immunity", "1", desc, _, true, 0.0, true, 2.0);
Format(desc, sizeof(desc), "%t", "irs_kickspecfirst"); Format(desc, sizeof(desc), "%t", "irs_kickspecfirst");
cvar_Spec = CreateConVar("sm_irs_kickspecfirst", "1", desc, FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_Spec = CreateConVar("sm_irs_kickspecfirst", "1", desc, _, true, 0.0, true, 1.0);
Format(desc, sizeof(desc), "%t", "irs_kickspecdelay"); Format(desc, sizeof(desc), "%t", "irs_kickspecdelay");
cvar_SpecKickDelay = CreateConVar("sm_irs_kickspecdelay", "0", desc, FCVAR_PLUGIN, true, 0.0); cvar_SpecKickDelay = CreateConVar("sm_irs_kickspecdelay", "0", desc, _, true, 0.0);
Format(desc, sizeof(desc), "%t", "irs_donator_support"); Format(desc, sizeof(desc), "%t", "irs_donator_support");
cvar_Donator = CreateConVar("sm_irs_donator_support", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_Donator = CreateConVar("sm_irs_donator_support", "0", desc, _, true, 0.0, true, 1.0);
Format(desc, sizeof(desc), "%t", "irs_donator_immunity"); Format(desc, sizeof(desc), "%t", "irs_donator_immunity");
cvar_DonatorImmunity = CreateConVar("sm_irs_donator_immunity", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 99.0); cvar_DonatorImmunity = CreateConVar("sm_irs_donator_immunity", "0", desc, _, true, 0.0, true, 99.0);
Format(desc, sizeof(desc), "%t", "irs_highimmunitylimit"); Format(desc, sizeof(desc), "%t", "irs_highimmunitylimit");
cvar_HighImmunityLimit = CreateConVar("sm_irs_highimmunitylimit", "0", desc, FCVAR_PLUGIN, true, 0.0); cvar_HighImmunityLimit = CreateConVar("sm_irs_highimmunitylimit", "0", desc, _, true, 0.0);
Format(desc, sizeof(desc), "%t", "irs_highimmunityvalue"); Format(desc, sizeof(desc), "%t", "irs_highimmunityvalue");
cvar_HighImmunityValue = CreateConVar("sm_irs_highimmunityvalue", "0", desc, FCVAR_PLUGIN, true, 0.0); cvar_HighImmunityValue = CreateConVar("sm_irs_highimmunityvalue", "0", desc, _, true, 0.0);
Format(desc, sizeof(desc), "%t", "irs_keepbalance"); Format(desc, sizeof(desc), "%t", "irs_keepbalance");
cvar_KeepBalance = CreateConVar("sm_irs_keepbalance", "0", desc, FCVAR_PLUGIN, true, 0.0, true, 1.0); cvar_KeepBalance = CreateConVar("sm_irs_keepbalance", "0", desc, _, true, 0.0, true, 1.0);
Format(desc, sizeof(desc), "%t", "irs_kicklist_reload"); Format(desc, sizeof(desc), "%t", "irs_kicklist_reload");
RegServerCmd("sm_irs_kicklist_reload", Command_KickListReload, desc); RegServerCmd("sm_irs_kicklist_reload", Command_KickListReload, desc);
@ -378,6 +380,7 @@ public OnAllPluginsLoaded()
{ {
b_useDonator = LibraryExists("donator.core"); b_useDonator = LibraryExists("donator.core");
b_useEntWatch = LibraryExists("entWatch"); b_useEntWatch = LibraryExists("entWatch");
b_useGFLClanru = LibraryExists("GFLClanru");
new Handle:h_Plugin; new Handle:h_Plugin;
new Handle:arr_Plugins = CreateArray(64); new Handle:arr_Plugins = CreateArray(64);
@ -427,6 +430,10 @@ public OnLibraryRemoved(const String:name[])
{ {
b_useEntWatch = false; b_useEntWatch = false;
} }
else if (StrEqual(name, "GFLClanru"))
{
b_useGFLClanru = false;
}
} }
public OnLibraryAdded(const String:name[]) public OnLibraryAdded(const String:name[])
@ -439,6 +446,10 @@ public OnLibraryAdded(const String:name[])
{ {
b_useEntWatch = true; b_useEntWatch = true;
} }
else if (StrEqual(name, "GFLClanru"))
{
b_useGFLClanru = true;
}
} }
IRS_RemovePlugin(const String:plugin_name[]) IRS_RemovePlugin(const String:plugin_name[])
@ -492,7 +503,7 @@ GetRealClientCount()
return ClientCount; return ClientCount;
} }
public bool:OnClientPreConnectEx(const String:name[], String:password[255], const String:ip[], const String:steamID[], String:rejectReason[255]) public EConnect OnClientPreConnectEx(const String:name[], String:password[255], const String:ip[], const String:steamID[], String:rejectReason[255])
{ {
new AdminId:AdminID = FindAdminByIdentity(AUTHMETHOD_STEAM, steamID); new AdminId:AdminID = FindAdminByIdentity(AUTHMETHOD_STEAM, steamID);
@ -517,13 +528,13 @@ public bool:OnClientPreConnectEx(const String:name[], String:password[255], cons
if (!isMVM && GetClientCount(false) < MaxClients) if (!isMVM && GetClientCount(false) < MaxClients)
{ {
//LogToFileEx(g_LogFilePath, "[DEBUG] Game is not full or MVM game mode is disabled"); //LogToFileEx(g_LogFilePath, "[DEBUG] Game is not full or MVM game mode is disabled");
return true; return k_OnClientPreConnectEx_Accept;
} }
if (isMVM && GetRealClientCount() < MAX_CLIENTS_MVM) if (isMVM && GetRealClientCount() < MAX_CLIENTS_MVM)
{ {
//LogToFileEx(g_LogFilePath, "[DEBUG] Game is MVM but there's still room available (%d clients connected)", GetRealClientCount()); //LogToFileEx(g_LogFilePath, "[DEBUG] Game is MVM but there's still room available (%d clients connected)", GetRealClientCount());
return true; return k_OnClientPreConnectEx_Accept;
} }
if (GetConVarInt(cvar_KickListMode) == 2) if (GetConVarInt(cvar_KickListMode) == 2)
@ -539,11 +550,11 @@ public bool:OnClientPreConnectEx(const String:name[], String:password[255], cons
{ {
Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason"); Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason");
} }
return false; return k_OnClientPreConnectEx_Reject;
} }
else else
{ {
return true; return k_OnClientPreConnectEx_Accept;
} }
} }
} }
@ -562,7 +573,7 @@ public bool:OnClientPreConnectEx(const String:name[], String:password[255], cons
if (IRS_KickValidClient(AdminID, name, steamID, ImmunityLevel, isDonator)) if (IRS_KickValidClient(AdminID, name, steamID, ImmunityLevel, isDonator))
{ {
//LogToFileEx(g_LogFilePath, "[DEBUG] Plugin has made successful kick and will now allow client to connect"); //LogToFileEx(g_LogFilePath, "[DEBUG] Plugin has made successful kick and will now allow client to connect");
return true; return k_OnClientPreConnectEx_Accept;
} }
else if (GetConVarInt(cvar_RejectReasonEnable) || isMVM) else if (GetConVarInt(cvar_RejectReasonEnable) || isMVM)
{ {
@ -572,7 +583,7 @@ public bool:OnClientPreConnectEx(const String:name[], String:password[255], cons
Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason"); Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason");
} }
//LogToFileEx(g_LogFilePath, "[DEBUG] No slot for connecting client, refusing connection (rejection mode)"); //LogToFileEx(g_LogFilePath, "[DEBUG] No slot for connecting client, refusing connection (rejection mode)");
return false; return k_OnClientPreConnectEx_Reject;
} }
//else //else
//{ //{
@ -588,12 +599,56 @@ public bool:OnClientPreConnectEx(const String:name[], String:password[255], cons
{ {
Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason"); Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason");
} }
return false; return k_OnClientPreConnectEx_Reject;
}
if (b_useGFLClanru)
{
new Handle:pack = CreateDataPack();
WritePackString(pack, name);
AsyncHasSteamIDReservedSlot(steamID, AsyncHasSteamIDReservedSlotCallback, pack);
return k_OnClientPreConnectEx_Async;
} }
//LogToFileEx(g_LogFilePath, "[DEBUG] End of preconnection code"); //LogToFileEx(g_LogFilePath, "[DEBUG] End of preconnection code");
return true; return k_OnClientPreConnectEx_Accept;
}
public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Result, any Data)
{
// Slot free'd up while waiting or doesn't have a reserved slot?
if(GetClientCount(false) < MaxClients || !Result)
{
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
return;
}
new String:name[MAX_NAME_LENGTH];
ResetPack(Data);
ReadPackString(Data, name, sizeof(name));
if (IRS_KickValidClient(INVALID_ADMIN_ID, name, sSteam32ID, 0, true))
{
//LogToFileEx(g_LogFilePath, "[DEBUG] Plugin has made successful kick and will now allow client to connect");
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
return;
}
else if (GetConVarInt(cvar_RejectReasonEnable) || isMVM)
{
char rejectReason[255];
GetConVarString(cvar_RejectReason, rejectReason, sizeof(rejectReason));
if (StrEqual(rejectReason, "default", false))
{
Format(rejectReason, sizeof(rejectReason), "%t", "IRS Reject Reason");
}
//LogToFileEx(g_LogFilePath, "[DEBUG] No slot for connecting client, refusing connection (rejection mode)");
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Reject, rejectReason);
return;
}
ClientPreConnectEx(sSteam32ID, k_OnClientPreConnectEx_Accept, "");
} }
#endif #endif
@ -772,7 +827,7 @@ bool:IRS_KickValidClient(const AdminId:ConnectingClientAdminID, const String:Con
} }
decl String:PlayerAuth[32]; decl String:PlayerAuth[32];
GetClientAuthString(i, PlayerAuth, sizeof(PlayerAuth)); GetClientAuthId(i, AuthId_Steam2, PlayerAuth, sizeof(PlayerAuth));
new AdminId:PlayerAdmin = FindAdminByIdentity(AUTHMETHOD_STEAM, PlayerAuth) new AdminId:PlayerAdmin = FindAdminByIdentity(AUTHMETHOD_STEAM, PlayerAuth)
ClientImmunity[i] = GetAdminImmunityLevel(PlayerAdmin); ClientImmunity[i] = GetAdminImmunityLevel(PlayerAdmin);
@ -824,17 +879,17 @@ bool:IRS_KickValidClient(const AdminId:ConnectingClientAdminID, const String:Con
continue; continue;
} }
if (b_useEntWatch && IsClientInGame(i) && entWatch_HasSpecialItem(i))
{
if (Logging == 1)
{
IRS_LogClient(i, clientTeam[i], ClientImmunity[i]);
}
continue;
}
if (IsClientInGame(i)) if (IsClientInGame(i))
{ {
if (b_useEntWatch && entWatch_HasSpecialItem(i))
{
if (Logging == 1)
{
IRS_LogClient(i, clientTeam[i], ClientImmunity[i]);
}
continue;
}
switch (KickType) switch (KickType)
{ {
case 0: case 0:
@ -964,7 +1019,7 @@ bool:IRS_KickValidClient(const AdminId:ConnectingClientAdminID, const String:Con
if (useKickList) if (useKickList)
{ {
decl String:PlayerAuth[32]; decl String:PlayerAuth[32];
GetClientAuthString(i, PlayerAuth, sizeof(PlayerAuth)); GetClientAuthId(i, AuthId_Steam2, PlayerAuth, sizeof(PlayerAuth));
if (FindStringInArray(arr_KickListIDs, PlayerAuth) == -1) if (FindStringInArray(arr_KickListIDs, PlayerAuth) == -1)
{ {
if (Logging == 1) if (Logging == 1)
@ -1091,7 +1146,7 @@ bool:IRS_KickValidClient(const AdminId:ConnectingClientAdminID, const String:Con
decl String:KickName[32]; decl String:KickName[32];
decl String:KickAuthid[32]; decl String:KickAuthid[32];
GetClientName(KickTarget, KickName, sizeof(KickName)); GetClientName(KickTarget, KickName, sizeof(KickName));
GetClientAuthString(KickTarget, KickAuthid, sizeof(KickAuthid)); GetClientAuthId(KickTarget, AuthId_Steam2, KickAuthid, sizeof(KickAuthid));
if (!immunityKick) if (!immunityKick)
{ {

View File

@ -1,11 +1,23 @@
#if defined _connect_included #if defined _Connect_Included
#endinput #endinput
#endif #endif
#define _connect_included #define _Connect_Included
forward bool:OnClientPreConnectEx(const String:name[], String:password[255], const String:ip[], const String:steamID[], String:rejectReason[255]); enum EConnect
{
k_OnClientPreConnectEx_Reject = 0,
k_OnClientPreConnectEx_Accept = 1,
k_OnClientPreConnectEx_Async = -1
};
public Extension:__ext_Connect = forward EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], const char[] sIP, const char[] sSteam32ID, char sRejectReason[255]);
native bool ClientPreConnectEx(const char[] sSteam32ID, EConnect RetVal, char sRejectReason[255]);
/**
* Do not edit below this line!
*/
public Extension __ext_connect =
{ {
name = "Connect", name = "Connect",
file = "connect.ext", file = "connect.ext",
@ -19,4 +31,11 @@ public Extension:__ext_Connect =
#else #else
required = 0, required = 0,
#endif #endif
};
#if !defined REQUIRE_EXTENSIONS
public __ext_connect_SetNTVOptional()
{
MarkNativeAsOptional("ClientPreConnectEx");
} }
#endif

View File

@ -0,0 +1,115 @@
"Phrases"
{
"irs_version"
{
"en" "Immunity Reserve Slots version."
}
"irs_kicktype"
{
"en" "Who to kick when a valid player is found (0 - random, 1 - highest ping, 2 - highest time, 3 - lowest time)."
}
"irs_kickreason"
{
"en" "Message to display when a client is kicked for a normal reserve slot (\"default\" - uses translation phrase, anything else uses what you enter)."
}
"irs_rejectreason_enable"
{
"en" "Enable reject reason with the Connect extension (0 - disable, 1 - enable)."
}
"irs_rejectreason"
{
"en" "Message to display when a client gets rejected for a reserve slot when they have reserve rights with the Connect extension (\"default\" - uses translation phrase, anything else uses what you enter)."
}
"irs_kickreason_immunity"
{
"en" "Message to display when a client is kicked for a reserve slot based on immunity (\"default\" - uses translation phrase, anything else uses what you enter)."
}
"irs_log"
{
"en" "Enable logging (0 - disable, 1 - enable highly verbose logs, 2 - only log the disconnected and connecting users in regular SM logs)."
}
"irs_immunity"
{
"en" "Enable immunity check (0 - disable, 1 - immunity check if server is full of reserves, 2 - as with 1 but also allow players with high enough immunity and no reserve flag to stay connected)."
}
"irs_kickspecfirst"
{
"en" "When enabled spectators are always kicked first before anyone else (0 - disable, all players are taken into account for kicking, 1 - enable)."
}
"irs_kickspecdelay"
{
"en" "The delay, in seconds, to kick spectators (0 - instant, any other value gives spectators a grace of xx seconds until they can be kicked)."
}
"irs_donator_support"
{
"en" "When enabled along with the donators plugin, donaotrs will be allowed to connect (0 - disable, 1 - allow donators to connect)."
}
"irs_donator_immunity"
{
"en" "The immunity value to give to donators, if required for immunity checks within IRS."
}
"irs_highimmunitylimit"
{
"en" "The maximum amount of players that can connect to the server and kick a low immunity reserve slot player (0 - no limit, more than 0 to set the max limit)."
}
"irs_highimmunityvalue"
{
"en" "This value and over are players who are considered to have high immunity (0 - disable, more than 0 to set the high immunity value)."
}
"irs_keepbalance"
{
"en" "This tries to kick people in such a way to prevent autobalance (0 - disable, 1 - enable)."
}
"irs_autopassword"
{
"en" "Allow direct connecting reserve slot users to connect without having to type in the password on a password protected server with the Connect extension (0 - disable, 1 - enable, 2 - as with 1 but allow all connecting clients to connect)."
}
"irs_kicklist_file"
{
"en" "Path to kick list file (\"default\" - uses a file in the sourcemod config folder called irs_kicklist.ini, anything else uses what you enter e.g. \"cfg/kicklist.cfg\")."
}
"irs_kicklist_mode"
{
"en" "Enable kick list mode (0 - disable, normal reserve slot operation, 1 - only use a kick list to kick specific clients, 2 - as with 1 but allow any connecting client to kick people from the server)."
}
"irs_kicklist_reload"
{
"en" "Reloads the kick list."
}
"IRS Kick Log"
{
"#format" "{1:s},{2:s},{3:s},{4:s}"
"en" "\"{1}\" ({2}) connected, \"{3}\" ({4}) was kicked."
}
"IRS Kick Reason"
{
"en" "Slot reserved."
}
"IRS Reject Reason"
{
"en" "No reserve slots available."
}
"IRS Kick List Reloaded"
{
"en" "[SM] Immunity Reserve Slots kick list reloaded."
}
"IRS Kick Reason Immunity"
{
"en" "Slot reserved - low immunity."
}
"IRS Plugin Error"
{
"#format" "{1:s}"
"en" "Unloaded plugin {1} and moved to disabled folder, when installing IRS please do not use any other reserve slot plugins."
}
"IRS Kick List Path Error"
{
"#format" "{1:s}"
"en" "Path to kick list file \"{1}\" not found or unreadable, disabling kick list mode until corrected."
}
"IRS Donator Plugin Error"
{
"en" "Unable to load the donator plugin, please check your plugins folder for the donator plugin or any other errors in your error logs."
}
}

30
includes/GFLClanru.inc Normal file
View File

@ -0,0 +1,30 @@
#if defined _GFLClanru_Included
#endinput
#endif
#define _GFLClanru_Included
typeset AsyncHasSteamIDReservedSlotCallbackFunc
{
function void (const char[] sSteam32ID, int Result);
function void (const char[] sSteam32ID, int Result, any Data);
};
native void AsyncHasSteamIDReservedSlot(const char[] sSteam32ID, AsyncHasSteamIDReservedSlotCallbackFunc Callback, any Data = 0);
public SharedPlugin __pl_GFLClanru =
{
name = "GFLClanru",
file = "GFLClanru.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public __pl_GFLClanru_SetNTVOptional()
{
MarkNativeAsOptional("AsyncHasSteamIDReservedSlot");
}
#endif

41
includes/connect.inc Normal file
View File

@ -0,0 +1,41 @@
#if defined _Connect_Included
#endinput
#endif
#define _Connect_Included
enum EConnect
{
k_OnClientPreConnectEx_Reject = 0,
k_OnClientPreConnectEx_Accept = 1,
k_OnClientPreConnectEx_Async = -1
};
forward EConnect OnClientPreConnectEx(const char[] sName, char sPassword[255], const char[] sIP, const char[] sSteam32ID, char sRejectReason[255]);
native bool ClientPreConnectEx(const char[] sSteam32ID, EConnect RetVal, char sRejectReason[255]);
/**
* Do not edit below this line!
*/
public Extension __ext_connect =
{
name = "Connect",
file = "connect.ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_EXTENSIONS
public __ext_connect_SetNTVOptional()
{
MarkNativeAsOptional("ClientPreConnectEx");
}
#endif

97
includes/updater.inc Normal file
View File

@ -0,0 +1,97 @@
#if defined _updater_included
#endinput
#endif
#define _updater_included
/**
* Adds your plugin to the updater. The URL will be updated if
* your plugin was previously added.
*
* @param url URL to your plugin's update file.
* @noreturn
*/
native Updater_AddPlugin(const String:url[]);
/**
* Removes your plugin from the updater. This does not need to
* be called during OnPluginEnd.
*
* @noreturn
*/
native Updater_RemovePlugin();
/**
* Forces your plugin to be checked for updates. The behaviour
* of the update is dependant on the server's configuration.
*
* @return True if an update was triggered. False otherwise.
* @error Plugin not found in updater.
*/
native bool:Updater_ForceUpdate();
/**
* Called when your plugin is about to be checked for updates.
*
* @return Plugin_Handled to prevent checking, Plugin_Continue to allow it.
*/
forward Action:Updater_OnPluginChecking();
/**
* Called when your plugin is about to begin downloading an available update.
*
* @return Plugin_Handled to prevent downloading, Plugin_Continue to allow it.
*/
forward Action:Updater_OnPluginDownloading();
/**
* Called when your plugin's update files have been fully downloaded
* and are about to write to their proper location. This should be used
* to free read-only resources that require write access for your update.
*
* @note OnPluginUpdated will be called later during the same frame.
*
* @noreturn
*/
forward Updater_OnPluginUpdating();
/**
* Called when your plugin's update has been completed. It is safe
* to reload your plugin at this time.
*
* @noreturn
*/
forward Updater_OnPluginUpdated();
/**
* @brief Reloads a plugin.
*
* @param plugin Plugin Handle (INVALID_HANDLE uses the calling plugin).
* @noreturn
*/
stock ReloadPlugin(Handle:plugin=INVALID_HANDLE)
{
decl String:filename[64];
GetPluginFilename(plugin, filename, sizeof(filename));
ServerCommand("sm plugins reload %s", filename);
}
public SharedPlugin:__pl_updater =
{
name = "updater",
file = "updater.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public __pl_updater_SetNTVOptional()
{
MarkNativeAsOptional("Updater_AddPlugin");
MarkNativeAsOptional("Updater_RemovePlugin");
MarkNativeAsOptional("Updater_ForceUpdate");
}
#endif

View File

@ -6,7 +6,7 @@
* File: zombiereloaded.inc * File: zombiereloaded.inc
* Type: Include * Type: Include
* Description: Main API include file. * Description: Main API include file.
* Notes: Include this file to include the whole ZR API. * Notes: Include this file to include the whole ZR API.
* *
* Copyright (C) 2009-2013 Greyscale, Richard Helgeby * Copyright (C) 2009-2013 Greyscale, Richard Helgeby
* *
@ -34,3 +34,34 @@
#include <zr/infect.zr> #include <zr/infect.zr>
#include <zr/respawn.zr> #include <zr/respawn.zr>
#include <zr/class.zr> #include <zr/class.zr>
public SharedPlugin:__pl_zombiereloaded =
{
name = "zombiereloaded",
file = "zombiereloaded.smx",
#if defined REQUIRE_PLUGIN
required = 1
#else
required = 0
#endif
};
#if !defined REQUIRE_PLUGIN
public __pl_zombiereloaded_SetNTVOptional()
{
MarkNativeAsOptional("ZR_IsValidClassIndex");
MarkNativeAsOptional("ZR_GetActiveClass");
MarkNativeAsOptional("ZR_SelectClientClass");
MarkNativeAsOptional("ZR_GetClassByName");
MarkNativeAsOptional("ZR_GetClassDisplayName");
MarkNativeAsOptional("ZR_IsClientZombie");
MarkNativeAsOptional("ZR_IsClientHuman");
MarkNativeAsOptional("ZR_InfectClient");
MarkNativeAsOptional("ZR_HumanClient");
MarkNativeAsOptional("ZR_RespawnClient");
MarkNativeAsOptional("ZR_SetKilledByWorld");
MarkNativeAsOptional("ZR_GetKilledByWorld");
}
#endif

View File

@ -54,7 +54,7 @@
#undef REQUIRE_PLUGIN #undef REQUIRE_PLUGIN
#include <nativevotes> #include <nativevotes>
#define MCE_VERSION "1.10.2" #define MCE_VERSION "1.11.0"
#define NV "nativevotes" #define NV "nativevotes"
@ -2161,6 +2161,11 @@ public Native_ExcludeMap(Handle:plugin, numParams)
PushArrayString(g_OldMapList, map); PushArrayString(g_OldMapList, map);
if (GetArraySize(g_OldMapList) > GetConVarInt(g_Cvar_ExcludeMaps))
{
RemoveFromArray(g_OldMapList, 0);
}
return true; return true;
} }

View File

@ -38,7 +38,7 @@
#include <colors> #include <colors>
#pragma semicolon 1 #pragma semicolon 1
#define MCE_VERSION "1.10.0" #define MCE_VERSION "1.11.0"
public Plugin:myinfo = public Plugin:myinfo =
{ {
@ -98,6 +98,7 @@ public OnPluginStart()
RegConsoleCmd("sm_nomlist", Command_NominateList); RegConsoleCmd("sm_nomlist", Command_NominateList);
RegAdminCmd("sm_nominate_addmap", Command_Addmap, ADMFLAG_CHANGEMAP, "sm_nominate_addmap <mapname> - Forces a map to be on the next mapvote."); RegAdminCmd("sm_nominate_addmap", Command_Addmap, ADMFLAG_CHANGEMAP, "sm_nominate_addmap <mapname> - Forces a map to be on the next mapvote.");
RegAdminCmd("sm_nominate_removemap", Command_Removemap, ADMFLAG_CHANGEMAP, "sm_nominate_removemap <mapname> - Removes a map from Nominations.");
// BotoX // BotoX
RegAdminCmd("sm_nominate_exclude", Command_AddExclude, ADMFLAG_CHANGEMAP, "sm_nominate_exclude <mapname> - Forces a map to be inserted into the recently played maps. Effectively blocking the map from being nominated."); RegAdminCmd("sm_nominate_exclude", Command_AddExclude, ADMFLAG_CHANGEMAP, "sm_nominate_exclude <mapname> - Forces a map to be inserted into the recently played maps. Effectively blocking the map from being nominated.");
@ -220,6 +221,39 @@ public Action:Command_Addmap(client, args)
return Plugin_Handled; return Plugin_Handled;
} }
public Action:Command_Removemap(client, args)
{
if (args != 1)
{
CReplyToCommand(client, "[NE] Usage: sm_nominate_removemap <mapname>");
return Plugin_Handled;
}
decl String:mapname[PLATFORM_MAX_PATH];
GetCmdArg(1, mapname, sizeof(mapname));
// new status;
if (/*!GetTrieValue(g_mapTrie, mapname, status)*/!IsMapValid(mapname))
{
CReplyToCommand(client, "%t", "Map was not found", mapname);
return Plugin_Handled;
}
if (!RemoveNominationByMap(mapname))
{
CReplyToCommand(client, "This map isn't nominated.", mapname);
return Plugin_Handled;
}
CReplyToCommand(client, "Map '%s' removed from the nominations list.", mapname);
LogAction(client, -1, "\"%L\" removed map \"%s\" from nominations.", client, mapname);
PrintToChatAll("[NE] %N has removed %s from nominations", client, mapname);
return Plugin_Handled;
}
public Action:Command_AddExclude(client, args) public Action:Command_AddExclude(client, args)
{ {
if (args < 1) if (args < 1)
@ -296,7 +330,7 @@ public Action:Command_Nominate(client, args)
if (g_NominationDelay > GetTime()) if (g_NominationDelay > GetTime())
{ {
ReplyToCommand(client, "[NE] Nominations will be unlocked in %d seconds", g_NominationDelay - GetTime()); PrintToChat(client, "[NE] Nominations will be unlocked in %d seconds", g_NominationDelay - GetTime());
return Plugin_Handled; return Plugin_Handled;
} }
@ -308,7 +342,7 @@ public Action:Command_Nominate(client, args)
if (g_Player_NominationDelay[client] > GetTime()) if (g_Player_NominationDelay[client] > GetTime())
{ {
ReplyToCommand(client, "[NE] Please wait %d seconds before you can nominate again", g_Player_NominationDelay[client] - GetTime()); PrintToChat(client, "[NE] Please wait %d seconds before you can nominate again", g_Player_NominationDelay[client] - GetTime());
return Plugin_Handled; return Plugin_Handled;
} }
@ -318,7 +352,7 @@ public Action:Command_Nominate(client, args)
new status; new status;
if (!GetTrieValue(g_mapTrie, mapname, status)) if (!GetTrieValue(g_mapTrie, mapname, status))
{ {
CReplyToCommand(client, "%t", "Map was not found", mapname); CPrintToChat(client, "%t", "Map was not found", mapname);
return Plugin_Handled; return Plugin_Handled;
} }
@ -326,17 +360,17 @@ public Action:Command_Nominate(client, args)
{ {
if ((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT) if ((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT)
{ {
CReplyToCommand(client, "[NE] %t", "Can't Nominate Current Map"); CPrintToChat(client, "[NE] %t", "Can't Nominate Current Map");
} }
if ((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) if ((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
{ {
CReplyToCommand(client, "[NE] %t", "Map in Exclude List"); CPrintToChat(client, "[NE] %t", "Map in Exclude List");
} }
if ((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED) if ((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
{ {
CReplyToCommand(client, "[NE] %t", "Map Already Nominated"); CPrintToChat(client, "[NE] %t", "Map Already Nominated");
} }
return Plugin_Handled; return Plugin_Handled;
@ -348,11 +382,11 @@ public Action:Command_Nominate(client, args)
{ {
if (result == Nominate_AlreadyInVote) if (result == Nominate_AlreadyInVote)
{ {
CReplyToCommand(client, "[NE] %t", "Map Already In Vote", mapname); CPrintToChat(client, "[NE] %t", "Map Already In Vote", mapname);
} }
else if (result == Nominate_VoteFull) else if (result == Nominate_VoteFull)
{ {
CReplyToCommand(client, "[ME] %t", "Max Nominations"); CPrintToChat(client, "[ME] %t", "Max Nominations");
} }
return Plugin_Handled; return Plugin_Handled;
@ -384,7 +418,7 @@ public Action:Command_NominateList(client, args)
GetNominatedMapList(MapList); GetNominatedMapList(MapList);
if (!GetArraySize(MapList)) if (!GetArraySize(MapList))
{ {
CReplyToCommand(client, "[NE] No maps have been nominated."); CPrintToChat(client, "[NE] No maps have been nominated.");
return Plugin_Handled; return Plugin_Handled;
} }
@ -516,6 +550,13 @@ public Handler_MapSelectMenu(Handle:menu, MenuAction:action, param1, param2)
{ {
case MenuAction_Select: case MenuAction_Select:
{ {
if (g_Player_NominationDelay[param1] > GetTime())
{
PrintToChat(param1, "[NE] Please wait %d seconds before you can nominate again", g_Player_NominationDelay[param1] - GetTime());
DisplayMenuAtItem(menu, param1, GetMenuSelectionPosition(), MENU_TIME_FOREVER);
return 0;
}
decl String:map[PLATFORM_MAX_PATH], String:name[MAX_NAME_LENGTH]; decl String:map[PLATFORM_MAX_PATH], String:name[MAX_NAME_LENGTH];
GetMenuItem(menu, param2, map, sizeof(map)); GetMenuItem(menu, param2, map, sizeof(map));
@ -543,6 +584,7 @@ public Handler_MapSelectMenu(Handle:menu, MenuAction:action, param1, param2)
PrintToChatAll("[NE] %t", "Map Nomination Changed", name, map); PrintToChatAll("[NE] %t", "Map Nomination Changed", name, map);
LogMessage("%s nominated %s", name, map); LogMessage("%s nominated %s", name, map);
g_Player_NominationDelay[param1] = GetTime() + GetConVarInt(g_Cvar_NominateDelay);
} }
case MenuAction_DrawItem: case MenuAction_DrawItem:

View File

@ -42,7 +42,7 @@
#pragma semicolon 1 #pragma semicolon 1
#define MCE_VERSION "1.10.0" #define MCE_VERSION "1.11.0"
public Plugin:myinfo = public Plugin:myinfo =
{ {

View File

@ -3,12 +3,12 @@
"Vote Nextmap" "Vote Nextmap"
{ {
"en" "Vote for the next map!" "en" "Vote for the next map!"
} }
"Nextmap Voting Started" "Nextmap Voting Started"
{ {
"en" "Voting for next map has started." "en" "Voting for next map has started."
} }
"Nextmap Voting Finished" "Nextmap Voting Finished"
{ {
@ -21,7 +21,7 @@
"#format" "{1:i},{2:i}" "#format" "{1:i},{2:i}"
"en" "The current map has been extended. (Received {1}%% of {2} votes)" "en" "The current map has been extended. (Received {1}%% of {2} votes)"
} }
"Extend Map" "Extend Map"
{ {
"en" "Extend Current Map" "en" "Extend Current Map"
@ -41,7 +41,7 @@
"Changed Next Map" "Changed Next Map"
{ {
"#format" "{1:s}" "#format" "{1:s}"
"en" "Changed nextmap to \"{1}\"." "en" "Changed nextmap to \"{1}\"."
} }
"Runoff Vote Nextmap" "Runoff Vote Nextmap"