
   /*AMXMOD script.
   * amx_warn by [Mmmm]mrX
   * visit [Mmmm] Counterstrike Clan at www.mmmmcs.com
   *
   * This is a variation of the default Slay command included with AMX.
   * Thanks to the AMX team for this great mod.
   *
   * Admin commands:
   *     amx_warn <authid, nick or #userid>
   *     warn <authid, nick or #userid>
   *
   *  Shows  a  MOTD  box  to  the player when they have been warned, and
   announces the warning to all.
   * Logs warnings to /addons/amx/warnings.log for easy reference.
   *  Requires  an /addons/amx/warning.txt file for the text displayed in
   the warning MOTD.
   */
   #include <amxmod>
   #include <amxmisc>
   public admin_warn(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,0)
       if (!player) return PLUGIN_HANDLED
       client_cmd(0,"spk barney/ba_dontmake")
       show_motd(player,"/addons/amx/warning.txt","You      are     being
   warned!")
       new authid[16],name2[32],authid2[16],name[32]
       get_user_authid(id,authid,15)
       get_user_name(id,name,31)
       get_user_authid(player,authid2,15)
       get_user_name(player,name2,31)
       log_to_file("addons/amx/warnings.log","Cmd:       ^"%s<%d><%s><>^"
   warned ^"%s<%d><%s><>^"",
           name,get_user_userid(id),authid,
   name2,get_user_userid(player),authid2 )

       set_hudmessage(255, 0, 0, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
       show_hudmessage(0,"%s  has  been  warned  for  violating  a server
   rule",name2)
       console_print(id,"Client ^"%s^" warned",name2)

       return PLUGIN_HANDLED
   }
   public plugin_init() {
       register_plugin("Admin Warn","0.9.3","mrX")
       register_concmd("amx_warn","admin_warn",ADMIN_LEVEL_A,"<authid,
   nick or #userid>")
       register_concmd("warn","admin_warn",ADMIN_LEVEL_A,"<authid,   nick
   or #userid>")
       return PLUGIN_CONTINUE
   }
