
   /***************************************************************************
   *  cal_modelchange.sma  Version 2.0            Date: 2003/01/25
   *  Author: Christopher Mobarek    CMobarek@calzinger.net
   *  Nick: Calzinger          AIM: XSOULHELLTEMPLAR
   *
   *
   *   Model Chnage
   *   By Calzinger
   *
   *     This plugin will allow you to change team models. This is useful if you want
   *     to  change  mod  themes  into  other  ideas. It can also be used against hackers
   *     if  you  precache  custom  downloaded  models where hacks cannot detect these
   *     custom models. It can also be used to change the theme (hostages vs vip).
   *     You may also use HL models by precaching them.
   *
   *     This has been tested with:
   *        - AMX 0.9.8
   *        - Vexd for Steam
   *        - Latest CS Steam Updates
   -        NOTE: This plugin WILL work with Steam.
   *
   *   Required modules:
   *    -  VEXD MODULE
   *
   *   Admin Commands:
   *    -  amx_model                      Changes  a  specified  client's model
   *          -  Usage:  amx_model <nick, #userid, authid, @CT/TERRORIST, or *> <precached modelname>
   *          - Example: amx_model Calzinger vip (this will make Cal into a VIP)
   *    -  amx_defaultmodel               Sets a specified client's model to default
   *          -   Usage:   amx_defaultmodel   <nick,   #userid,   authid, @CT/TERRORIST, or *>
   *          -  Example:  amx_defaultmodel  Calzinger  (this  will reset cal's model)
   *
   *   Changelog:
   *
   *   v2.0:
   *      - [ADDED] Reset Model Support
   *      - [FIXED] Steam support
   *   v1.0:
   *      - [ADDED] Precache support
   *      - [ADDED] * supports all clients
   *      - [CHANGED] Build was rewritten
   *      - [CHANGED] <nick, @team, or *> are written with one command
   *      - [REMOVED] amx_modelteam command
   *   v0.4:
   *      - [ADDED] Single client support (not fully tested)
   *      - [CHANGED] Usage was changed
   *   v0.3:
   *      - [FIXED] Hostage error at startup
   *   v0.2:
   *      - [FIXED] arctic model (misspelled)
   *   v0.1:
   *      - [CREATED]
   *
   *
   **********************************************************************
   ****/
   #include <amxmod>
   #include <amxmisc>
   #include <Vexd_Utilities>
   public admin_model(id,level,cid) {
      if (!cmd_access(id,level,cid,3)) {
         return   PLUGIN_HANDLED
      }
      new target[32];
      new model[32];
      read_argv(1,target,31);
      read_argv(2,model,31);
      new admin[32];
      get_user_name(id,admin,31);
      if (target[0]=='@') {
         new team[32], team_num;
         get_players(team,team_num,"ae",target[1]);
         if (!team_num) {
            console_print(id,"[AMX]  No  clients  found on provided team.
   (@CT or @TERRORIST)");
            return   PLUGIN_HANDLED
         }
         for (new i=0;i<team_num;i++) {
            CS_SetModel(team[i],model);
            client_print(0,print_chat,"AMX  Command:  %s  has  turned all
   %s's into %s.",admin,target[1],model);
         }
      }
      else if (target[0]=='*') {
         new all[32], all_num;
         get_players(all,all_num,"a");
         for (new i=0;i<all_num;i++) {
            CS_SetModel(all[i],model);
            client_print(0,print_chat,"AMX  Command:  %s  has  turned all
   clients into %s.",admin,model);
         }
      }
      else {
         new player = cmd_target(id,target,0);
         new name[32];
         get_user_name(player,name,31);
         if (!player) {
            return   PLUGIN_HANDLED
         }
         CS_SetModel(player,model);
         client_print(0,print_chat,"AMX  Command:  %s  has turned %s into
   %s.",admin,name,model);
      }
      return   PLUGIN_HANDLED
   }
   public admin_reset(id,level,cid) {
      if (!cmd_access(id,level,cid,2)) {
         return PLUGIN_HANDLED;
      }
      new target[32];

      read_argv(1,target,31);
      new admin[32];
      get_user_name(id,admin,31);
      if (target[0]=='@') {
         new team[32], team_num;
         get_players(team,team_num,"ae",target[1]);
         if (!team_num) {
            console_print(id,"[AMX]  No  clients  found on provided team.
   (@CT or @TERRORIST)");
        return PLUGIN_HANDLED
         }
         for (new x=0;x<=team_num;x=x+1) {
            CS_ClearModel(team[x]);
         client_print(0,print_chat,"AMX  Command:  %s has turned all %s's
   back into their normal models.",admin,target[1]);
         }
      }
      else if (target[0]=='*') {
         new all[32], all_num;
         get_players(all,all_num,"a");
         for (new x=0; x<all_num;x++) {
            CS_ClearModel(all[x]);
        client_print(0,print_chat,"AMX Command: %s has turned all clients
   back into their normal models.",admin);
         }
      }
      else {
         new player = cmd_target(id,target,0);
         new name[32];
         get_user_name(player,name,31);
         if (!player) {
            return PLUGIN_HANDLED
         }
         CS_ClearModel(player);
         client_print(0,print_chat,"AMX  Command:  %s  has turned %s back
   into his default model.",admin,name);
      }
      return   PLUGIN_HANDLED
   }
   // Plugin Precache
   //-----------------------------------------------
   public plugin_precache() {
      //This is where you add models.
      //Use: precache_model("models/player/modelname/model.mdl")
      //If   having   trouble,   PM   me   or   send   me   an   Email  @
   CMobarek@calzinger.net
      return PLUGIN_CONTINUE
   }
   //-----------------------------------------------
   public plugin_init() {
      register_plugin("Model Change","2.0","Calzinger");
      register_concmd("amx_model","admin_model",ADMIN_KICK,"<       Nick,
   UniqueID, #userid, @TEAM, * (for all) > <name of model>");
      register_concmd("amx_defaultmodel","admin_reset",ADMIN_KICK,"<
   Nick, UniqueID, #userid, @TEAM, * (for all) >");
      return   PLUGIN_CONTINUE
   }
