PHP Code:
#include <amxmodx>
#include <fakemeta>
new const VERSION[] = "0.0.1"
const MAX_PLAYERS = 32
const XTRA_OFS_PLAYERS = 5
const OFFSET_TEAM = 114
const TEAM_T = 1
const TEAM_CT = 2
public plugin_init()
{
register_plugin("ZBB Swap Teams", VERSION, "Swap Team (LULZ)")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
}
public Logevent_Round_End()
{
new iPlayers[MAX_PLAYERS], iNum, id
get_players(iPlayers, iNum, "h")
for(new i; i<iNum; i++)
{
id = iPlayers[i]
switch( get_pdata_int(id, OFFSET_TEAM, XTRA_OFS_PLAYERS) )
{
case TEAM_T:
{
set_pdata_int(id, OFFSET_TEAM, TEAM_CT, XTRA_OFS_PLAYERS)
}
case TEAM_CT:
{
set_pdata_int(id, OFFSET_TEAM, TEAM_T, XTRA_OFS_PLAYERS)
}
}
}
}
That's what I've been using for the past 3 years for a certain mod.
__________________