
   /* AMX Mod script.
   *
   * This file is provided as is (no warranties).
   *
   */
   #include <amxmod>
   #include <amxmisc>
   new gag[33]
   public block_gaged(id){
       if(!gag[id]) return PLUGIN_CONTINUE
       new cmd[6]
       read_argv(0,cmd,4)
       if ( cmd[3] == '_' ){
           if (gag[id] & 2){
               client_print(id,print_notify,"* You are gagged...")
               return PLUGIN_HANDLED
           }
       }
       else if (gag[id] & 1)    {
           client_print(id,print_notify,"* You are gagged...")
           return PLUGIN_HANDLED
       }
       return PLUGIN_CONTINUE
   }
   public amx_gag(id,level,cid) {
       if (!cmd_access(id,level,cid,3))
           return PLUGIN_HANDLED
       new arg[32]
       read_argv(1,arg,31)
       new player = cmd_target(id,arg,1)
       if (!player) return PLUGIN_HANDLED
       new sflags[4]
       read_argv(2,sflags,3)
       new flags = read_flags(sflags)
       if (!flags) return PLUGIN_HANDLED
       gag[player] = flags
       new sgagtime[8]
       read_argv(3,sgagtime,7)
       new Float:gagtime = floatstr(sgagtime)
       new param[2]
       param[0] = player
       set_task( gagtime ? gagtime : 99999.0 ,"ungag",player,param,1)
       return PLUGIN_HANDLED
   }
   public ungag(param[]) {
       new id = param[0]
       gag[id] = 0
       remove_task(id)
       return PLUGIN_HANDLED
   }
   public amx_ungag(id,level,cid) {
       if (!cmd_access(id,level,cid,2))
           return PLUGIN_HANDLED
       new arg[32]
       read_argv(1,arg,31)
       new player = cmd_target(id,arg,1)
       if (!player) return PLUGIN_HANDLED
       new param[2]
       param[0] = player
       ungag(param)
       return PLUGIN_HANDLED
   }
   public client_disconnect(id) {
       new param[2]
       param[0] = id
       ungag(param)
       return PLUGIN_CONTINUE
   }
   public plugin_init() {
       register_plugin("Admin Gag","0.9","tcquest78")
       register_clcmd("say","block_gaged")
       register_clcmd("say_team","block_gaged")
       register_concmd("amx_gag","amx_gag",ADMIN_LEVEL_A,"<authid,   nick
   or #userid> <a|b> [time]")
       register_concmd("amx_ungag","amx_ungag",ADMIN_LEVEL_A,"<authid,
   nick or #userid>")
       return PLUGIN_CONTINUE
   }
