#include <amxmodx>
#include <fakemeta>
#define fm_find_ent_by_class(%1,%2) engfunc(EngFunc_FindEntityByString, %1, "classname", %2)
new g_iFwdSpawn;
public plugin_init( )
{
unregister_forward( FM_Spawn, g_iFwdSpawn, 0 )
new ent = -1
while ((ent = fm_find_ent_by_class(ent, "func_buyzone")))
{
if (pev(ent, pev_team) == 1)
set_pev(ent, pev_team, 2)
else if (pev(ent, pev_team) == 2)
set_pev(ent, pev_team, 1)
}
}
public plugin_precache( )
g_iFwdSpawn = register_forward( FM_Spawn, "fwdSpawn_Pre" )
public fwdSpawn_Pre( ent )
{
if( !pev_valid( ent ) )
return FMRES_IGNORED;
new classname[32]
pev( ent, pev_classname, classname, sizeof classname - 1 )
if( equal( classname, "info_player_start" ) )
set_pev( ent, pev_classname, "info_player_deathmatch" )
else if( equal( classname, "info_player_deathmatch" ) )
set_pev( ent, pev_classname, "info_player_start" )
return FMRES_IGNORED;
}