Hey.
I have this script, that bans players for 30 minutes, when they reach 70 kills.
What I need to add to it is:
1. Admin immunity (Admins with the
d flag)
2. Make it log the bans with AmxBans (I thought I did this, but they aren't logged.
I hope someone will help me.
Code:
#include <amxmodx>
public plugin_init()
{
// ..
register_plugin("Frag Ban", "1.0", "ShadowLeader")
register_event("ResetHUD", "newSpawn", "be")
register_cvar("frags_limit", "70")
register_cvar("frags_pct_chance", "10")
}
public newSpawn(id)
{
if ( get_user_flags(id)&ADMIN_BAN ) return PLUGIN_HANDLED
new maxplayers = get_maxplayers()
if( maxplayers >= 4 ) {
if( get_user_frags(id) >= get_cvar_num("frags_limit") ) {
new randNum = random_num(0, 100)
if ( get_cvar_num("frags_pct_chance") >= randNum ) {
server_cmd("banid 30 #%d", get_user_userid(id))
server_cmd("kick #%d ^"Server overflowed^"", get_user_userid(id))
}
}
}
return PLUGIN_HANDLED
}
__________________