View Single Post
heliumdream
Senior Member
Join Date: Aug 2006
Old 03-01-2018 , 09:23   Re: Modifying plugins select models zombie plague
Reply With Quote #6

This has been tackled before, here's a link to the CS User Model Menuz:
https://forums.alliedmods.net/showth...t=8631&page=11

I even made a version myself that supports superheroes mod, and did some other small optimizations.

Neat that you've made this for zombie mod! But as others suggested, put it in the right sub-forum.

---

oh, in fact, you did have a scripting issue tucked in there.
more or less the same way my code checks for superhero levels, you could check for the players access flags and stop folks who don't have admin privileges from picking select skins.

my code has already added handling for checking privileges.
i have separated the menu commands into two version, one for admins and one for public users.
amx_skin_menu_admin
amx_skin_menu

in this case, where we register the console commands, ADMIN_BAN and -1 are the privilege flags that get added to their definition and later checked inside their respective function calls.

Code:
   register_clcmd("amx_skin_menu_admin","consoleCommand",ADMIN_BAN,"- brings up menu for custom user models");
    register_clcmd("amx_skin_menu","consoleCommandUser",-1,"- brings up menu for custom user models");

---

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

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

    return menu1Display(id);
  }

  public consoleCommandUser(id,level,cid) {

    if(!cmd_access(id,level,cid,1)) {
      return PLUGIN_HANDLED;
    }
    //in menu6Actiob no need to detect commands to set a target, setting target here
    new idstr[33];
    num_to_str(id,idstr,32);
    target[id] = idstr;

    return menu6Display(id);
  }
__________________

Last edited by heliumdream; 03-01-2018 at 09:45.
heliumdream is offline