i did some edits on ur plugin but i get errors when i try compile maybe u can check it?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "Auto Change Team"
#define VERSION "1.0"
#define AUTHOR "LostSkill"
new const START[] = "sound/tmreverse.mp3"
new const END[] = "sound/tmreversed.mp3"
new g_iRoundCount = 1
new g_iMaxPlayers
public plugin_precache()
{
precache_generic(START)
precache_generic(END)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "Event_HLTV_New_Round", "a", "1=0", "2=0")
register_logevent("Logevent_Round_End", 2, "1=Round_End")
register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
g_iMaxPlayers = get_maxplayers()
}
public Event_TextMsg_Restart()
{
g_iRoundCount = 0
}
public Event_HLTV_New_Round()
{
if( ++g_iRoundCount == 6 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 11 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 16 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 21 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 26 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 31 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 36 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 41 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 46 )
client_cmd(0, "mp3 play %s", END)
else if( ++g_iRoundCount == 51 )
client_cmd(0, "mp3 play %s", END)
}
public Logevent_Round_End()
{
if( g_iRoundCount != 5 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 10 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 15 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 20 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 25 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 30 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 35 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 40 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 45 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
else if( g_iRoundCount != 50 )
return
client_print(0, print_chat, "** Don't change team !!")
client_cmd(0, "mp3 play %s", START)
for(new id; id<=g_iMaxPlayers; id++)
{
if( !is_user_connected(id) || is_user_hltv(id) )
{
continue
}
switch( get_pdata_int(id, 114) )
{
case 1:set_pdata_int(id, 114, 2)
case 2:set_pdata_int(id, 114, 1)
}
}
}