From f849747fd50e16fe0733d55b85184cf11543a5b3 Mon Sep 17 00:00:00 2001 From: TheGunter24 Date: Sun, 4 Sep 2022 17:08:10 +0200 Subject: [PATCH 1/5] add mappool --- cfg/sourcemod/pugsetup/all.txt | 1 + cfg/sourcemod/pugsetup/competitive.txt | 1 + cfg/sourcemod/pugsetup/fun.txt | 1 + scripting/pugsetup.sp | 14 ++++---- scripting/pugsetup/mapvote.sp | 46 ++++++++++++++++++++++++++ scripting/pugsetup/natives.sp | 2 +- 6 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 cfg/sourcemod/pugsetup/all.txt create mode 100644 cfg/sourcemod/pugsetup/competitive.txt create mode 100644 cfg/sourcemod/pugsetup/fun.txt diff --git a/cfg/sourcemod/pugsetup/all.txt b/cfg/sourcemod/pugsetup/all.txt new file mode 100644 index 00000000..ae11e0c1 --- /dev/null +++ b/cfg/sourcemod/pugsetup/all.txt @@ -0,0 +1 @@ +// add all maps on the server here \ No newline at end of file diff --git a/cfg/sourcemod/pugsetup/competitive.txt b/cfg/sourcemod/pugsetup/competitive.txt new file mode 100644 index 00000000..350ba220 --- /dev/null +++ b/cfg/sourcemod/pugsetup/competitive.txt @@ -0,0 +1 @@ +// add competitive maps here \ No newline at end of file diff --git a/cfg/sourcemod/pugsetup/fun.txt b/cfg/sourcemod/pugsetup/fun.txt new file mode 100644 index 00000000..f7081d43 --- /dev/null +++ b/cfg/sourcemod/pugsetup/fun.txt @@ -0,0 +1 @@ +// add fun maps for casual games here \ No newline at end of file diff --git a/scripting/pugsetup.sp b/scripting/pugsetup.sp index ce15befb..f6854247 100644 --- a/scripting/pugsetup.sp +++ b/scripting/pugsetup.sp @@ -12,7 +12,7 @@ #include #undef REQUIRE_PLUGIN -#include "include/updater.inc" +#include #define UPDATE_URL "http://dl.whiffcity.com/plugins/pugsetup/pugsetup.txt" #define ALIAS_LENGTH 64 @@ -269,7 +269,7 @@ public void OnPluginStart() { "sm_pugsetup_force_defaults", "0", "Whether the default setup options are forced as the setup options (note that admins can override them still)."); g_InstantRunoffVotingCvar = CreateConVar( - "sm_pugsetup_instant_runoff_voting", "1", + "sm_pugsetup_instant_runoff_voting", "0", "If set, map votes will run instant-runoff style where each client selects their top 3 maps in preference order."); g_KnifeConfigCvar = CreateConVar( "sm_pugsetup_knife_cfg", "sourcemod/pugsetup/knife.cfg", @@ -609,7 +609,7 @@ public Action Timer_CheckReady(Handle timer) { if (IsPlayer(g_capt1) && IsPlayer(g_capt2) && g_capt1 != g_capt2) { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyPick"); + "ReadyStatusAllReadyPick"); CreateTimer(1.0, StartPicking, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; } else { @@ -620,10 +620,10 @@ public Action Timer_CheckReady(Handle timer) { if (g_AutoLive) { PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReady"); + "ReadyStatusAllReady"); } else { PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyWaiting"); + "ReadyStatusAllReadyWaiting"); } ReadyToStart(); @@ -635,7 +635,7 @@ public Action Timer_CheckReady(Handle timer) { if (IsPlayer(g_capt1) && IsPlayer(g_capt2) && g_capt1 != g_capt2) { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyVeto"); + "ReadyStatusAllReadyVeto"); PugSetup_MessageToAll("%t", "VetoMessage"); CreateTimer(2.0, MapSetup, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; @@ -646,7 +646,7 @@ public Action Timer_CheckReady(Handle timer) { } else { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyVote"); + "ReadyStatusAllReadyVote"); PugSetup_MessageToAll("%t", "VoteMessage"); CreateTimer(2.0, MapSetup, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; diff --git a/scripting/pugsetup/mapvote.sp b/scripting/pugsetup/mapvote.sp index a5b01049..152aeaf4 100644 --- a/scripting/pugsetup/mapvote.sp +++ b/scripting/pugsetup/mapvote.sp @@ -1,9 +1,52 @@ #define RANDOM_MAP_VOTE "-1" // must be in invalid index for array indexing +char mapGroups[][] = { + "competitive.txt", "fun.txt", "all.txt" +}; + /** * Map voting functions */ public void CreateMapVote() { + StartMapVote2(); +} +static void StartMapVote2() { + Menu menu = new Menu(MapVoteHandler2); + menu.SetTitle("%T", "VoteMenuTitle", LANG_SERVER); + menu.ExitButton = false; + for (int i = 0; i < sizeof(mapGroups); i++) { + char text[64], id[4]; + Format(text, 64, mapGroups[i]); + Format(id, 4, "%i", i); + ReplaceString(text, 64, ".txt", "", false); + AddMenuItem(menu, id, text); + } + VoteMenuToAll(menu, g_MapVoteTimeCvar.IntValue); +} +public int MapVoteHandler2(Menu menu, MenuAction action, int param1, int param2) { + if (action == MenuAction_VoteEnd) { + int winner = GetMenuInt(menu, param1); + + ServerCommand("sm_pugsetup_maplist %s", mapGroups[winner]); + + char text[64]; + Format(text, 64, mapGroups[winner]); + ReplaceString(text, 64, ".txt", "", false); + + PrintCenterTextAll("Winner is %s", text); + + CreateTimer(0.5, Timer_Continue, _, TIMER_FLAG_NO_MAPCHANGE); + + } else if (action == MenuAction_End) { + CloseHandle(menu); + } + return 0; +} +public Action Timer_Continue(Handle timer) +{ + CreateMapVote2(); +} +public void CreateMapVote2() { if (g_ExcludedMaps.IntValue > 0 && g_MapList.Length > g_PastMaps.Length) { SetupMapVotePool(true); } else { @@ -22,6 +65,7 @@ public void CreateMapVote() { } static void StartMapVote() { + FillMapList(g_MapListCvar, g_MapVotePool); Menu menu = new Menu(MapVoteHandler); menu.SetTitle("%T", "VoteMenuTitle", LANG_SERVER); menu.ExitButton = false; @@ -39,6 +83,8 @@ static void StartMapVote() { } for (int i = 0; i < g_MapVotePool.Length; i++) { + char mapName[64]; + g_MapVotePool.GetString(i, mapName, sizeof(mapName)); AddMapIndexToMenu(menu, g_MapVotePool, i); } diff --git a/scripting/pugsetup/natives.sp b/scripting/pugsetup/natives.sp index aae8c666..0e3894ec 100644 --- a/scripting/pugsetup/natives.sp +++ b/scripting/pugsetup/natives.sp @@ -397,7 +397,7 @@ public int Native_HasPermissions(Handle plugin, int numParams) { return isAdmin; else if (p == Permission_Leader) return isLeader || isAdmin; - else if (p == Permission_Captains) + else if (p == Permission_Captains && UsingCaptains()) return isCapt || isLeader || isAdmin; else if (p == Permission_All) return true; From 395a1d8859c78f27e0f5de6a39dd97ab8c55efdb Mon Sep 17 00:00:00 2001 From: TheGunter24 Date: Sun, 4 Sep 2022 20:05:58 +0200 Subject: [PATCH 2/5] support for sm11 basicly https://github.com/splewis/csgo-pug-setup/pull/407/files & https://forums.alliedmods.net/showpost.php?p=2785634&postcount=829 is needed now --- scripting/pugsetup.sp | 22 +++++++++++++------- scripting/pugsetup/captainpickmenus.sp | 5 ++++- scripting/pugsetup/instantrunoffvote.sp | 1 + scripting/pugsetup/kniferounds.sp | 1 + scripting/pugsetup/leadermenus.sp | 3 +++ scripting/pugsetup/mapveto.sp | 2 ++ scripting/pugsetup/mapvote.sp | 1 + scripting/pugsetup/natives.sp | 27 +++++++++++++++++++++++-- scripting/pugsetup/setupmenus.sp | 6 ++++++ scripting/pugsetup/steamapi.sp | 6 ++++-- scripting/pugsetup_chatmoney.sp | 3 ++- scripting/pugsetup_damageprint.sp | 6 +++++- scripting/pugsetup_rwsbalancer.sp | 12 +++++++---- 13 files changed, 77 insertions(+), 18 deletions(-) diff --git a/scripting/pugsetup.sp b/scripting/pugsetup.sp index f6854247..d117f934 100644 --- a/scripting/pugsetup.sp +++ b/scripting/pugsetup.sp @@ -609,7 +609,7 @@ public Action Timer_CheckReady(Handle timer) { if (IsPlayer(g_capt1) && IsPlayer(g_capt2) && g_capt1 != g_capt2) { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyPick"); + "ReadyStatusAllReadyPick"); CreateTimer(1.0, StartPicking, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; } else { @@ -620,10 +620,10 @@ public Action Timer_CheckReady(Handle timer) { if (g_AutoLive) { PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReady"); + "ReadyStatusAllReady"); } else { PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyWaiting"); + "ReadyStatusAllReadyWaiting"); } ReadyToStart(); @@ -635,7 +635,7 @@ public Action Timer_CheckReady(Handle timer) { if (IsPlayer(g_capt1) && IsPlayer(g_capt2) && g_capt1 != g_capt2) { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyVeto"); + "ReadyStatusAllReadyVeto"); PugSetup_MessageToAll("%t", "VetoMessage"); CreateTimer(2.0, MapSetup, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; @@ -646,7 +646,7 @@ public Action Timer_CheckReady(Handle timer) { } else { g_LiveTimerRunning = false; PrintHintTextToAll("%t\n%t", "ReadyStatusPlayers", readyPlayers, totalPlayers, - "ReadyStatusAllReadyVote"); + "ReadyStatusAllReadyVote"); PugSetup_MessageToAll("%t", "VoteMessage"); CreateTimer(2.0, MapSetup, _, TIMER_FLAG_NO_MAPCHANGE); return Plugin_Stop; @@ -1196,6 +1196,7 @@ public int MatchEndHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } public Action Command_ForceEnd(int client, int args) { @@ -1603,10 +1604,12 @@ public Action Event_MatchOver(Event event, const char[] name, bool dontBroadcast /** Helper timer to delay starting warmup period after match is over by a little bit **/ public Action Timer_EndMatch(Handle timer) { EndMatch(false, false); + return Plugin_Continue; } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { CheckAutoSetup(); + return Plugin_Continue; } public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { @@ -1633,16 +1636,18 @@ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) PugSetup_MessageToAll("%t", "KnifeRoundWinner", teamString, stayCmd, swapCmd); } } + return Plugin_Continue; } public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast) { if (g_GameState != GameState_Warmup) - return; + return Plugin_Continue; int client = GetClientOfUserId(event.GetInt("userid")); if (IsPlayer(client) && OnActiveTeam(client) && g_WarmupMoneyOnSpawnCvar.IntValue != 0) { SetEntProp(client, Prop_Send, "m_iAccount", GetCvarIntSafe("mp_maxmoney")); } + return Plugin_Continue; } public Action Event_PlayerConnect(Event event, const char[] name, bool dontBroadcast) { @@ -1650,6 +1655,7 @@ public Action Event_PlayerConnect(Event event, const char[] name, bool dontBroad int client = GetClientOfUserId(userid); g_Teams[client] = CS_TEAM_NONE; g_PlayerAtStart[client] = false; + return Plugin_Continue; } public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) { @@ -1661,6 +1667,7 @@ public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBr g_capt1 = -1; if (g_capt2 == client) g_capt2 = -1; + return Plugin_Continue; } /** @@ -1874,6 +1881,7 @@ public Action Timer_BeginMatch(Handle timer) { ChangeState(GameState_GoingLive); CreateTimer(3.0, BeginLO3, _, TIMER_FLAG_NO_MAPCHANGE); } + return Plugin_Continue; } public void ScrambleTeams() { @@ -2236,4 +2244,4 @@ stock bool PermissionFromString(const char[] permissionString, Permission& p, } return true; -} +} \ No newline at end of file diff --git a/scripting/pugsetup/captainpickmenus.sp b/scripting/pugsetup/captainpickmenus.sp index efcd1807..fa6bca25 100644 --- a/scripting/pugsetup/captainpickmenus.sp +++ b/scripting/pugsetup/captainpickmenus.sp @@ -46,6 +46,7 @@ public int InitialChoiceHandler(Menu menu, MenuAction action, int param1, int pa } else if (action == MenuAction_End) { delete menu; } + return 1; } public void SideMenu(int client) { @@ -88,6 +89,7 @@ public int SideMenuHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } + return 1; } /** @@ -123,7 +125,7 @@ public Action GivePlayerSelectionMenu(Handle timer, int serial) { public int PlayerMenuHandler(Menu menu, MenuAction action, int param1, int param2) { if (g_GameState != GameState_PickingPlayers) - return; + return 0; if (action == MenuAction_Select) { int client = param1; @@ -155,6 +157,7 @@ public int PlayerMenuHandler(Menu menu, MenuAction action, int param1, int param } else if (action == MenuAction_End) { delete menu; } + return 1; } static void MoreMenuPicks(int client) { diff --git a/scripting/pugsetup/instantrunoffvote.sp b/scripting/pugsetup/instantrunoffvote.sp index ffeb8b14..f7c67186 100644 --- a/scripting/pugsetup/instantrunoffvote.sp +++ b/scripting/pugsetup/instantrunoffvote.sp @@ -186,6 +186,7 @@ static int CountMapsAlive(int& winner) { public Action Timer_CollectIRVResults(Handle timer) { CollectIRVResults(); + return Plugin_Continue; } public void CollectIRVResults() { diff --git a/scripting/pugsetup/kniferounds.sp b/scripting/pugsetup/kniferounds.sp index 8fde865a..8d174a5b 100644 --- a/scripting/pugsetup/kniferounds.sp +++ b/scripting/pugsetup/kniferounds.sp @@ -45,6 +45,7 @@ public Action Timer_AnnounceKnife(Handle timer) { public Action Timer_HandleKnifeDecisionVote(Handle timer) { HandleKnifeDecisionVote(true); + return Plugin_Continue; } static void HandleKnifeDecisionVote(bool timeExpired = false) { diff --git a/scripting/pugsetup/leadermenus.sp b/scripting/pugsetup/leadermenus.sp index 55e80382..333c8628 100644 --- a/scripting/pugsetup/leadermenus.sp +++ b/scripting/pugsetup/leadermenus.sp @@ -32,6 +32,7 @@ public int Captain1MenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } public void Captain2Menu(int client) { @@ -62,6 +63,7 @@ public int Captain2MenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } static int CountPotentialCaptains(int otherCaptain) { @@ -110,6 +112,7 @@ public int LeaderMenuHandler(Menu menu, MenuAction action, int param1, int param } else if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } static int AddAllPlayers(Menu menu) { diff --git a/scripting/pugsetup/mapveto.sp b/scripting/pugsetup/mapveto.sp index d910b608..49b921bf 100644 --- a/scripting/pugsetup/mapveto.sp +++ b/scripting/pugsetup/mapveto.sp @@ -71,6 +71,7 @@ public int VetoHandler(Menu menu, MenuAction action, int param1, int param2) { } else if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } static void VetoStatusDisplay(int client) { @@ -89,4 +90,5 @@ public int VetoStatusHandler(Menu menu, MenuAction action, int param1, int param if (action == MenuAction_End) { CloseHandle(menu); } + return 1; } diff --git a/scripting/pugsetup/mapvote.sp b/scripting/pugsetup/mapvote.sp index 152aeaf4..d86986a8 100644 --- a/scripting/pugsetup/mapvote.sp +++ b/scripting/pugsetup/mapvote.sp @@ -45,6 +45,7 @@ public int MapVoteHandler2(Menu menu, MenuAction action, int param1, int param2) public Action Timer_Continue(Handle timer) { CreateMapVote2(); + return Plugin_Handled; } public void CreateMapVote2() { if (g_ExcludedMaps.IntValue > 0 && g_MapList.Length > g_PastMaps.Length) { diff --git a/scripting/pugsetup/natives.sp b/scripting/pugsetup/natives.sp index 0e3894ec..bb770da8 100644 --- a/scripting/pugsetup/natives.sp +++ b/scripting/pugsetup/natives.sp @@ -75,6 +75,7 @@ public int Native_SetupGame(Handle plugin, int numParams) { } SetupFinished(); + return 1; } public int Native_GetSetupOptions(Handle plugin, int numParams) { @@ -88,6 +89,7 @@ public int Native_GetSetupOptions(Handle plugin, int numParams) { SetNativeCellRef(4, g_RecordGameOption); SetNativeCellRef(5, g_DoKnifeRound); SetNativeCellRef(6, g_AutoLive); + return 1; } public int Native_SetSetupOptions(Handle plugin, int numParams) { @@ -97,6 +99,7 @@ public int Native_SetSetupOptions(Handle plugin, int numParams) { g_RecordGameOption = GetNativeCell(4); g_DoKnifeRound = GetNativeCell(5); g_AutoLive = GetNativeCell(6); + return 1; } public int Native_ReadyPlayer(Handle plugin, int numParams) { @@ -218,6 +221,7 @@ public int Native_SetLeader(Handle plugin, int numParams) { PugSetup_MessageToAll("%t", "NewLeader", client); g_Leader = client; } + return 1; } public int Native_GetLeader(Handle plugin, int numParams) { @@ -277,6 +281,7 @@ public int Native_SetCaptain(Handle plugin, int numParams) { PugSetup_MessageToAll("%t", "CaptMessage", captainNumber, buffer); } } + return 1; } public int Native_GetCaptain(Handle plugin, int numParams) { @@ -294,7 +299,7 @@ public int Native_GetCaptain(Handle plugin, int numParams) { public int Native_Message(Handle plugin, int numParams) { int client = GetNativeCell(1); if (client != 0 && (!IsClientConnected(client) || !IsClientInGame(client))) - return; + return 0; char buffer[1024]; int bytesWritten = 0; @@ -317,6 +322,7 @@ public int Native_Message(Handle plugin, int numParams) { Colorize(finalMsg, sizeof(finalMsg)); PrintToChat(client, finalMsg); } + return 1; } public int Native_MessageToAll(Handle plugin, int numParams) { @@ -346,6 +352,7 @@ public int Native_MessageToAll(Handle plugin, int numParams) { PrintToConsole(i, finalMsg); } } + return 1; } public int Native_GetPugMaxPlayers(Handle plugin, int numParams) { @@ -426,6 +433,8 @@ public int Native_SetRandomCaptains(Handle plugin, int numParams) { if (IsPlayer(c2)) PugSetup_SetCaptain(2, c2, true); + + return 1; } public int Native_AddChatAlias(Handle plugin, int numParams) { @@ -445,6 +454,7 @@ public int Native_AddChatAlias(Handle plugin, int numParams) { g_ChatAliasesCommands.PushString(command); g_ChatAliasesModes.Push(mode); } + return 1; } public int Native_GiveSetupMenu(Handle plugin, int numParams) { @@ -459,12 +469,14 @@ public int Native_GiveSetupMenu(Handle plugin, int numParams) { } SetupMenu(client, displayOnly, menuPosition); + return 1; } public int Native_GiveMapChangeMenu(Handle plugin, int numParams) { int client = GetNativeCell(1); CHECK_CLIENT(client); ChangeMapMenu(client); + return 1; } public int Native_IsValidCommand(Handle plugin, int numParams) { @@ -501,7 +513,18 @@ public int Native_SetTeamBalancer(Handle plugin, int numParams) { bool override = GetNativeCell(2); if (!PugSetup_IsTeamBalancerAvaliable() || override) { g_BalancerFunctionPlugin = plugin; - g_BalancerFunction = view_as(GetNativeFunction(1)); + ArrayList players = new ArrayList(); + for (int i = 1; i <= MaxClients; i++) { + if (IsPlayer(i)) { + if (PugSetup_IsReady(i)) + players.Push(i); + } + } + Call_StartFunction(g_BalancerFunctionPlugin, g_BalancerFunction); + Call_PushCell(players); + Call_Finish(); + delete players; + return true; } return false; diff --git a/scripting/pugsetup/setupmenus.sp b/scripting/pugsetup/setupmenus.sp index 177d0f14..aa69f454 100644 --- a/scripting/pugsetup/setupmenus.sp +++ b/scripting/pugsetup/setupmenus.sp @@ -195,6 +195,7 @@ public int SetupMenuHandler(Menu menu, MenuAction action, int param1, int param2 } else if (action == MenuAction_End) { delete menu; } + return 1; } public void TeamTypeMenu(int client) { @@ -222,6 +223,7 @@ public int TeamTypeMenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { delete menu; } + return 1; } public void TeamSizeMenu(int client) { @@ -251,6 +253,7 @@ public int TeamSizeHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } + return 1; } /** @@ -279,6 +282,7 @@ public int MapTypeHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } + return 1; } public int DemoHandler(int client) { @@ -288,6 +292,7 @@ public int DemoHandler(int client) { g_RecordGameOption = false; } PugSetup_GiveSetupMenu(client); + return 1; } /** @@ -405,4 +410,5 @@ public int ChangeMapHandler(Menu menu, MenuAction action, int param1, int param2 } else if (action == MenuAction_End) { delete menu; } + return 1; } diff --git a/scripting/pugsetup/steamapi.sp b/scripting/pugsetup/steamapi.sp index 1d9cbb37..e81560fd 100644 --- a/scripting/pugsetup/steamapi.sp +++ b/scripting/pugsetup/steamapi.sp @@ -47,7 +47,7 @@ public int OnWorkshopInfoReceived(Handle request, bool failure, bool requestSucc LogError("Steamworks collection request failed, HTTP status code = %d", statusCode); AddWorkshopMapsToList(collectionId, list); // add backup maps that might already be cached delete pack; - return; + return 0; } int len = 0; @@ -65,6 +65,7 @@ public int OnWorkshopInfoReceived(Handle request, bool failure, bool requestSucc AddWorkshopMapsToList(collectionId, list); delete pack; delete kv; + return 1; } stock void WriteCollectionInfo(KeyValues kv, const char[] collectionId, ArrayList mapList) { @@ -216,7 +217,7 @@ public int OnMapInfoReceived(Handle request, bool failure, bool requestSuccessfu AddWorkshopMapsToList(collectionId, list); delete pack; delete mapIds; - return; + return 0; } int len = 0; @@ -239,6 +240,7 @@ public int OnMapInfoReceived(Handle request, bool failure, bool requestSuccessfu delete pack; delete mapIds; delete kv; + return 1; } public void WriteMapInfo(KeyValues kv, int index, const char[] mapId) { diff --git a/scripting/pugsetup_chatmoney.sp b/scripting/pugsetup_chatmoney.sp index b087f81f..4e70f61b 100644 --- a/scripting/pugsetup_chatmoney.sp +++ b/scripting/pugsetup_chatmoney.sp @@ -28,7 +28,7 @@ public void OnPluginStart() { public Action Event_Round_Start(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_hEnabled.IntValue == 0) - return; + return Plugin_Continue; ArrayList players = new ArrayList(); @@ -68,6 +68,7 @@ public Action Event_Round_Start(Event event, const char[] name, bool dontBroadca } delete players; + return Plugin_Continue; } public int SortMoneyFunction(int index1, int index2, Handle array, Handle hnd) { diff --git a/scripting/pugsetup_damageprint.sp b/scripting/pugsetup_damageprint.sp index 07fc17f0..20b5b8e6 100644 --- a/scripting/pugsetup_damageprint.sp +++ b/scripting/pugsetup_damageprint.sp @@ -138,13 +138,14 @@ public Action Command_Damage(int client, int args) { public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_hEnabled.IntValue == 0) - return; + return Plugin_Continue; for (int i = 1; i <= MaxClients; i++) { if (IsValidClient(i)) { PrintDamageInfo(i); } } + return Plugin_Continue; } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { @@ -155,6 +156,7 @@ public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcas g_GotKill[i][j] = false; } } + return Plugin_Continue; } public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadcast) { @@ -178,6 +180,7 @@ public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadca g_DamageDone[attacker][victim] += damage; g_DamageDoneHits[attacker][victim]++; } + return Plugin_Continue; } public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { @@ -189,4 +192,5 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca if (validAttacker && validVictim) { g_GotKill[attacker][victim] = true; } + return Plugin_Continue; } diff --git a/scripting/pugsetup_rwsbalancer.sp b/scripting/pugsetup_rwsbalancer.sp index 34987a5b..b3f71b0f 100644 --- a/scripting/pugsetup_rwsbalancer.sp +++ b/scripting/pugsetup_rwsbalancer.sp @@ -192,7 +192,7 @@ public void BalancerFunction(ArrayList players) { */ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return; + return Plugin_Continue; int victim = GetClientOfUserId(event.GetInt("userid")); int attacker = GetClientOfUserId(event.GetInt("attacker")); @@ -203,19 +203,21 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca if (validAttacker && validVictim && HelpfulAttack(attacker, victim)) { g_RoundPoints[attacker] += 100; } + return Plugin_Continue; } public Action Event_Bomb(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return; + return Plugin_Continue; int client = GetClientOfUserId(event.GetInt("userid")); g_RoundPoints[client] += 50; + return Plugin_Continue; } public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return; + return Plugin_Continue; int attacker = GetClientOfUserId(event.GetInt("attacker")); int victim = GetClientOfUserId(event.GetInt("userid")); @@ -226,6 +228,7 @@ public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadca int damage = event.GetInt("dmg_health"); g_RoundPoints[attacker] += damage; } + return Plugin_Continue; } public bool HelpfulAttack(int attacker, int victim) { @@ -242,7 +245,7 @@ public bool HelpfulAttack(int attacker, int victim) { */ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_RecordRWSCvar.IntValue == 0) - return; + return Plugin_Continue; int winner = event.GetInt("winner"); for (int i = 1; i <= MaxClients; i++) { @@ -257,6 +260,7 @@ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) g_RoundPoints[i] = 0; } } + return Plugin_Continue; } /** From 6eba6b9de6668f3422c1bb4eb3a67ec08cd9521c Mon Sep 17 00:00:00 2001 From: TheGunter24 Date: Sun, 4 Sep 2022 20:23:35 +0200 Subject: [PATCH 3/5] Update natives.sp forgot about comment https://github.com/splewis/csgo-pug-setup/pull/407#discussion_r922524168 --- scripting/pugsetup/natives.sp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripting/pugsetup/natives.sp b/scripting/pugsetup/natives.sp index bb770da8..380ea97d 100644 --- a/scripting/pugsetup/natives.sp +++ b/scripting/pugsetup/natives.sp @@ -513,7 +513,8 @@ public int Native_SetTeamBalancer(Handle plugin, int numParams) { bool override = GetNativeCell(2); if (!PugSetup_IsTeamBalancerAvaliable() || override) { g_BalancerFunctionPlugin = plugin; - ArrayList players = new ArrayList(); + //ArrayList players = new ArrayList(); + g_BalancerFunction = view_as(GetNativeFunction(1)); for (int i = 1; i <= MaxClients; i++) { if (IsPlayer(i)) { if (PugSetup_IsReady(i)) From 5ef9afbd87728351be84a0be3a98c59acd1d8086 Mon Sep 17 00:00:00 2001 From: TheGunter24 Date: Tue, 6 Sep 2022 20:10:56 +0200 Subject: [PATCH 4/5] add changes requested --- scripting/pugsetup.sp | 2 +- scripting/pugsetup/mapvote.sp | 18 +++++++++--------- scripting/pugsetup/natives.sp | 14 +------------- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/scripting/pugsetup.sp b/scripting/pugsetup.sp index d117f934..9169f920 100644 --- a/scripting/pugsetup.sp +++ b/scripting/pugsetup.sp @@ -12,7 +12,7 @@ #include #undef REQUIRE_PLUGIN -#include +#include "include/updater.inc" #define UPDATE_URL "http://dl.whiffcity.com/plugins/pugsetup/pugsetup.txt" #define ALIAS_LENGTH 64 diff --git a/scripting/pugsetup/mapvote.sp b/scripting/pugsetup/mapvote.sp index d86986a8..6903f529 100644 --- a/scripting/pugsetup/mapvote.sp +++ b/scripting/pugsetup/mapvote.sp @@ -1,17 +1,17 @@ #define RANDOM_MAP_VOTE "-1" // must be in invalid index for array indexing char mapGroups[][] = { - "competitive.txt", "fun.txt", "all.txt" + "competitive.txt", "fun.txt", "maps.txt" }; /** * Map voting functions */ public void CreateMapVote() { - StartMapVote2(); + StartMappoolVote(); } -static void StartMapVote2() { - Menu menu = new Menu(MapVoteHandler2); +static void StartMappoolVote() { + Menu menu = new Menu(MappoolVoteHandler); menu.SetTitle("%T", "VoteMenuTitle", LANG_SERVER); menu.ExitButton = false; for (int i = 0; i < sizeof(mapGroups); i++) { @@ -23,17 +23,17 @@ static void StartMapVote2() { } VoteMenuToAll(menu, g_MapVoteTimeCvar.IntValue); } -public int MapVoteHandler2(Menu menu, MenuAction action, int param1, int param2) { +public int MappoolVoteHandler(Menu menu, MenuAction action, int param1, int param2) { if (action == MenuAction_VoteEnd) { int winner = GetMenuInt(menu, param1); ServerCommand("sm_pugsetup_maplist %s", mapGroups[winner]); - char text[64]; + char text[PLATFORM_MAX_PATH]; Format(text, 64, mapGroups[winner]); ReplaceString(text, 64, ".txt", "", false); - PrintCenterTextAll("Winner is %s", text); + PrintCenterTextAll("%t","MapVoteWinnerHintText", text); CreateTimer(0.5, Timer_Continue, _, TIMER_FLAG_NO_MAPCHANGE); @@ -44,10 +44,10 @@ public int MapVoteHandler2(Menu menu, MenuAction action, int param1, int param2) } public Action Timer_Continue(Handle timer) { - CreateMapVote2(); + CreateMappoolVote(); return Plugin_Handled; } -public void CreateMapVote2() { +public void CreateMappoolVote() { if (g_ExcludedMaps.IntValue > 0 && g_MapList.Length > g_PastMaps.Length) { SetupMapVotePool(true); } else { diff --git a/scripting/pugsetup/natives.sp b/scripting/pugsetup/natives.sp index 380ea97d..29cc6116 100644 --- a/scripting/pugsetup/natives.sp +++ b/scripting/pugsetup/natives.sp @@ -404,7 +404,7 @@ public int Native_HasPermissions(Handle plugin, int numParams) { return isAdmin; else if (p == Permission_Leader) return isLeader || isAdmin; - else if (p == Permission_Captains && UsingCaptains()) + else if (p == Permission_Captains) return isCapt || isLeader || isAdmin; else if (p == Permission_All) return true; @@ -513,19 +513,7 @@ public int Native_SetTeamBalancer(Handle plugin, int numParams) { bool override = GetNativeCell(2); if (!PugSetup_IsTeamBalancerAvaliable() || override) { g_BalancerFunctionPlugin = plugin; - //ArrayList players = new ArrayList(); g_BalancerFunction = view_as(GetNativeFunction(1)); - for (int i = 1; i <= MaxClients; i++) { - if (IsPlayer(i)) { - if (PugSetup_IsReady(i)) - players.Push(i); - } - } - Call_StartFunction(g_BalancerFunctionPlugin, g_BalancerFunction); - Call_PushCell(players); - Call_Finish(); - delete players; - return true; } return false; From ad95ffbf5a8387c4040e42534cd89a0088a3b756 Mon Sep 17 00:00:00 2001 From: TheGunter24 Date: Tue, 6 Sep 2022 20:26:06 +0200 Subject: [PATCH 5/5] remove sm11 support as requested --- scripting/pugsetup.sp | 10 +--------- scripting/pugsetup/captainpickmenus.sp | 5 +---- scripting/pugsetup/instantrunoffvote.sp | 1 - scripting/pugsetup/kniferounds.sp | 1 - scripting/pugsetup/leadermenus.sp | 3 --- scripting/pugsetup/mapveto.sp | 2 -- scripting/pugsetup/mapvote.sp | 1 - scripting/pugsetup/natives.sp | 14 +------------- scripting/pugsetup/setupmenus.sp | 6 ------ scripting/pugsetup/steamapi.sp | 6 ++---- scripting/pugsetup_chatmoney.sp | 3 +-- scripting/pugsetup_damageprint.sp | 6 +----- scripting/pugsetup_rwsbalancer.sp | 12 ++++-------- 13 files changed, 11 insertions(+), 59 deletions(-) diff --git a/scripting/pugsetup.sp b/scripting/pugsetup.sp index 9169f920..7eedc3bd 100644 --- a/scripting/pugsetup.sp +++ b/scripting/pugsetup.sp @@ -1196,7 +1196,6 @@ public int MatchEndHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } public Action Command_ForceEnd(int client, int args) { @@ -1604,12 +1603,10 @@ public Action Event_MatchOver(Event event, const char[] name, bool dontBroadcast /** Helper timer to delay starting warmup period after match is over by a little bit **/ public Action Timer_EndMatch(Handle timer) { EndMatch(false, false); - return Plugin_Continue; } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { CheckAutoSetup(); - return Plugin_Continue; } public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { @@ -1636,18 +1633,16 @@ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) PugSetup_MessageToAll("%t", "KnifeRoundWinner", teamString, stayCmd, swapCmd); } } - return Plugin_Continue; } public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast) { if (g_GameState != GameState_Warmup) - return Plugin_Continue; + return; int client = GetClientOfUserId(event.GetInt("userid")); if (IsPlayer(client) && OnActiveTeam(client) && g_WarmupMoneyOnSpawnCvar.IntValue != 0) { SetEntProp(client, Prop_Send, "m_iAccount", GetCvarIntSafe("mp_maxmoney")); } - return Plugin_Continue; } public Action Event_PlayerConnect(Event event, const char[] name, bool dontBroadcast) { @@ -1655,7 +1650,6 @@ public Action Event_PlayerConnect(Event event, const char[] name, bool dontBroad int client = GetClientOfUserId(userid); g_Teams[client] = CS_TEAM_NONE; g_PlayerAtStart[client] = false; - return Plugin_Continue; } public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) { @@ -1667,7 +1661,6 @@ public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBr g_capt1 = -1; if (g_capt2 == client) g_capt2 = -1; - return Plugin_Continue; } /** @@ -1881,7 +1874,6 @@ public Action Timer_BeginMatch(Handle timer) { ChangeState(GameState_GoingLive); CreateTimer(3.0, BeginLO3, _, TIMER_FLAG_NO_MAPCHANGE); } - return Plugin_Continue; } public void ScrambleTeams() { diff --git a/scripting/pugsetup/captainpickmenus.sp b/scripting/pugsetup/captainpickmenus.sp index fa6bca25..efcd1807 100644 --- a/scripting/pugsetup/captainpickmenus.sp +++ b/scripting/pugsetup/captainpickmenus.sp @@ -46,7 +46,6 @@ public int InitialChoiceHandler(Menu menu, MenuAction action, int param1, int pa } else if (action == MenuAction_End) { delete menu; } - return 1; } public void SideMenu(int client) { @@ -89,7 +88,6 @@ public int SideMenuHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } - return 1; } /** @@ -125,7 +123,7 @@ public Action GivePlayerSelectionMenu(Handle timer, int serial) { public int PlayerMenuHandler(Menu menu, MenuAction action, int param1, int param2) { if (g_GameState != GameState_PickingPlayers) - return 0; + return; if (action == MenuAction_Select) { int client = param1; @@ -157,7 +155,6 @@ public int PlayerMenuHandler(Menu menu, MenuAction action, int param1, int param } else if (action == MenuAction_End) { delete menu; } - return 1; } static void MoreMenuPicks(int client) { diff --git a/scripting/pugsetup/instantrunoffvote.sp b/scripting/pugsetup/instantrunoffvote.sp index f7c67186..ffeb8b14 100644 --- a/scripting/pugsetup/instantrunoffvote.sp +++ b/scripting/pugsetup/instantrunoffvote.sp @@ -186,7 +186,6 @@ static int CountMapsAlive(int& winner) { public Action Timer_CollectIRVResults(Handle timer) { CollectIRVResults(); - return Plugin_Continue; } public void CollectIRVResults() { diff --git a/scripting/pugsetup/kniferounds.sp b/scripting/pugsetup/kniferounds.sp index 8d174a5b..8fde865a 100644 --- a/scripting/pugsetup/kniferounds.sp +++ b/scripting/pugsetup/kniferounds.sp @@ -45,7 +45,6 @@ public Action Timer_AnnounceKnife(Handle timer) { public Action Timer_HandleKnifeDecisionVote(Handle timer) { HandleKnifeDecisionVote(true); - return Plugin_Continue; } static void HandleKnifeDecisionVote(bool timeExpired = false) { diff --git a/scripting/pugsetup/leadermenus.sp b/scripting/pugsetup/leadermenus.sp index 333c8628..55e80382 100644 --- a/scripting/pugsetup/leadermenus.sp +++ b/scripting/pugsetup/leadermenus.sp @@ -32,7 +32,6 @@ public int Captain1MenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } public void Captain2Menu(int client) { @@ -63,7 +62,6 @@ public int Captain2MenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } static int CountPotentialCaptains(int otherCaptain) { @@ -112,7 +110,6 @@ public int LeaderMenuHandler(Menu menu, MenuAction action, int param1, int param } else if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } static int AddAllPlayers(Menu menu) { diff --git a/scripting/pugsetup/mapveto.sp b/scripting/pugsetup/mapveto.sp index 49b921bf..d910b608 100644 --- a/scripting/pugsetup/mapveto.sp +++ b/scripting/pugsetup/mapveto.sp @@ -71,7 +71,6 @@ public int VetoHandler(Menu menu, MenuAction action, int param1, int param2) { } else if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } static void VetoStatusDisplay(int client) { @@ -90,5 +89,4 @@ public int VetoStatusHandler(Menu menu, MenuAction action, int param1, int param if (action == MenuAction_End) { CloseHandle(menu); } - return 1; } diff --git a/scripting/pugsetup/mapvote.sp b/scripting/pugsetup/mapvote.sp index 6903f529..bbd31dd5 100644 --- a/scripting/pugsetup/mapvote.sp +++ b/scripting/pugsetup/mapvote.sp @@ -45,7 +45,6 @@ public int MappoolVoteHandler(Menu menu, MenuAction action, int param1, int para public Action Timer_Continue(Handle timer) { CreateMappoolVote(); - return Plugin_Handled; } public void CreateMappoolVote() { if (g_ExcludedMaps.IntValue > 0 && g_MapList.Length > g_PastMaps.Length) { diff --git a/scripting/pugsetup/natives.sp b/scripting/pugsetup/natives.sp index 29cc6116..aae8c666 100644 --- a/scripting/pugsetup/natives.sp +++ b/scripting/pugsetup/natives.sp @@ -75,7 +75,6 @@ public int Native_SetupGame(Handle plugin, int numParams) { } SetupFinished(); - return 1; } public int Native_GetSetupOptions(Handle plugin, int numParams) { @@ -89,7 +88,6 @@ public int Native_GetSetupOptions(Handle plugin, int numParams) { SetNativeCellRef(4, g_RecordGameOption); SetNativeCellRef(5, g_DoKnifeRound); SetNativeCellRef(6, g_AutoLive); - return 1; } public int Native_SetSetupOptions(Handle plugin, int numParams) { @@ -99,7 +97,6 @@ public int Native_SetSetupOptions(Handle plugin, int numParams) { g_RecordGameOption = GetNativeCell(4); g_DoKnifeRound = GetNativeCell(5); g_AutoLive = GetNativeCell(6); - return 1; } public int Native_ReadyPlayer(Handle plugin, int numParams) { @@ -221,7 +218,6 @@ public int Native_SetLeader(Handle plugin, int numParams) { PugSetup_MessageToAll("%t", "NewLeader", client); g_Leader = client; } - return 1; } public int Native_GetLeader(Handle plugin, int numParams) { @@ -281,7 +277,6 @@ public int Native_SetCaptain(Handle plugin, int numParams) { PugSetup_MessageToAll("%t", "CaptMessage", captainNumber, buffer); } } - return 1; } public int Native_GetCaptain(Handle plugin, int numParams) { @@ -299,7 +294,7 @@ public int Native_GetCaptain(Handle plugin, int numParams) { public int Native_Message(Handle plugin, int numParams) { int client = GetNativeCell(1); if (client != 0 && (!IsClientConnected(client) || !IsClientInGame(client))) - return 0; + return; char buffer[1024]; int bytesWritten = 0; @@ -322,7 +317,6 @@ public int Native_Message(Handle plugin, int numParams) { Colorize(finalMsg, sizeof(finalMsg)); PrintToChat(client, finalMsg); } - return 1; } public int Native_MessageToAll(Handle plugin, int numParams) { @@ -352,7 +346,6 @@ public int Native_MessageToAll(Handle plugin, int numParams) { PrintToConsole(i, finalMsg); } } - return 1; } public int Native_GetPugMaxPlayers(Handle plugin, int numParams) { @@ -433,8 +426,6 @@ public int Native_SetRandomCaptains(Handle plugin, int numParams) { if (IsPlayer(c2)) PugSetup_SetCaptain(2, c2, true); - - return 1; } public int Native_AddChatAlias(Handle plugin, int numParams) { @@ -454,7 +445,6 @@ public int Native_AddChatAlias(Handle plugin, int numParams) { g_ChatAliasesCommands.PushString(command); g_ChatAliasesModes.Push(mode); } - return 1; } public int Native_GiveSetupMenu(Handle plugin, int numParams) { @@ -469,14 +459,12 @@ public int Native_GiveSetupMenu(Handle plugin, int numParams) { } SetupMenu(client, displayOnly, menuPosition); - return 1; } public int Native_GiveMapChangeMenu(Handle plugin, int numParams) { int client = GetNativeCell(1); CHECK_CLIENT(client); ChangeMapMenu(client); - return 1; } public int Native_IsValidCommand(Handle plugin, int numParams) { diff --git a/scripting/pugsetup/setupmenus.sp b/scripting/pugsetup/setupmenus.sp index aa69f454..177d0f14 100644 --- a/scripting/pugsetup/setupmenus.sp +++ b/scripting/pugsetup/setupmenus.sp @@ -195,7 +195,6 @@ public int SetupMenuHandler(Menu menu, MenuAction action, int param1, int param2 } else if (action == MenuAction_End) { delete menu; } - return 1; } public void TeamTypeMenu(int client) { @@ -223,7 +222,6 @@ public int TeamTypeMenuHandler(Menu menu, MenuAction action, int param1, int par } else if (action == MenuAction_End) { delete menu; } - return 1; } public void TeamSizeMenu(int client) { @@ -253,7 +251,6 @@ public int TeamSizeHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } - return 1; } /** @@ -282,7 +279,6 @@ public int MapTypeHandler(Menu menu, MenuAction action, int param1, int param2) } else if (action == MenuAction_End) { delete menu; } - return 1; } public int DemoHandler(int client) { @@ -292,7 +288,6 @@ public int DemoHandler(int client) { g_RecordGameOption = false; } PugSetup_GiveSetupMenu(client); - return 1; } /** @@ -410,5 +405,4 @@ public int ChangeMapHandler(Menu menu, MenuAction action, int param1, int param2 } else if (action == MenuAction_End) { delete menu; } - return 1; } diff --git a/scripting/pugsetup/steamapi.sp b/scripting/pugsetup/steamapi.sp index e81560fd..1d9cbb37 100644 --- a/scripting/pugsetup/steamapi.sp +++ b/scripting/pugsetup/steamapi.sp @@ -47,7 +47,7 @@ public int OnWorkshopInfoReceived(Handle request, bool failure, bool requestSucc LogError("Steamworks collection request failed, HTTP status code = %d", statusCode); AddWorkshopMapsToList(collectionId, list); // add backup maps that might already be cached delete pack; - return 0; + return; } int len = 0; @@ -65,7 +65,6 @@ public int OnWorkshopInfoReceived(Handle request, bool failure, bool requestSucc AddWorkshopMapsToList(collectionId, list); delete pack; delete kv; - return 1; } stock void WriteCollectionInfo(KeyValues kv, const char[] collectionId, ArrayList mapList) { @@ -217,7 +216,7 @@ public int OnMapInfoReceived(Handle request, bool failure, bool requestSuccessfu AddWorkshopMapsToList(collectionId, list); delete pack; delete mapIds; - return 0; + return; } int len = 0; @@ -240,7 +239,6 @@ public int OnMapInfoReceived(Handle request, bool failure, bool requestSuccessfu delete pack; delete mapIds; delete kv; - return 1; } public void WriteMapInfo(KeyValues kv, int index, const char[] mapId) { diff --git a/scripting/pugsetup_chatmoney.sp b/scripting/pugsetup_chatmoney.sp index 4e70f61b..b087f81f 100644 --- a/scripting/pugsetup_chatmoney.sp +++ b/scripting/pugsetup_chatmoney.sp @@ -28,7 +28,7 @@ public void OnPluginStart() { public Action Event_Round_Start(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_hEnabled.IntValue == 0) - return Plugin_Continue; + return; ArrayList players = new ArrayList(); @@ -68,7 +68,6 @@ public Action Event_Round_Start(Event event, const char[] name, bool dontBroadca } delete players; - return Plugin_Continue; } public int SortMoneyFunction(int index1, int index2, Handle array, Handle hnd) { diff --git a/scripting/pugsetup_damageprint.sp b/scripting/pugsetup_damageprint.sp index 20b5b8e6..07fc17f0 100644 --- a/scripting/pugsetup_damageprint.sp +++ b/scripting/pugsetup_damageprint.sp @@ -138,14 +138,13 @@ public Action Command_Damage(int client, int args) { public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_hEnabled.IntValue == 0) - return Plugin_Continue; + return; for (int i = 1; i <= MaxClients; i++) { if (IsValidClient(i)) { PrintDamageInfo(i); } } - return Plugin_Continue; } public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast) { @@ -156,7 +155,6 @@ public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcas g_GotKill[i][j] = false; } } - return Plugin_Continue; } public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadcast) { @@ -180,7 +178,6 @@ public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadca g_DamageDone[attacker][victim] += damage; g_DamageDoneHits[attacker][victim]++; } - return Plugin_Continue; } public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { @@ -192,5 +189,4 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca if (validAttacker && validVictim) { g_GotKill[attacker][victim] = true; } - return Plugin_Continue; } diff --git a/scripting/pugsetup_rwsbalancer.sp b/scripting/pugsetup_rwsbalancer.sp index b3f71b0f..34987a5b 100644 --- a/scripting/pugsetup_rwsbalancer.sp +++ b/scripting/pugsetup_rwsbalancer.sp @@ -192,7 +192,7 @@ public void BalancerFunction(ArrayList players) { */ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return Plugin_Continue; + return; int victim = GetClientOfUserId(event.GetInt("userid")); int attacker = GetClientOfUserId(event.GetInt("attacker")); @@ -203,21 +203,19 @@ public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadca if (validAttacker && validVictim && HelpfulAttack(attacker, victim)) { g_RoundPoints[attacker] += 100; } - return Plugin_Continue; } public Action Event_Bomb(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return Plugin_Continue; + return; int client = GetClientOfUserId(event.GetInt("userid")); g_RoundPoints[client] += 50; - return Plugin_Continue; } public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive()) - return Plugin_Continue; + return; int attacker = GetClientOfUserId(event.GetInt("attacker")); int victim = GetClientOfUserId(event.GetInt("userid")); @@ -228,7 +226,6 @@ public Action Event_DamageDealt(Event event, const char[] name, bool dontBroadca int damage = event.GetInt("dmg_health"); g_RoundPoints[attacker] += damage; } - return Plugin_Continue; } public bool HelpfulAttack(int attacker, int victim) { @@ -245,7 +242,7 @@ public bool HelpfulAttack(int attacker, int victim) { */ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) { if (!PugSetup_IsMatchLive() || g_RecordRWSCvar.IntValue == 0) - return Plugin_Continue; + return; int winner = event.GetInt("winner"); for (int i = 1; i <= MaxClients; i++) { @@ -260,7 +257,6 @@ public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) g_RoundPoints[i] = 0; } } - return Plugin_Continue; } /**