diff --git a/AFKManager/scripting/AFKManager.sp b/AFKManager/scripting/AFKManager.sp index 7f135d68..73b6e2b9 100644 --- a/AFKManager/scripting/AFKManager.sp +++ b/AFKManager/scripting/AFKManager.sp @@ -309,7 +309,7 @@ public Action Timer_CheckPlayer(Handle Timer, any Data) for(client = 1; client <= MaxClients; client++) { - if(!g_Players_bEnabled[client]) + if(!g_Players_bEnabled[client] || !IsClientInGame(client)) continue; int iTeamNum = GetClientTeam(client); diff --git a/ExtraCommands/scripting/ExtraCommands.sp b/ExtraCommands/scripting/ExtraCommands.sp index dd991134..4316c2dc 100644 --- a/ExtraCommands/scripting/ExtraCommands.sp +++ b/ExtraCommands/scripting/ExtraCommands.sp @@ -44,7 +44,7 @@ public void OnPluginStart() RegAdminCmd("sm_strip", Command_Strip, ADMFLAG_GENERIC, "sm_strip <#userid|name>"); RegAdminCmd("sm_buyzone", Command_BuyZone, ADMFLAG_GENERIC, "sm_buyzone <#userid|name> <0|1>"); RegAdminCmd("sm_iammo", Command_InfAmmo, ADMFLAG_GENERIC, "sm_iammo <#userid|name> <0|1>"); - RegAdminCmd("sm_speed", Command_Speed, ADMFLAG_GENERIC, "sm_speed <#userid|name> <0|1>"); + RegAdminCmd("sm_speed", Command_Speed, ADMFLAG_GENERIC, "sm_speed <#userid|name> "); RegAdminCmd("sm_respawn", Command_Respawn, ADMFLAG_GENERIC, "sm_respawn <#userid|name>"); RegAdminCmd("sm_team", Command_Team, ADMFLAG_GENERIC, "sm_team <#userid|name> [alive]"); RegAdminCmd("sm_cash", Command_Cash, ADMFLAG_GENERIC, "sm_cash <#userid|name> "); @@ -761,7 +761,7 @@ public Action Command_Team(int client, int argc) int iTargetCount; bool bIsML; - if((iTargetCount = ProcessTargetString(sArgs, client, iTargets, MAXPLAYERS, COMMAND_FILTER_ALIVE, sTargetName, sizeof(sTargetName), bIsML)) <= 0) + if((iTargetCount = ProcessTargetString(sArgs, client, iTargets, MAXPLAYERS, 0, sTargetName, sizeof(sTargetName), bIsML)) <= 0) { ReplyToTargetError(client, iTargetCount); return Plugin_Handled; diff --git a/FixGameUI/gamedata/FixGameUI.games.txt b/FixGameUI/gamedata/FixGameUI.games.txt deleted file mode 100644 index 0952ab11..00000000 --- a/FixGameUI/gamedata/FixGameUI.games.txt +++ /dev/null @@ -1,50 +0,0 @@ -"Games" -{ - "#default" - { - "#supported" - { - "game" "cstrike" - "game" "tf" - "game" "dod" - "game" "hl2mp" - "engine" "sdk2013" - } - - "Offsets" - { - "AcceptInput" - { - "windows" "36" - "linux" "37" - "mac" "37" - } - } - } - - "csgo" - { - "Offsets" - { - "AcceptInput" - { - "windows" "40" - "linux" "41" - "mac" "41" - } - } - } - - "left4dead2" - { - "Offsets" - { - "AcceptInput" - { - "windows" "43" - "linux" "44" - "mac" "44" - } - } - } -} diff --git a/FixGameUI/scripting/FixGameUI.sp b/FixGameUI/scripting/FixGameUI.sp index 0365d981..4170454f 100644 --- a/FixGameUI/scripting/FixGameUI.sp +++ b/FixGameUI/scripting/FixGameUI.sp @@ -27,10 +27,11 @@ public OnPluginStart() HookEntityOutput("game_ui", "PlayerOff", GameUI_PlayerOff); // Gamedata. - new Handle:hConfig = LoadGameConfigFile("FixGameUI.games"); + Handle hConfig = LoadGameConfigFile("sdktools.games"); if (hConfig == INVALID_HANDLE) { - SetFailState("Could not find gamedata file: FixGameUI.games.txt"); + SetFailState("Couldn't load sdktools game config!"); + return; } new offset = GameConfGetOffset(hConfig, "AcceptInput"); diff --git a/GlowColors/scripting/GlowColors.sp b/GlowColors/scripting/GlowColors.sp index 5bbb3d5c..b6858d22 100644 --- a/GlowColors/scripting/GlowColors.sp +++ b/GlowColors/scripting/GlowColors.sp @@ -233,10 +233,8 @@ public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams) { // Should not happen? if(DHookIsNullParam(hParams, 2)) - { - LogError("AcceptInput pActivator = NULL"); return MRES_Ignored; - } + int client = DHookGetParam(hParams, 2); char szInputName[32]; diff --git a/PointServerCommandFilter/gamedata/PointServerCommandFilter.games.txt b/PointServerCommandFilter/gamedata/PointServerCommandFilter.games.txt deleted file mode 100644 index 39f137aa..00000000 --- a/PointServerCommandFilter/gamedata/PointServerCommandFilter.games.txt +++ /dev/null @@ -1,14 +0,0 @@ -"Games" -{ - "cstrike" - { - "Offsets" - { - "AcceptInput" - { - "windows" "36" - "linux" "37" - } - } - } -} \ No newline at end of file diff --git a/PointServerCommandFilter/scripting/PointServerCommandFilter.sp b/PointServerCommandFilter/scripting/PointServerCommandFilter.sp index 7b30c328..ee86bdeb 100644 --- a/PointServerCommandFilter/scripting/PointServerCommandFilter.sp +++ b/PointServerCommandFilter/scripting/PointServerCommandFilter.sp @@ -50,10 +50,10 @@ public Plugin myinfo = public void OnPluginStart() { - Handle hGameConf = LoadGameConfigFile("PointServerCommandFilter.games"); + Handle hGameConf = LoadGameConfigFile("sdktools.games"); if(hGameConf == INVALID_HANDLE) { - SetFailState("Couldn't load PointServerCommandFilter.games game config!"); + SetFailState("Couldn't load sdktools game config!"); return; } diff --git a/Spectate/scripting/Spectate.sp b/Spectate/scripting/Spectate.sp index 264468ce..e7ab6d1e 100644 --- a/Spectate/scripting/Spectate.sp +++ b/Spectate/scripting/Spectate.sp @@ -4,6 +4,7 @@ #include #include #include +#include public Plugin myinfo = { @@ -63,6 +64,25 @@ public Action Command_Spectate(int client, int argc) return Plugin_Handled; } + if (IsPlayerAlive(client) && ZR_IsClientZombie(client)) + { + bool bOnlyZombie = true; + for (int i = 1; i <= MaxClients; i++) + { + if (i != client && IsClientInGame(i) && IsPlayerAlive(i) && ZR_IsClientZombie(i)) + { + bOnlyZombie = false; + break; + } + } + + if (bOnlyZombie) + { + PrintToChat(client, "[SM] Can not switch to spectate as the last zombie!"); + return Plugin_Handled; + } + } + if (!argc) { if (GetClientTeam(client) != CS_TEAM_SPECTATOR) diff --git a/compile.py b/compile.py index 057a52b4..fbd93357 100755 --- a/compile.py +++ b/compile.py @@ -3,6 +3,11 @@ import os import sys import subprocess +c_null = "\x1b[00;00m" +c_red = "\x1b[31;01m" +c_blue = "\x1b[34;01m" +c_green = "\x1b[32;01m" + SM_INCLUDES = "includes" SPCOMP = "./spcomp" @@ -13,11 +18,10 @@ if __name__ == "__main__": 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: + print('\n' + c_green + "# Compiling {0} ({1})".format(os.path.basename(File), Plugin) + c_null) if File.endswith(".sp"): SourcePath = os.path.join(Path, File) IncludePath = os.path.join(Path, "include") diff --git a/includes/basic.inc b/includes/basic.inc index 982dcbb3..deb286d2 100644 --- a/includes/basic.inc +++ b/includes/basic.inc @@ -38,6 +38,11 @@ methodmap Basic < StringMap return view_as(new StringMap()); } + public void Dispose(bool disposemembers=true) + { + delete this; + } + public int GetInt(const char[] membername, int defaultvalue=-1) { int value;