Dusting off some old code and seeing if I can get this working again
But I need a server willing to test
Code:
#include <amxmodx>
public client_putinserver(id) {
set_task(1.0,"assign_teams")
return PLUGIN_CONTINUE
}
public assign_teams(id){
new plist[32],pnum,team[32]
new i
get_players(plist,pnum)
for(i=0; i<pnum; i++)
{
get_user_team(plist[i],team,31)
if(team[0]=='U')
{
if(get_user_flags(plist[i])&ADMIN_IMMUNITY)
{
return PLUGIN_CONTINUE
}
server_print("Team: %s",team)
client_cmd(get_user_userid(plist[i]),"menuselect 5")
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
public block_teams(id){
new team[32]
get_user_team(id,team,31)
if(get_user_flags(id)&ADMIN_IMMUNITY)
{
return PLUGIN_CONTINUE
}
if(team[0]!='U')
{
client_cmd(id,"menuselect 10")
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public check_time(id) {
new plist[32],pnum
get_players(plist,pnum,"b")
new i
for(i=0; i<pnum; i++)
{
if(is_user_alive(get_user_userid(plist[i]))!=1)
{
if(get_user_flags(plist[i])&ADMIN_IMMUNITY)
{
return PLUGIN_CONTINUE
}else{
server_cmd("kick #%d ^"You failed to select a skin in time^"",plist[i])
}
}
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("Automatic Team Assign","0.2.2","FlyingMongoose")
register_event("ShowMenu","block_teams","b","4&Team_Select")
register_event("VGUIMenu","block_teams","b","1=2","1=26","1=27")
register_logevent("check_time",2,"0=World triggered","1=Round_Start")
return PLUGIN_CONTINUE
}
I've made a TINY change (I fixed format of one of my loops) lol. Anyone have any more suggestions?
I'm also thinking of basing this around the round time instead of round start, how can I recieve that variable to give that player that much time to select a skin?
Yay for necro-posting