Raised This Month: $ Target: $400
 0% 

TFM Models Menu Help.....


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
djdeath
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 04:18   TFM Models Menu Help.....
Reply With Quote #1

Code:
  #include <amxmodx>
  #include <amxmisc>
  #include <tfcx>

  #define MENUTIME 30 // how long menus stay up

  // Key Defines (for ease of use and readability)
  #define KEY1 (1<<0)
  #define KEY2 (1<<1)
  #define KEY3 (1<<2)
  #define KEY4 (1<<3)
  #define KEY5 (1<<4)
  #define KEY6 (1<<5)
  #define KEY7 (1<<6)
  #define KEY8 (1<<7)
  #define KEY9 (1<<8)
  #define KEY0 (1<<9)

  // Temporary Menu Variables
  new page[33] = { 1, ...}, choices[33][9][33], target[33][33];

  // A user's assigned model
  new setmodel[33][33];

  // ------------------------------------------------------------------------------------------
  // --MENU DISPLAYS--------------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------

  // Here are all of our functions for displaying the menus themselves

  // --MENU 1 DISPLAY--------------------------------------------------------------------------
  public menu1Display(id) {

    // choose who to perform actions on

    new menubody[256];
    format(menubody,255,"\yChange Model For:^n^n");
  //  add(menubody,255,"\w1. Terrorists^n");
//    add(menubody,255,"\w2. Counter-Terrorists^n");
    add(menubody,255,"\w3. Specific Player^n");
    add(menubody,255,"\w4. All Players^n");
    add(menubody,255,"\w5. Yourself^n");
    add(menubody,255,"\w^n0. Exit");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY0,menubody,MENUTIME,"menu1");

    return PLUGIN_HANDLED;
  }
  // --Menu 7 DISPLAY-----Public Model Menu -------------------------------------------------------
public menu7Display(id){
    
    new menubody[256];
    format(menubody,255,"TFM Custom Model's^n^n");
    add(menubody,255,"\w1. Change Model^n");
    add(menubody,255,"\w2. Reset Model^n");
    add(menubody,255,"\w^n0. Exit");
  
    show_menu(id,KEY1|KEY2|KEY0,menubody,MENUTIME,"menu7");
  
    return PLUGIN_HANDLED;
}
  
  // --MENU 2 DISPLAY-----Specific PLAYER----------------------------------------------------------
  public menu2Display(id) {

    // our list of players

    // clear choices
    for(new n=0;n<9;n++) {
      choices[id][n] = "";
    }

    new menubody[256];
    format(menubody,255,"\yChange Model For (Specific Player, Page %d):^n^n",page[id]);

    // get players
    new players[32], num;
    get_players(players,num);

    // if too many for one page
    new loopamt = num-((page[id]-1)*8);
    if(num-((page[id]-1)*8) > 8) {
      loopamt = 8;
    }

    new offset = (page[id] * 8) - 8; // starting offset

    // loop through players
    for(new i=offset;i<loopamt+offset;i++) {

      // get name
      new username[33];
      get_user_name(players[i],username,32);

      // get user's team
      new team[5];
      if(get_user_team(players[i]) == 1) { team = "T"; }
      else if(get_user_team(players[i]) == 2) { team = "CT"; }
      else { team = "SPEC"; }

      // our string to add
      new string[256];
      format(string,255,"\w%d. %s (%s%s)^n",i+1-offset,username,team,is_user_admin(players[i]) ? ",@" : "");

      // get string value of player's id
      new idstr[33];
      num_to_str(players[i],idstr,32);

      // save player's id for easy access
      choices[id][i-offset] = idstr;

      // add it to menu
      add(menubody,255,string);
    }

    // if another page
    if(num-((page[id]-1)*8) > 8) {
      choices[id][8] = "Next";
      add(menubody,255,"\w^n9. Next");
    }

    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu2");

    return PLUGIN_HANDLED;
  }

  // --MENU 3 DISPLAY-----all players------------------------------------------------------
  public menu3Display(id) {

    // choose what model category to browse in

    new menubody[256];
    format(menubody,255,"\yChange Model To (Select A Category):^n^n");
//    add(menubody,255,"\w1. T Models^n");
//    add(menubody,255,"\w2. CT Models^n");
    add(menubody,255,"\w3. Custom Models^n");
    add(menubody,255,"\w4. Reset Models^n");
    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY0,menubody,MENUTIME,"menu3");

    return PLUGIN_HANDLED;
  }

  // --MENU 4 DISPLAY----CT AND T MODELS-------------------------------------------------------
  /*public menu4Display(id) {

    // terrorist model list

    new menubody[256];
    format(menubody,255,"\yChange Model To (T Models):^n^n");
    add(menubody,255,"\w1. Phoenix Connexion^n");
    add(menubody,255,"\w2. 1337 Krew^n");
    add(menubody,255,"\w3. Arctic Avengers^n");
    add(menubody,255,"\w4. Guerilla Warfare^n");
    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY0,menubody,MENUTIME,"menu4");

    return PLUGIN_HANDLED;
  }

  // --MENU 5 DISPLAY--------------------------------------------------------------------------
  public menu5Display(id) {

    // counter-terrorist model list

    new menubody[256];
    format(menubody,255,"\yChange Model To (CT Models):^n^n");
    add(menubody,255,"\w1. US Seal Team 6^n");
    add(menubody,255,"\w2. German GSG-9^n");
    add(menubody,255,"\w3. UK Special Air Service^n");
    add(menubody,255,"\w4. French GIGN^n");
    add(menubody,255,"\w5. VIP^n");
    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY0,menubody,MENUTIME,"menu5");

    return PLUGIN_HANDLED;
  }
*/
  // --MENU 6 DISPLAY CUSTOM MODELS-------------------------------------------------------------
  public menu6Display(id) {

    // our list of custom models

    // clear choices
    for(new i=0;i<9;i++) {
      choices[id][i] = "";
    }

    new menubody[256];
    format(menubody,255,"\yChange Model To (Custom Models, Page %d):^n^n",page[id]);

    // get custom models
    new models[32][33], num;
    num = get_models(models,32);

    // if too many for one page
    new loopamt = num-((page[id]-1)*8);
    if(num-((page[id]-1)*8) > 8) {
      loopamt = 8;
    }

    new offset = (page[id] * 8) - 8; // starting offset

    // loop through players
    for(new i=offset;i<loopamt+offset;i++) {

      // our string to add
      new string[256];
      format(string,255,"\w%d. %s^n",i+1-offset,models[i]);

      // save model's name for easy access
      choices[id][i-offset] = models[i];

      // add it to menu
      add(menubody,255,string);
    }

    // if another page
    if(num-((page[id]-1)*8) > 8) {
      choices[id][8] = "Next";
      add(menubody,255,"\w^n9. Next");
    }

    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu6");

    return PLUGIN_HANDLED;
  }
// --MENU 8 DISPLAY CUSTOM MODELS (USER)-------------------------------------------------------------
  public menu8Display(id) {

    // our list of custom models

    // clear choices
    for(new i=0;i<9;i++) {
      choices[id][i] = "";
    }

    new menubody[256];
    format(menubody,255,"\yChange Model To (Custom Models, Page %d):^n^n",page[id]);

    // get custom models
    new models[32][33], num;
    num = get_models(models,32);

    // if too many for one page
    new loopamt = num-((page[id]-1)*8);
    if(num-((page[id]-1)*8) > 8) {
      loopamt = 8;
    }

    new offset = (page[id] * 8) - 8; // starting offset

    // loop through players
    for(new i=offset;i<loopamt+offset;i++) {

      // our string to add
      new string[256];
      format(string,255,"\w%d. %s^n",i+1-offset,models[i]);

      // save model's name for easy access
      choices[id][i-offset] = models[i];

      // add it to menu
      add(menubody,255,string);
    }

    // if another page
    if(num-((page[id]-1)*8) > 8) {
      choices[id][8] = "Next";
      add(menubody,255,"\w^n9. Next");
    }

    add(menubody,255,"\w^n0. Back");

    show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu6");

    return PLUGIN_HANDLED;
  }
  
  // ------------------------------------------------------------------------------------------
  // --MENU ACTIONS---------------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------

  // This handles the actions of all of our menus

       //--Menu 7 Action --------------------------------------------------------------------------  
public menu7Action(id,key){

    // 1 Change Model
    if(key == 0){
         new idstr[33];
         num_to_str(id,idstr,32);
        target[id] = idstr;
    menu8Display(id);
        return 1;
    }
    // 2 Reset Model
    if(key == 1){
        modelActionb(id,target[id],".reset");
    }
    // 0 Being Exit
    // NO CODE TIME OUT TO BLANK SCREEN
    return 1;
}
  // --MENU 1 ACTION---------------------------------------------------------------------------
  public menu1Action(id,key) {

    // 1. Terrorist
    if(key == 0) {
      target[id] = "@T";
      menu3Display(id);
      return 1;
    }

    // 2. Counter-Terrorist
    if(key == 1) {
      target[id] = "@CT";
      menu3Display(id);
      return 1;
    }

    // 3. Specific Player
    if(key == 2) {
      menu2Display(id);
      return 1;
    }

    // 4. All Players
    if(key == 3) {
      target[id] = "*";
      menu3Display(id);
      return 1;
    }

    // 5. Yourself
    if(key == 4) {
      new idstr[33];
      num_to_str(id,idstr,32);
      target[id] = idstr;
      menu3Display(id);
      return 1;
    }

    // 0. Exit
    // Nothing happens and the menu closes

    return 1;
  }

  // --MENU 2 ACTION---------------------------------------------------------------------------
  public menu2Action(id,key) {

    // 0. Back
    if(key == 9 && page[id] == 1) {
      menu1Display(id);
      return 1;
    }
    else if(key == 9 && page[id] > 1) {
      page[id] -=1 ;
      menu2Display(id);
      return 1;
    }

    // if choice is blank
    if(equal(choices[id][key],"")) {
      menu2Display(id); // reset menu
      return 1;
    }

    // 1-8. Varies
    if(key < 8) {
      target[id] = choices[id][key];
      menu3Display(id);
      return 1;
    }

    // 9. Next
    if(key == 8 && equal(choices[id][key],"Next")) {
      page[id] += 1;
      menu2Display(id);
      return 1;
    }  

    return 1;
  }

  // --MENU 3 ACTION---------------------------------------------------------------------------
  public menu3Action(id,key) {

    // 1. T Models
/*    if(key == 0) {
      menu4Display(id);
      return 1;
    }

    // 2. CT Models
    if(key == 1) {
      menu5Display(id);
      return 1;
    }
*/
    // 3. Custom Models
    if(key == 2) {
      menu6Display(id);
      return 1;
    }

    // 4. Reset Models
    if(key == 3) {
      modelAction(id,target[id],".reset");
      return 1;
    }

    // 0. Back
    if(key == 9) {
      menu1Display(id);
      return 1;
    }   

    return 1;
  }

  // --MENU 4 ACTION---------------------------------------------------------------------------
  /*public menu4Action(id,key) {

    // 1. Phoenix Connexion
    if(key == 0) {
      modelAction(id,target[id],"terror");
      return 1;
    }

    // 2. 1337 Krew
    if(key == 1) {
      modelAction(id,target[id],"leet");
      return 1;
    }

    // 3. Arctic Avengers
    if(key == 2) {
      modelAction(id,target[id],"arctic");
      return 1;
    }

    // 4. Guerilla Warfare
    if(key == 3) {
      modelAction(id,target[id],"guerilla");
      return 1;
    }

    // 0. Back
    if(key == 9) {
      menu3Display(id);
      return 1;
    }

    return 1;
  }

  // --MENU 5 ACTION---------------------------------------------------------------------------
  public menu5Action(id,key) {

    // 6. Choose Random
    if(key == 5) {
      key = random_num(0,4);
    }

    // 1. US Seal Team 6
    if(key == 0) {
      modelAction(id,target[id],"urban");
      return 1;
    }

    // 2. German GSG-9
    if(key == 1) {
      modelAction(id,target[id],"gsg9");
      return 1;
    }

    // 3. UK Special Air Service
    if(key == 2) {
      modelAction(id,target[id],"sas");
      return 1;
    }

    // 4. French GIGN
    if(key == 3) {
      modelAction(id,target[id],"gign");
      return 1;
    }

    // 5. VIP
    if(key == 4) {
      modelAction(id,target[id],"vip");
      return 1;
    }

    // 0. Back
    if(key == 9) {
      menu3Display(id);
      return 1;
    }

    return 1;
  }
  */

  // --MENU 6 ACTION---------------------------------------------------------------------------
  public menu6Action(id,key) {

    // 0. Back
    if(key == 9 && page[id] == 1) {
      menu3Display(id);
      return 1;
    }
    else if(key == 9 && page[id] > 1) {
      page[id] -=1 ;
      menu6Display(id);
      return 1;
    }

    // if choice is blank
    if(equal(choices[id][key],"")) {
      menu6Display(id); // reset menu
      return 1;
    }

    // 1-8. Varies
    if(key < 8) {
      modelAction(id,target[id],choices[id][key]);
      return 1;
    }

    // 9. Next
    if(key == 8 && equal(choices[id][key],"Next")) {
      page[id] += 1;
      menu6Display(id);
      return 1;
    }

    return 1;
  }
  // --MENU 8 ACTION---------------------------------------------------------------------------
  public menu8Action(id,key) {

    // 0. Back
    if(key == 9 && page[id] == 1) {
      menu7Display(id);
      return 1;
    }
    else if(key == 9 && page[id] > 1) {
      page[id] -=1 ;
      menu8Display(id);
      return 1;
    }

    // if choice is blank
    if(equal(choices[id][key],"")) {
      menu6Display(id); // reset menu
      return 1;
    }

    // 1-8. Varies
    if(key < 8) {
      modelActionb(id,target[id],choices[id][key]);
      return 1;
    }

    // 9. Next
    if(key == 8 && equal(choices[id][key],"Next")) {
      page[id] += 1;
      menu8Display(id);
      return 1;
    }

    return 1;
  }

  // ------------------------------------------------------------------------------------------
  // --SET MODEL ACTION-----------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public modelAction(id,target[33],model[33]) {

    new username[33], authid[33];
    get_user_name(id,username,32);
    get_user_authid(id,authid,32);

    // if clearing models
    if(equal(model,".reset")) {

      // log the command
      log_amx("Cmd: ^"%s<%d><%s><>^" reset model for %s%s",username,get_user_userid(id),authid,isdigit(target[0]) ? "#" : "",target);

      // show activity
      switch(get_cvar_num("amx_show_activity")) {
        case 1: client_print(0,print_chat,"ADMIN: reset model for %s%s",isdigit(target[0]) ? "#" : "",target);
        case 2: client_print(0,print_chat,"ADMIN %s: reset model for %s%s",username,isdigit(target[0]) ? "#" : "",target);
      }

    }
    else { // if setting models

      // log the command
      log_amx("Cmd: ^"%s<%d><%s><>^" set model %s on %s%s",username,get_user_userid(id),authid,model,isdigit(target[0]) ? "#" : "",target);

      // show activity
      switch(get_cvar_num("amx_show_activity")) {
        case 1: client_print(0,print_chat,"ADMIN: set model %s on %s%s",model,isdigit(target[0]) ? "#" : "",target);
        case 2: client_print(0,print_chat,"ADMIN %s: set model %s on %s%s",username,model,isdigit(target[0]) ? "#" : "",target);
      }

    }

    new flags[2]//, team[33];

//    if(equal(target,"@T")) { // All Terrorists
//      flags = "e"; // team
//      team = "TERRORIST";
//    }
//    else if(equal(target,"@CT")) { // All Counter-Terrorists
//      flags = "e"; // team
//      team = "CT";
//    }
    if(isdigit(target[0])) { // Specific Player or Yourself
      flags = "f"; // name
      get_user_name(str_to_num(target),32);
    }

    // Otherwise this leaves us with nothing, which is All Players

    // get targets
    new players[32], num;
    get_players(players,num,flags);

    // loop through
    for(new i=0;i<num;i++) {
      new player = players[i]; // our player

      if(equal(model,".reset")) { // if reset
        tfc_setmodel(player);
        setmodel[player] = "";
      }
      else {
        tfc_setmodel(player,model);
        setmodel[player] = model;
      }
    }

    return 1;
  }
 // ------------------------------------------------------------------------------------------
  // --SET MODEL ACTION B---------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public modelActionb(id,target[33],model[33]) {

    new username[33];
    get_user_name(id,username,32);

    // if clearing models
    if(equal(model,".reset")) {

      // log the command

      // show activity
     
      client_print(0,print_chat,"%s: reset there model",username);
     } else  { // if setting models

      // log the command

      // show activity
         client_print(0,print_chat,"%s: set there model to %s",username,model);
      }

    
    
    
    new flags[2]//, team[33];

//    if(equal(target,"@T")) { // All Terrorists
//      flags = "e"; // team
//      team = "TERRORIST";
//    }
//    else if(equal(target,"@CT")) { // All Counter-Terrorists
//      flags = "e"; // team
//      team = "CT";
//    }
    if(isdigit(target[0])) { // Specific Player or Yourself
      flags = "f"; // name
      get_user_name(str_to_num(target),32);
    }

    // Otherwise this leaves us with nothing, which is All Players

    // get targets
    new players[32], num;
    get_players(players,num,flags);

    // loop through
    for(new i=0;i<num;i++) {
      new player = players[i]; // our player

      if(equal(model,".reset")) { // if reset
        tfc_setmodel(player);
        setmodel[player] = "";
      }
      else {
        tfc_setmodel(player,model);
        setmodel[player] = model;
      }
    }

    return 1;
  }

  // ------------------------------------------------------------------------------------------
  // --CUSTOM MODEL LIST----------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public get_models(array[32][],len) {

    // get a list of custom models

    new dirpos, output[64], outlen, filledamt;

    // go through custom models
    while((dirpos = read_dir("models/player",dirpos,output,255,outlen)) != 0) {

      if(containi(output,".") == -1) { // if not a file (but a directory)

        // check if model is actually there
        new modelfile[64];
        format(modelfile,63,"models/player/%s/%s.mdl",output,output);

        // if it exists
        if(file_exists(modelfile)) {
          format(array[filledamt],len,"%s",output);
          filledamt += 1;
        }

        // if we are out of array space now
        if(filledamt > 32) {
          return filledamt;
        }

      }

    }

    return filledamt;
  }

  // ------------------------------------------------------------------------------------------
  // --RESET MODEL ON RESPAWN-----------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public event_resethud(id) {

    if(!equal(setmodel[id],"")) {
      tfc_setmodel(id,setmodel[id]);
    }

  }

  // ------------------------------------------------------------------------------------------
  // --CONNECTION AND DISCONNECTION-----------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public client_connect(id) {
    page[id] = 1;
    setmodel[id] = "";
  }

  public client_disconnect(id) {
    page[id] = 1;
    setmodel[id] = "";
  }

  // ------------------------------------------------------------------------------------------
  // --PLUGIN PRECACHE------------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public plugin_precache() {

    // get custom models
    new models[32][33], num;
    num = get_models(models,32);

    // loop through them
    for(new i=0;i<num;i++) {
      new modelstring[64];
      format(modelstring,63,"models/player/%s/%s.mdl",models[i],models[i]);
      precache_model(modelstring);
    }

  }

  public currmodel(id) {
    client_print(id,print_chat,"Out in Next Release");
 return PLUGIN_HANDLED;
  }

  // ------------------------------------------------------------------------------------------
  // --PLUGIN ININITATION---------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public plugin_init() {
    register_plugin("TFM Model Menu","0.1","Watch Your Back");
    console_print(0,"* Loaded TFM Model Menu 0.1 by Watch Your Back *");

    register_clcmd("amx_tfmmodel","consoleCommand",ADMIN_BAN,"- brings up menu for custom user models");
    register_clcmd("say /setmodel","menu7Display");
    register_event("ResetHUD","event_resethud","b");

    //register_clcmd("say /currmodel","currmodel",-1);

    // Register Menu IDs
    new menu1ID = register_menuid("menu1");
    new menu2ID = register_menuid("menu2");
    new menu3ID = register_menuid("menu3");
    new menu4ID = register_menuid("menu4");
    new menu5ID = register_menuid("menu5");
    new menu6ID = register_menuid("menu6");
    new menu7ID = register_menuid("menu7");
    new menu8ID = register_menuid("menu8");

    // Register Menu Commands
    register_menucmd(menu1ID,1023,"menu1Action");
    register_menucmd(menu2ID,1023,"menu2Action");
    register_menucmd(menu3ID,1023,"menu3Action");
    register_menucmd(menu4ID,1023,"menu4Action");
    register_menucmd(menu5ID,1023,"menu5Action");
    register_menucmd(menu6ID,1023,"menu6Action");
    register_menucmd(menu7ID,1023, "menu7Action");
    register_menucmd(menu8ID,1023, "menu8Action");
  }

  // hook amx_csummz to check permissions
  public consoleCommand(id,level,cid) {

    if(!cmd_access(id,level,cid,1)) {
      return PLUGIN_HANDLED;
    }

    return menu1Display(id);
  }
This is what i have been working on.... I have been working on this over night... i took the code from CS User Model Menuz

Thanks : XxAvalanchexX

but i was porting it over to TFC so here is my debug log.. any help would be appreicated and will be sited in my coding and whatnot....

Thanks, DJDeath

Quote:
Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 301
Warning: Loose indentation on line 302
Warning: Loose indentation on line 303
Error: Argument type mismatch (argument 2) on line 633
Error: Number of arguments does not match definition on line 647
Error: Number of arguments does not match definition on line 651
Error: Argument type mismatch (argument 2) on line 697
Error: Undefined symbol "team" on line 704
Error: Number of arguments does not match definition on line 704
Error: Number of arguments does not match definition on line 711
Error: Number of arguments does not match definition on line 715
Error: Number of arguments does not match definition on line 765
Warning: Loose indentation on line 803

9 Errors.
Could not locate output file C:\Program Files\Valve\HLServer\tfc\tfc\addons\amxmodx\s cripting\compiled\csummz.amx (compile failed).
Attached Files
File Type: sma Get Plugin or Get Source (tfm_models.sma - 118 views - 22.4 KB)
djdeath is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 02-02-2007 , 04:35   Re: TFM Models Menu Help.....
Reply With Quote #2

First of all, the number of arguments didn't match because you didn't set the name to a variable. But after that, i don't see anywhere you would use it in that function. That's why i commented that part out.

Actually i just removed all errors, But you have to look at the tfc_set_model, because it has 3 arguments (index,model,skin). I've filled in skin as "", so that might be wrong ingame.

Here you go:

Code:
  #include <amxmodx>   #include <amxmisc>   #include <tfcx>   #define MENUTIME 30 // how long menus stay up   // Key Defines (for ease of use and readability)   #define KEY1 (1<<0)   #define KEY2 (1<<1)   #define KEY3 (1<<2)   #define KEY4 (1<<3)   #define KEY5 (1<<4)   #define KEY6 (1<<5)   #define KEY7 (1<<6)   #define KEY8 (1<<7)   #define KEY9 (1<<8)   #define KEY0 (1<<9)   // Temporary Menu Variables   new page[33] = { 1, ...}, choices[33][9][33], target[33][33];   // A user's assigned model   new setmodel[33][33];   // ------------------------------------------------------------------------------------------   // --MENU DISPLAYS--------------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   // Here are all of our functions for displaying the menus themselves   // --MENU 1 DISPLAY--------------------------------------------------------------------------   public menu1Display(id) {     // choose who to perform actions on     new menubody[256];     format(menubody,255,"\yChange Model For:^n^n");   //  add(menubody,255,"\w1. Terrorists^n"); //    add(menubody,255,"\w2. Counter-Terrorists^n");     add(menubody,255,"\w3. Specific Player^n");     add(menubody,255,"\w4. All Players^n");     add(menubody,255,"\w5. Yourself^n");     add(menubody,255,"\w^n0. Exit");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY0,menubody,MENUTIME,"menu1");     return PLUGIN_HANDLED;   }   // --Menu 7 DISPLAY-----Public Model Menu ------------------------------------------------------- public menu7Display(id){    new menubody[256];  format(menubody,255,"TFM Custom Model's^n^n");  add(menubody,255,"\w1. Change Model^n");  add(menubody,255,"\w2. Reset Model^n");  add(menubody,255,"\w^n0. Exit");    show_menu(id,KEY1|KEY2|KEY0,menubody,MENUTIME,"menu7");    return PLUGIN_HANDLED; }     // --MENU 2 DISPLAY-----Specific PLAYER----------------------------------------------------------   public menu2Display(id) {     // our list of players     // clear choices     for(new n=0;n<9;n++) {       choices[id][n] = "";     }     new menubody[256];     format(menubody,255,"\yChange Model For (Specific Player, Page %d):^n^n",page[id]);     // get players     new players[32], num;     get_players(players,num);     // if too many for one page     new loopamt = num-((page[id]-1)*8);     if(num-((page[id]-1)*8) > 8) {       loopamt = 8;     }     new offset = (page[id] * 8) - 8; // starting offset     // loop through players     for(new i=offset;i<loopamt+offset;i++) {       // get name       new username[33];       get_user_name(players[i],username,32);       // get user's team       new team[5];       if(get_user_team(players[i]) == 1) { team = "T"; }       else if(get_user_team(players[i]) == 2) { team = "CT"; }       else { team = "SPEC"; }       // our string to add       new string[256];       format(string,255,"\w%d. %s (%s%s)^n",i+1-offset,username,team,is_user_admin(players[i]) ? ",@" : "");       // get string value of player's id       new idstr[33];       num_to_str(players[i],idstr,32);       // save player's id for easy access       choices[id][i-offset] = idstr;       // add it to menu       add(menubody,255,string);     }     // if another page     if(num-((page[id]-1)*8) > 8) {       choices[id][8] = "Next";       add(menubody,255,"\w^n9. Next");     }     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu2");     return PLUGIN_HANDLED;   }   // --MENU 3 DISPLAY-----all players------------------------------------------------------   public menu3Display(id) {     // choose what model category to browse in     new menubody[256];     format(menubody,255,"\yChange Model To (Select A Category):^n^n"); //    add(menubody,255,"\w1. T Models^n"); //    add(menubody,255,"\w2. CT Models^n");     add(menubody,255,"\w3. Custom Models^n");     add(menubody,255,"\w4. Reset Models^n");     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY0,menubody,MENUTIME,"menu3");     return PLUGIN_HANDLED;   }   // --MENU 4 DISPLAY----CT AND T MODELS-------------------------------------------------------   /*public menu4Display(id) {     // terrorist model list     new menubody[256];     format(menubody,255,"\yChange Model To (T Models):^n^n");     add(menubody,255,"\w1. Phoenix Connexion^n");     add(menubody,255,"\w2. 1337 Krew^n");     add(menubody,255,"\w3. Arctic Avengers^n");     add(menubody,255,"\w4. Guerilla Warfare^n");     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY0,menubody,MENUTIME,"menu4");     return PLUGIN_HANDLED;   }   // --MENU 5 DISPLAY--------------------------------------------------------------------------   public menu5Display(id) {     // counter-terrorist model list     new menubody[256];     format(menubody,255,"\yChange Model To (CT Models):^n^n");     add(menubody,255,"\w1. US Seal Team 6^n");     add(menubody,255,"\w2. German GSG-9^n");     add(menubody,255,"\w3. UK Special Air Service^n");     add(menubody,255,"\w4. French GIGN^n");     add(menubody,255,"\w5. VIP^n");     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY0,menubody,MENUTIME,"menu5");     return PLUGIN_HANDLED;   } */   // --MENU 6 DISPLAY CUSTOM MODELS-------------------------------------------------------------   public menu6Display(id) {     // our list of custom models     // clear choices     for(new i=0;i<9;i++) {       choices[id][i] = "";     }     new menubody[256];     format(menubody,255,"\yChange Model To (Custom Models, Page %d):^n^n",page[id]);     // get custom models     new models[32][33], num;     num = get_models(models,32);     // if too many for one page     new loopamt = num-((page[id]-1)*8);     if(num-((page[id]-1)*8) > 8) {       loopamt = 8;     }     new offset = (page[id] * 8) - 8; // starting offset     // loop through players     for(new i=offset;i<loopamt+offset;i++) {       // our string to add       new string[256];       format(string,255,"\w%d. %s^n",i+1-offset,models[i]);       // save model's name for easy access       choices[id][i-offset] = models[i];       // add it to menu       add(menubody,255,string);     }     // if another page     if(num-((page[id]-1)*8) > 8) {       choices[id][8] = "Next";       add(menubody,255,"\w^n9. Next");     }     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu6");     return PLUGIN_HANDLED;   } // --MENU 8 DISPLAY CUSTOM MODELS (USER)-------------------------------------------------------------   public menu8Display(id) {     // our list of custom models     // clear choices     for(new i=0;i<9;i++) {       choices[id][i] = "";     }     new menubody[256];     format(menubody,255,"\yChange Model To (Custom Models, Page %d):^n^n",page[id]);     // get custom models     new models[32][33], num;     num = get_models(models,32);     // if too many for one page     new loopamt = num-((page[id]-1)*8);     if(num-((page[id]-1)*8) > 8) {       loopamt = 8;     }     new offset = (page[id] * 8) - 8; // starting offset     // loop through players     for(new i=offset;i<loopamt+offset;i++) {       // our string to add       new string[256];       format(string,255,"\w%d. %s^n",i+1-offset,models[i]);       // save model's name for easy access       choices[id][i-offset] = models[i];       // add it to menu       add(menubody,255,string);     }     // if another page     if(num-((page[id]-1)*8) > 8) {       choices[id][8] = "Next";       add(menubody,255,"\w^n9. Next");     }     add(menubody,255,"\w^n0. Back");     show_menu(id,KEY1|KEY2|KEY3|KEY4|KEY5|KEY6|KEY7|KEY8|KEY9|KEY0,menubody,MENUTIME,"menu6");     return PLUGIN_HANDLED;   }     // ------------------------------------------------------------------------------------------   // --MENU ACTIONS---------------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   // This handles the actions of all of our menus        //--Menu 7 Action --------------------------------------------------------------------------   public menu7Action(id,key){  // 1 Change Model  if(key == 0){    new idstr[33];    num_to_str(id,idstr,32);    target[id] = idstr;    menu8Display(id);    return 1;  }  // 2 Reset Model  if(key == 1){   modelActionb(id,target[id],".reset");  }  // 0 Being Exit  // NO CODE TIME OUT TO BLANK SCREEN  return 1; }   // --MENU 1 ACTION---------------------------------------------------------------------------   public menu1Action(id,key) {     // 1. Terrorist     if(key == 0) {       target[id] = "@T";       menu3Display(id);       return 1;     }     // 2. Counter-Terrorist     if(key == 1) {       target[id] = "@CT";       menu3Display(id);       return 1;     }     // 3. Specific Player     if(key == 2) {       menu2Display(id);       return 1;     }     // 4. All Players     if(key == 3) {       target[id] = "*";       menu3Display(id);       return 1;     }     // 5. Yourself     if(key == 4) {       new idstr[33];       num_to_str(id,idstr,32);       target[id] = idstr;       menu3Display(id);       return 1;     }     // 0. Exit     // Nothing happens and the menu closes     return 1;   }   // --MENU 2 ACTION---------------------------------------------------------------------------   public menu2Action(id,key) {     // 0. Back     if(key == 9 && page[id] == 1) {       menu1Display(id);       return 1;     }     else if(key == 9 && page[id] > 1) {       page[id] -=1 ;       menu2Display(id);       return 1;     }     // if choice is blank     if(equal(choices[id][key],"")) {       menu2Display(id); // reset menu       return 1;     }     // 1-8. Varies     if(key < 8) {       target[id] = choices[id][key];       menu3Display(id);       return 1;     }     // 9. Next     if(key == 8 && equal(choices[id][key],"Next")) {       page[id] += 1;       menu2Display(id);       return 1;     }       return 1;   }   // --MENU 3 ACTION---------------------------------------------------------------------------   public menu3Action(id,key) {     // 1. T Models /*    if(key == 0) {       menu4Display(id);       return 1;     }     // 2. CT Models     if(key == 1) {       menu5Display(id);       return 1;     } */     // 3. Custom Models     if(key == 2) {       menu6Display(id);       return 1;     }     // 4. Reset Models     if(key == 3) {       modelAction(id,target[id],".reset");       return 1;     }     // 0. Back     if(key == 9) {       menu1Display(id);       return 1;     }       return 1;   }   // --MENU 4 ACTION---------------------------------------------------------------------------   /*public menu4Action(id,key) {     // 1. Phoenix Connexion     if(key == 0) {       modelAction(id,target[id],"terror");       return 1;     }     // 2. 1337 Krew     if(key == 1) {       modelAction(id,target[id],"leet");       return 1;     }     // 3. Arctic Avengers     if(key == 2) {       modelAction(id,target[id],"arctic");       return 1;     }     // 4. Guerilla Warfare     if(key == 3) {       modelAction(id,target[id],"guerilla");       return 1;     }     // 0. Back     if(key == 9) {       menu3Display(id);       return 1;     }     return 1;   }   // --MENU 5 ACTION---------------------------------------------------------------------------   public menu5Action(id,key) {     // 6. Choose Random     if(key == 5) {       key = random_num(0,4);     }     // 1. US Seal Team 6     if(key == 0) {       modelAction(id,target[id],"urban");       return 1;     }     // 2. German GSG-9     if(key == 1) {       modelAction(id,target[id],"gsg9");       return 1;     }     // 3. UK Special Air Service     if(key == 2) {       modelAction(id,target[id],"sas");       return 1;     }     // 4. French GIGN     if(key == 3) {       modelAction(id,target[id],"gign");       return 1;     }     // 5. VIP     if(key == 4) {       modelAction(id,target[id],"vip");       return 1;     }     // 0. Back     if(key == 9) {       menu3Display(id);       return 1;     }     return 1;   }   */   // --MENU 6 ACTION---------------------------------------------------------------------------   public menu6Action(id,key) {     // 0. Back     if(key == 9 && page[id] == 1) {       menu3Display(id);       return 1;     }     else if(key == 9 && page[id] > 1) {       page[id] -=1 ;       menu6Display(id);       return 1;     }     // if choice is blank     if(equal(choices[id][key],"")) {       menu6Display(id); // reset menu       return 1;     }     // 1-8. Varies     if(key < 8) {       modelAction(id,target[id],choices[id][key]);       return 1;     }     // 9. Next     if(key == 8 && equal(choices[id][key],"Next")) {       page[id] += 1;       menu6Display(id);       return 1;     }     return 1;   }   // --MENU 8 ACTION---------------------------------------------------------------------------   public menu8Action(id,key) {     // 0. Back     if(key == 9 && page[id] == 1) {       menu7Display(id);       return 1;     }     else if(key == 9 && page[id] > 1) {       page[id] -=1 ;       menu8Display(id);       return 1;     }     // if choice is blank     if(equal(choices[id][key],"")) {       menu6Display(id); // reset menu       return 1;     }     // 1-8. Varies     if(key < 8) {       modelActionb(id,target[id],choices[id][key]);       return 1;     }     // 9. Next     if(key == 8 && equal(choices[id][key],"Next")) {       page[id] += 1;       menu8Display(id);       return 1;     }     return 1;   }   // ------------------------------------------------------------------------------------------   // --SET MODEL ACTION-----------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public modelAction(id,target[33],model[33]) {     new username[33], authid[33];     get_user_name(id,username,32);     get_user_authid(id,authid,32);     // if clearing models     if(equal(model,".reset")) {       // log the command       log_amx("Cmd: ^"%s<%d><%s><>^" reset model for %s%s",username,get_user_userid(id),authid,isdigit(target[0]) ? "#" : "",target);       // show activity       switch(get_cvar_num("amx_show_activity")) {         case 1: client_print(0,print_chat,"ADMIN: reset model for %s%s",isdigit(target[0]) ? "#" : "",target);         case 2: client_print(0,print_chat,"ADMIN %s: reset model for %s%s",username,isdigit(target[0]) ? "#" : "",target);       }     }     else { // if setting models       // log the command       log_amx("Cmd: ^"%s<%d><%s><>^" set model %s on %s%s",username,get_user_userid(id),authid,model,isdigit(target[0]) ? "#" : "",target);       // show activity       switch(get_cvar_num("amx_show_activity")) {         case 1: client_print(0,print_chat,"ADMIN: set model %s on %s%s",model,isdigit(target[0]) ? "#" : "",target);         case 2: client_print(0,print_chat,"ADMIN %s: set model %s on %s%s",username,model,isdigit(target[0]) ? "#" : "",target);       }     }     new flags[2]//, team[33]; //    if(equal(target,"@T")) { // All Terrorists //      flags = "e"; // team //      team = "TERRORIST"; //    } //    else if(equal(target,"@CT")) { // All Counter-Terrorists //      flags = "e"; // team //      team = "CT"; //    } /*    if(isdigit(target[0])) { // Specific Player or Yourself       flags = "f"; // name       get_user_name(str_to_num(target),32);     } */     // Otherwise this leaves us with nothing, which is All Players     // get targets     new players[32], num;     get_players(players,num,flags);     // loop through     for(new i=0;i<num;i++) {       new player = players[i]; // our player       if(equal(model,".reset")) { // if reset         tfc_setmodel(player,"",""); //no model or skin !?!         setmodel[player] = "";       }       else {         tfc_setmodel(player,model,""); //don't know what to fill in, at the skin argument.         setmodel[player] = model;       }     }     return 1;   }  // ------------------------------------------------------------------------------------------   // --SET MODEL ACTION B---------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public modelActionb(id,target[33],model[33]) {     new username[33];     get_user_name(id,username,32);     // if clearing models     if(equal(model,".reset")) {       // log the command       // show activity             client_print(0,print_chat,"%s: reset there model",username);      } else  { // if setting models       // log the command       // show activity          client_print(0,print_chat,"%s: set there model to %s",username,model);       }                 new flags[2]//, team[33]; //    if(equal(target,"@T")) { // All Terrorists //      flags = "e"; // team //      team = "TERRORIST"; //    } //    else if(equal(target,"@CT")) { // All Counter-Terrorists //      flags = "e"; // team //      team = "CT"; //    } /*    if(isdigit(target[0])) { // Specific Player or Yourself       flags = "f"; // name       get_user_name(str_to_num(target),32);     } */     // Otherwise this leaves us with nothing, which is All Players     // get targets     new players[32], num;     get_players(players,num,flags);     // loop through     for(new i=0;i<num;i++) {       new player = players[i]; // our player       if(equal(model,".reset")) { // if reset         tfc_setmodel(player,"","");         setmodel[player] = "";       }       else {         tfc_setmodel(player,model,"");         setmodel[player] = model;       }     }     return 1;   }   // ------------------------------------------------------------------------------------------   // --CUSTOM MODEL LIST----------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public get_models(array[32][],len) {     // get a list of custom models     new dirpos, output[64], outlen, filledamt;     // go through custom models     while((dirpos = read_dir("models/player",dirpos,output,255,outlen)) != 0) {       if(containi(output,".") == -1) { // if not a file (but a directory)         // check if model is actually there         new modelfile[64];         format(modelfile,63,"models/player/%s/%s.mdl",output,output);         // if it exists         if(file_exists(modelfile)) {           format(array[filledamt],len,"%s",output);           filledamt += 1;         }         // if we are out of array space now         if(filledamt > 32) {           return filledamt;         }       }     }     return filledamt;   }   // ------------------------------------------------------------------------------------------   // --RESET MODEL ON RESPAWN-----------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public event_resethud(id) {     if(!equal(setmodel[id],"")) {       tfc_setmodel(id,setmodel[id],"");     }   }   // ------------------------------------------------------------------------------------------   // --CONNECTION AND DISCONNECTION-----------------------------------------------------------   // ------------------------------------------------------------------------------------------   public client_connect(id) {     page[id] = 1;     setmodel[id] = "";   }   public client_disconnect(id) {     page[id] = 1;     setmodel[id] = "";   }   // ------------------------------------------------------------------------------------------   // --PLUGIN PRECACHE------------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public plugin_precache() {     // get custom models     new models[32][33], num;     num = get_models(models,32);     // loop through them     for(new i=0;i<num;i++) {       new modelstring[64];       format(modelstring,63,"models/player/%s/%s.mdl",models[i],models[i]);       precache_model(modelstring);     }   }   public currmodel(id) {  client_print(id,print_chat,"Out in Next Release");  return PLUGIN_HANDLED;   }   // ------------------------------------------------------------------------------------------   // --PLUGIN ININITATION---------------------------------------------------------------------   // ------------------------------------------------------------------------------------------   public plugin_init() {     register_plugin("TFM Model Menu","0.1","Watch Your Back");     console_print(0,"* Loaded TFM Model Menu 0.1 by Watch Your Back *");     register_clcmd("amx_tfmmodel","consoleCommand",ADMIN_BAN,"- brings up menu for custom user models");     register_clcmd("say /setmodel","menu7Display");     register_event("ResetHUD","event_resethud","b");     //register_clcmd("say /currmodel","currmodel",-1);     // Register Menu IDs     new menu1ID = register_menuid("menu1");     new menu2ID = register_menuid("menu2");     new menu3ID = register_menuid("menu3");     new menu4ID = register_menuid("menu4");     new menu5ID = register_menuid("menu5");     new menu6ID = register_menuid("menu6");     new menu7ID = register_menuid("menu7");     new menu8ID = register_menuid("menu8");     // Register Menu Commands     register_menucmd(menu1ID,1023,"menu1Action");     register_menucmd(menu2ID,1023,"menu2Action");     register_menucmd(menu3ID,1023,"menu3Action");     register_menucmd(menu4ID,1023,"menu4Action");     register_menucmd(menu5ID,1023,"menu5Action");     register_menucmd(menu6ID,1023,"menu6Action");     register_menucmd(menu7ID,1023, "menu7Action");     register_menucmd(menu8ID,1023, "menu8Action");   }   // hook amx_csummz to check permissions   public consoleCommand(id,level,cid) {     if(!cmd_access(id,level,cid,1)) {       return PLUGIN_HANDLED;     }     return menu1Display(id);   }
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
djdeath
Junior Member
Join Date: Jan 2007
Old 02-02-2007 , 22:12   Re: TFM Models Menu Help.....
Reply With Quote #3

I got the plugin installed. . but when you go to choose custom models it dosent display a list of the models... is there anyway i can change it from getting the list of all models in the "tfc/models/player" folder to an INI... i am not shure how to go about that or how to get amxx to read the ini. so maby you can help a little...
djdeath is offline
djdeath
Junior Member
Join Date: Jan 2007
Old 02-03-2007 , 03:12   Re: TFM Models Menu Help.....
Reply With Quote #4

Ok ... the code was so confusing i decided to go ahead and re-write the code

..... OK i decided cause i was confusing myself... for the meantime i will just add in the models as i want untill i can figure out how to make the plugin read an INI file...


heres a new version of my plugin...

Code:
#include <amxmodx>
#include <amxmisc>
#include <tfcx>

#define PLUGIN "TFM Model Mod"
#define VERSION "0.1"
#define AUTHOR "Watch Your Back"


public plugin_init() {
    register_plugin(PLUGIN , VERSION , AUTHOR)
    
    register_clcmd("say /setmodel" , "model_menu");
//    register_event("ResetHUD","event_resethud","b");
    
    
    // Add your code here...
}

  // ------------------------------------------------------------------------------------------
  // --CUSTOM MODEL LIST----------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public get_models(array[32][],len) {
    // get a list of custom models
    new dirpos, output[64], outlen, filledamt;
    // go through custom models
    while((dirpos = read_dir("models/player",dirpos,output,255,outlen)) != 0) {
      if(containi(output,".") == -1) { // if not a file (but a directory)
        // check if model is actually there
        new modelfile[64];
        format(modelfile,63,"models/player/%s/%s.mdl",output,output);
        // if it exists
        if(file_exists(modelfile)) {
          format(array[filledamt],len,"%s",output);
          filledamt += 1;
        }
        // if we are out of array space now
        if(filledamt > 32) {
          return filledamt;
        }
      }
    }
    return filledamt;
  }
  
    // ------------------------------------------------------------------------------------------
  // --PLUGIN PRECACHE------------------------------------------------------------------------
  // ------------------------------------------------------------------------------------------
  public plugin_precache() {
    // get custom models
    new models[32][33], num;
    num = get_models(models,32);
    // loop through them
    for(new i=0;i<num;i++) {
      new modelstring[64];
      format(modelstring,63,"models/player/%s/%s.mdl",models[i],models[i]);
      precache_model(modelstring);
    }
  }

/*public event_resethud(id) {
    
}*/

public model_menu(id){
    new menu = menu_create ( "TFM MODEL MENU" , "model_handler")
    
    menu_additem(menu , "\w Change Model", "1", 0)
    menu_additem(menu , "\w Reset Model" , "2" , 0)
    
    menu_setprop(menu , MPROP_EXIT , MEXIT_ALL)
    
    menu_display(id , menu , 0)
}

public model_handler(id , menu , item) {
    
    // ON EXIT CLOSE MENU
    if (item == MENU_EXIT){
        menu_destroy(menu)
        
        return PLUGIN_HANDLED
    }
    
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    {
        case 1:{
            new menu_ChangeModel = menu_create ( " Change Your Model" , "changeModel_handler")
            
            menu_additem (menu_ChangeModel , "\w Atomic" , "1" , 0)
            menu_additem (menu_ChangeModel , "\w stfu_monkey" , "2" , 0)
            
            menu_setprop (menu_ChangeModel , MPROP_EXIT, MEXIT_ALL)
            
            menu_destroy(menu)
            
            menu_display(id , menu_ChangeModel , 0)
            
        }
        
        case 2:{
            tfc_clearmodel(id)
            client_print(id, print_chat, "You reset you Model")
            menu_destroy(menu)
            
            return PLUGIN_HANDLED
        }
        
    }

    //lets finish up this function with a menu_destroy, and a return
    menu_destroy(menu)

    return PLUGIN_HANDLED
 }

 public changeModel_handler(id , menu_ChangeModel , item) {
    
    // ON EXIT CLOSE MENU
    if (item == MENU_EXIT){
        menu_destroy(menu_ChangeModel)
        
        return PLUGIN_HANDLED
    }
    
    new data[6], iName[64]
    new access, callback
    menu_item_getinfo(menu_ChangeModel, item, access, data,5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch (key) 
    {
        case 1:{
            tfc_setmodel(id, "atomic", "")
            client_print(id , print_chat, "Your model has been changed to atomic.")
            menu_destroy(menu_ChangeModel)
            
            return PLUGIN_HANDLED
        }
        
        case 2:{
            tfc_setmodel(id, "stfu_monkey" , "")
            client_print(id , print_chat , "Your Model has been changed to stfu_monkey")
            menu_destroy(menu_ChangeModel)
            
            return PLUGIN_HANDLED
            
        }
    }
    
    menu_destroy(menu_ChangeModel)
    return PLUGIN_HANDLED
}
i will also attach the sma..

also, when i run this througth the compiler i run with 0 errors but....

when i am in TFC and i decided to use the "Reset Model" off of the 1st menu, i set the code to
Code:
        case 2:{
            tfc_clearmodel(id)
            client_print(id, print_chat, "You reset you Model")
            menu_destroy(menu)
            
            return PLUGIN_HANDLED
        }
the error comes up in console as.. somethink like

error model model/player/scout017D/scout017D.mdl could not be found.

or somthing to that nature, i dont know where its getting the 017D part of that ... its just sposed to set the model back to the userclass model... maby someone can help me out a little Thanks!
Attached Files
File Type: sma Get Plugin or Get Source (tfm_models.sma - 688 views - 4.1 KB)
djdeath is offline
inc0gnito
Member
Join Date: Mar 2007
Old 04-15-2007 , 01:04   Re: TFM Models Menu Help.....
Reply With Quote #5

so this plugin will make players on server to choose his self skins thats right..?
if yes pls post how i can instal this thx alot!

Last edited by inc0gnito; 04-15-2007 at 02:34.
inc0gnito is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode