Need help editing. Fairly new to coding, took reasoning from tutorials and other works.
Scenario: Player joins server, if the teams are 10T : 5CT, switch to T based on 2:1 ratio.
Switching teams it must be 13T : 5CT or else stay whichever team player is at.
Did I script this right to follow the scenario?
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <cstrike>
#define PLUGIN "Ratio Manager"
#define VERSION "1.1"
#define AUTHOR "T3A"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
}
enum CsTeams {
CS_TEAM_UNASSIGNED = 0,
CS_TEAM_T,
CS_TEAM_CT,
CS_TEAM_SPECTATOR,
};
stock get_new_team(iCvar)
{
switch(iCvar)
{
new iTeam;
new iTCount = g_iPlayers[TEAM_T];
new iCTCount = g_iPlayers[TEAM_CT];
if (iTCount /2 +2 < iCTcount)
{
return TEAM_T;
}
else
return iTeam;
}
}
stock get_switch_team(id)
{
new iTeam;
new iTCount = g_iPlayers[TEAM_T]
new iCTCount = g_iPlayers[TEAM_CT]
{
case TEAM_T: iTCount
case TEAM_CT: iCTCount
}
if (iTCount /2 +3 > iCTCount)
{
return iTeam
}
else
{
return TEAM_T
}
}