Skip to content

Commit

Permalink
added toggle team switching
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Dec 10, 2023
1 parent e7f10fa commit 2332211
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion berobot_handler.sp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public void OnPluginStart()

RegAdminCmd("sm_me_boss", Command_Me_Boss, ADMFLAG_SLAY, "Checks if you are a boss");
RegAdminCmd("sm_random_robot", Command_SetRandomRobot, ADMFLAG_SLAY, "Checks if you are a boss");
RegAdminCmd("sm_toggle_team_switch", Command_ToggleTeamSwitch, ADMFLAG_SLAY, "Toggles allowing teamswitch");

RegConsoleCmd("sm_rtr", Command_RoboVote, "Votes to begin a mode");
RegConsoleCmd("sm_rocktherobot", Command_RoboVote, "Votes to begin a mode");
Expand Down Expand Up @@ -966,7 +967,6 @@ public any Native_GetRobotTeam(Handle plugin, int numParams)

void RobotTeamCheck(int client)
{
PrintToChatAll("Robot Check");
if(IsClientInGame(client))
{
int iTeam = GetClientTeam(client);
Expand Down Expand Up @@ -1039,6 +1039,31 @@ public Action Command_SetRandomRobot(int client, int args)

}

public Action Command_ToggleTeamSwitch(int client, int args)
{

g_cv_BlockTeamSwitch = !g_cv_BlockTeamSwitch;

if (g_cv_BlockTeamSwitch)
{
// Code to execute if g_cv_BlockTeamSwitch is now true
//g_cv_BlockTeamSwitch = false;
PrintToChat(client, "Team switching is now blocked.");

}
else
{
// Code to execute if g_cv_BlockTeamSwitch is now false
//g_cv_BlockTeamSwitch = true;
PrintToChat(client, "Team switching is now allowed.");
}

// Additional code if needed

return Plugin_Handled;

}


public Action Command_Me_Boss(int client, int args)
{
Expand Down

0 comments on commit 2332211

Please sign in to comment.