Skip to content

Commit

Permalink
1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
MK99MA committed Apr 13, 2022
1 parent a3be16a commit baae86f
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [So]ccer [Mo]d [E]dit [-] [2019] (Current Version: 1.3.5 | Latest Tested Version: 1.3.3)
# [So]ccer [Mo]d [E]dit [-] [2019] (Current Version: 1.3.6 | Latest Tested Version: 1.3.5.1)

An edited Version of Marco Boogers SourceMod plugin aimed at Counter-Strike:Source soccer servers.
I merely edited and added stuff without any prior knowledge, so expect some heavily improvable code.
Expand Down
Binary file not shown.
Binary file modified addons/sourcemod/plugins/soccer_mod.smx
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/soccer_mod.sp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// **************************************************************************************************************
// ************************************************** DEFINES ***************************************************
// **************************************************************************************************************
#define PLUGIN_VERSION "1.3.5.1"
#define PLUGIN_VERSION "1.3.6"
#define UPDATE_URL "https://raw.githubusercontent.com/MK99MA/SoMoE-19/master/addons/sourcemod/updatefile.txt"
#define MAX_NAMES 10
#define MAXCONES_DYN 15
Expand Down
46 changes: 45 additions & 1 deletion addons/sourcemod/scripting/soccer_mod/client_commands.sp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,51 @@ public Action JoinlistCommand(int client, int args)

public Action SpecCommand(int client, int args)
{
CapPutAllToSpec(client);
if((CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC)) || IsSoccerAdmin(client, "cap") || (publicmode == 2) || (publicmode == 1))
{
if(args > 0)
{
char username[128];
GetCmdArg(1, username, sizeof(username));
TrimString(username);
StripQuotes(username);

if(StrEqual(username, "all"))
{
//Put all to spec
CapPutAllToSpec(client);
}
else if(StrEqual(username, "me"))
{
//Put user to spec
ChangeClientTeam(client, 1);
}
else
{
//Put target to spec
int iTarget = FindTarget(client, username, true, false);

if(iTarget == -1) return Plugin_Handled;

if (IsClientInGame(iTarget) && IsClientConnected(iTarget))
{
if (GetClientTeam(iTarget) != 1)
{
ChangeClientTeam(iTarget, 1);
}
else CPrintToChat(client, "{%s}[%s] {%s}Player is already in spectator", prefixcolor, prefix, textcolor);
}
else CPrintToChat(client, "{%s}[%s] {%s}Player is no longer on the server", prefixcolor, prefix, textcolor);
}
}
else
{
//Info
CPrintToChat(client, "{%s}[%s] {%s}Missing argument. Use '!spec all' to spec everyone or '!spec me' to spec yourself.", prefixcolor, prefix, textcolor);
CPrintToChat(client, "{%s}[%s] {%s}You can also provide the part of a username to spec your target (e.g. '!spec art').", prefixcolor, prefix, textcolor);
}
}
else CPrintToChat(client, "{%s}[%s] {%s}You are not allowed to use this command", prefixcolor, prefix, textcolor);

return Plugin_Handled;
}
Expand Down
2 changes: 0 additions & 2 deletions addons/sourcemod/scripting/soccer_mod/createconfig.sp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ public void CreateSoccerModConfig()

kvConfig.JumpToKey("Debug Settings", true);
kvConfig.SetNum("soccer_mod_debug", debuggingEnabled);
kvConfig.SetNum("soccer_mod_scoredebug", scoreDebuggingEnabled);
kvConfig.GoBack();

kvConfig.Rewind();
Expand Down Expand Up @@ -567,7 +566,6 @@ public void ReadFromConfig()

kvConfig.JumpToKey("Debug Settings", true);
debuggingEnabled = kvConfig.GetNum("soccer_mod_debug", 0);
scoreDebuggingEnabled = kvConfig.GetNum("soccer_mod_scoredebug", 0);
kvConfig.GoBack();

kvConfig.Rewind();
Expand Down
15 changes: 14 additions & 1 deletion addons/sourcemod/scripting/soccer_mod/globals.sp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ int djbenabled = 3;
int publicmode = 1;
int damageSounds = 0;
int debuggingEnabled = 0;
int scoreDebuggingEnabled = 0;
int phys_pushscale = 900;
int healthGodmode = 1;
int healthAmount = 250;
Expand Down Expand Up @@ -144,6 +143,11 @@ bool tempRule = false;
// FLOATS

// HANDLES
/*ArrayList gkArray = CreateArray(MAXPLAYERS+1);
ArrayList dfArray = CreateArray(MAXPLAYERS+1);
ArrayList mfArray = CreateArray(MAXPLAYERS+1);
ArrayList wgArray = CreateArray(MAXPLAYERS+1);
ArrayList nPArray = CreateArray(MAXPLAYERS+1);*/

// INTEGER
int capPicker = 0;
Expand Down Expand Up @@ -551,6 +555,9 @@ float statsPossessionCT = 0.0;
float statsPossessionT = 0.0;

// HANDLES
Handle h_STATS_TEXT_COOKIE = INVALID_HANDLE;
Handle h_STATS_MODE_COOKIE = INVALID_HANDLE;
Handle h_STATS_TOGGLE_COOKIE = INVALID_HANDLE;

// INTEGER
int statsAssisterClientid = 0;
Expand Down Expand Up @@ -580,6 +587,12 @@ int statsRoundsWonCT = 0;
int statsRoundsWonT = 0;
int statsRoundsLostCT = 0;
int statsRoundsLostT = 0;
int extChatSet[MAXPLAYERS+1] = {0, ...};
int extChatMode[MAXPLAYERS+1] = {0, ...};
int extChatPass[MAXPLAYERS+1] = {0, ...};
int extChatSave[MAXPLAYERS+1] = {0, ...};
int extChatLoss[MAXPLAYERS+1] = {0, ...};
//int extChatPoss[MAXPLAYERS+1] = {0, ...};

// STRINGS
char statsAssisterName[MAX_NAME_LENGTH] = "";
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/soccer_mod/menus.sp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public int MenuHandlerCommands(Menu menu, MenuAction action, int client, int cho
else if (StrEqual(menuItem, "pick")) CPrintToChat(client, "{%s}[%s] {%s}Opens the Soccer Mod cap picking menu", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "admin")) CPrintToChat(client, "{%s}[%s] {%s}Opens the Soccer Mod admin menu", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "cap")) CPrintToChat(client, "{%s}[%s] {%s}Opens the Soccer Mod cap match menu", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "spec")) CPrintToChat(client, "{%s}[%s] {%s}Move every player to spectator", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "spec")) CPrintToChat(client, "{%s}[%s] {%s}Move yourself('me'), your target or everyone('all') to spectator.", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "maprr")) CPrintToChat(client, "{%s}[%s] {%s}Reload the current map", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "match")) CPrintToChat(client, "{%s}[%s] {%s}Opens the Soccer Mod match menu", prefixcolor, prefix, textcolor);
else if (StrEqual(menuItem, "matchrr")) CPrintToChat(client, "{%s}[%s] {%s}Restart the match", prefixcolor, prefix, textcolor);
Expand Down
59 changes: 33 additions & 26 deletions addons/sourcemod/scripting/soccer_mod/modules/settings.sp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ public void OpenMenuSettings(int client)

menu.SetTitle("Soccer Mod - Admin - Settings");

char PubString[32];
char DebugString[32], PubString[32];
if(publicmode == 0) PubString = "Public Mode: Admins";
else if(publicmode == 1) PubString = "Public Mode: !Cap / !Match";
else if(publicmode == 2) PubString = "Public Mode: Free for All";

if(debuggingEnabled == 0) DebugString = "Debugging: OFF";
else if (debuggingEnabled == 1) DebugString = "Debugging: ON";
else if (debuggingEnabled == 2) DebugString = "Debugging: Score";

if(CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) menu.AddItem("adminset", "Manage Admins");
menu.AddItem("maps", "Allowed Maps");
Expand All @@ -22,6 +26,7 @@ public void OpenMenuSettings(int client)
if(CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) menu.AddItem("advtraining", "Training Settings");
if(CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC, true)) menu.AddItem("shoutplug", "Shout Control");
menu.AddItem("lockenabled", "Lock Settings");
menu.AddItem("debugging", DebugString);

menu.ExitBackButton = true;
menu.Display(client, MENU_TIME_FOREVER);
Expand All @@ -42,6 +47,25 @@ public int MenuHandlerSettings(Menu menu, MenuAction action, int client, int cho
else if (StrEqual(menuItem, "shoutplug")) OpenMenuShoutSet(client);
else if (StrEqual(menuItem, "mapsounds")) OpenMenuMapSounds(client);
else if (StrEqual(menuItem, "advtraining")) OpenMenuAdvTrainSet(client);
else if (StrEqual(menuItem, "debugging"))
{
if(debuggingEnabled == 0)
{
debuggingEnabled = 1;
UpdateConfigInt("Debug Settings", "soccer_mod_debug", debuggingEnabled);
}
else if(debuggingEnabled == 1)
{
debuggingEnabled = 2;
UpdateConfigInt("Debug Settings", "soccer_mod_debug", debuggingEnabled);
}
else if(debuggingEnabled == 2)
{
debuggingEnabled = 0;
UpdateConfigInt("Debug Settings", "soccer_mod_debug", debuggingEnabled);
}
OpenMenuSettings(client);
}
else if(StrEqual(menuItem, "lockenabled"))
{
if(!pwchange) OpenMenuLockSet(client);
Expand All @@ -51,9 +75,10 @@ public int MenuHandlerSettings(Menu menu, MenuAction action, int client, int cho
OpenMenuSettings(client);
}
}
else if(StrEqual(menuItem, "adminset")) if(CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) OpenMenuAdminSet(client);


else if(StrEqual(menuItem, "adminset"))
{
if(CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) OpenMenuAdminSet(client);
}
}
else if (action == MenuAction_Cancel && choice == -6) OpenMenuAdmin(client);
else if (action == MenuAction_End) menu.Close();
Expand All @@ -69,7 +94,7 @@ public void OpenMenuMiscSettings(int client)

menu.SetTitle("Soccer Mod - Admin - Settings - Misc");

char ReadyString[32], DamageString[32], DissolveString[32], DJString[32], JoinString[32], RankString[32], HostString[32], DefaultString[32], FeedString[32], GKString[32], RankModeString[32], CelebrateString[32], WallString[32], First12String[32]; //, DebugString[32];
char ReadyString[32], DamageString[32], DissolveString[32], DJString[32], JoinString[32], RankString[32], HostString[32], DefaultString[32], FeedString[32], GKString[32], RankModeString[32], CelebrateString[32], WallString[32], First12String[32];
if(matchReadyCheck == 0) ReadyString = "Ready Check: OFF";
else if (matchReadyCheck == 1) ReadyString = "Ready Check: AUTO";
else if (matchReadyCheck == 2) ReadyString = "Ready Check: ON USE";
Expand Down Expand Up @@ -115,9 +140,6 @@ public void OpenMenuMiscSettings(int client)
else if(first12Set == 1) First12String = "First 12 Rule: ON";
else if(first12Set == 2) First12String = "First 12 Rule: Pre-Cap Join";

/*if(debuggingEnabled == 0) DebugString = "Debugging: OFF";
else if (debuggingEnabled == 1) DebugString = "Debugging: ON";*/

Format(RankString, sizeof(RankString), "!rank Cooldown: %i", rankingCDTime);

menu.AddItem("classchoice", JoinString);
Expand All @@ -134,8 +156,7 @@ public void OpenMenuMiscSettings(int client)
menu.AddItem("gksaves", GKString);
menu.AddItem("rankmode", RankModeString);
menu.AddItem("celebrate", CelebrateString);
/*if (debuggingEnabled == 1 && CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) menu.AddItem("gk_areas", "Set gk areas");
if(CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) menu.AddItem("debugset", DebugString);*/
/*if (debuggingEnabled == 1 && CheckCommandAccess(client, "generic_admin", ADMFLAG_RCON, true)) menu.AddItem("gk_areas", "Set gk areas");*/

menu.ExitBackButton = true;
menu.Display(client, MENU_TIME_FOREVER);
Expand Down Expand Up @@ -360,27 +381,13 @@ public int MenuHandlerMiscSettings(Menu menu, MenuAction action, int client, int
}
OpenMenuMiscSettings(client);
}
/*else if(StrEqual(menuItem, "debugset"))
{
if(debuggingEnabled == 0)
{
debuggingEnabled = 1;
UpdateConfigInt("Debug Settings", "soccer_mod_debug", debuggingEnabled);
OpenMenuSettings(client);
}
else if(debuggingEnabled == 1)
{
debuggingEnabled = 0;
UpdateConfigInt("Debug Settings", "soccer_mod_debug", debuggingEnabled);
OpenMenuSettings(client);
}
}
else if(StrEqual(menuItem, "gk_areas")) OpenMenuGKAreas(client);*/
/*else if(StrEqual(menuItem, "gk_areas")) OpenMenuGKAreas(client);*/
}
else if (action == MenuAction_Cancel && choice == -6) OpenMenuSettings(client);
else if (action == MenuAction_End) menu.Close();
}


// *******************************************************************************************************************
// ************************************************** LOCKSET MENU ***************************************************
// *******************************************************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ public Action RegSprintCookie()
h_TIMER_COL_COOKIE = RegClientCookie(
"timer_col",
"Sprinttimer color", CookieAccess_Private);
//extended chat setting temp
h_STATS_TEXT_COOKIE = RegClientCookie(
"ext_chat",
"Stats text toggle", CookieAccess_Private);
h_STATS_MODE_COOKIE = RegClientCookie(
"ext_chatmode",
"Stats text mode", CookieAccess_Private);
h_STATS_TOGGLE_COOKIE = RegClientCookie(
"ext_chattoggles",
"Stats text settings", CookieAccess_Private);
return;
}

Expand All @@ -26,6 +36,7 @@ public Action ReadClientCookie(int client)
char sCookie_val[16];
char sTempArray[3][16];
char sTempArray2[2][16];
//char sTempArray3[4][16];

GetClientCookie(client, h_SPRINT_COOKIE, sCookie_val, sizeof(sCookie_val));
iP_SETTINGS[client] = StringToInt(sCookie_val) | PLAYER_INITIALIZED;
Expand All @@ -40,6 +51,20 @@ public Action ReadClientCookie(int client)
ExplodeString(sCookie_val, ";", sTempArray2, sizeof(sTempArray2), sizeof(sTempArray2[]));
x_val[client] = StringToFloat(sTempArray2[0]);
y_val[client] = StringToFloat(sTempArray2[1]);

//extended chat setting temp
GetClientCookie(client, h_STATS_TEXT_COOKIE, sCookie_val, sizeof(sCookie_val));
extChatSet[client] = StringToInt(sCookie_val);

GetClientCookie(client, h_STATS_MODE_COOKIE, sCookie_val, sizeof(sCookie_val));
extChatMode[client] = StringToInt(sCookie_val);

GetClientCookie(client, h_STATS_TOGGLE_COOKIE, sCookie_val, sizeof(sCookie_val));
ExplodeString(sCookie_val, ";", sTempArray, sizeof(sTempArray), sizeof(sTempArray[]));
extChatPass[client] = StringToInt(sTempArray[0]);
extChatSave[client] = StringToInt(sTempArray[1]);
extChatLoss[client] = StringToInt(sTempArray[2]);
//extChatPoss[client] = StringToInt(sTempArray3[3]);

if(iP_SETTINGS[client] < 2)
{
Expand Down Expand Up @@ -86,6 +111,17 @@ public Action WriteClientCookie(int client)
// Position Cookie
Format(sCookie_val, sizeof(sCookie_val), "%f;%f", x_val[client], y_val[client]);
SetClientCookie(client, h_TIMER_XY_COOKIE, sCookie_val);

//extended chat setting temp
Format(sCookie_val, sizeof(sCookie_val), "%i", extChatSet[client]);
SetClientCookie(client, h_STATS_TEXT_COOKIE, sCookie_val);

Format(sCookie_val, sizeof(sCookie_val), "%i", extChatMode[client]);
SetClientCookie(client, h_STATS_MODE_COOKIE, sCookie_val);

//Format(sCookie_val, sizeof(sCookie_val), "%i;%i;%i;%i", extChatPass[client], extChatSave[client], extChatLoss[client], extChatPoss[client]);
Format(sCookie_val, sizeof(sCookie_val), "%i;%i;%i", extChatPass[client], extChatSave[client], extChatLoss[client]);
SetClientCookie(client, h_STATS_TOGGLE_COOKIE, sCookie_val);
}
return;
}
Expand Down
Loading

0 comments on commit baae86f

Please sign in to comment.