Author Topic: Group selection bug?  (Read 1620 times)

0 Members and 1 Guest are viewing this topic.

Offline General Butthurt

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Group selection bug?
« on: August 25, 2014, 11:00:42 AM »
Hello, I just wrote a ulx addon that allows me to set the scoreboard color for members and groups in ttt. I'm having a bit of an issue with the command to give groups a color though, it seems that at random times the command stops restricting the group limit and will let you enter any value you want. Originally it worked perfectly and you could only enter groupnames and in the dropdown menu in the gui it would give you group options. Now however the dropbox menu doesn't work in the gui, I click it an nothing happens, and it will allow me to use whatever value I want for the group when typing the command. This an issue as I was counting on ulx to provide me with safe group names in the command to add to the sqlite database, with it not working occasionally it leaves me vulnerable to sql injection attacks. Here is the code for the command I wrote. This is the one for removing the color from a group, but it uses the same code for the group parameter.

Code: [Select]
function ulx.ungroupcolor(calling_ply, group_name)
removeGroupColor(group_name)
end
local ungroupcolor =  ulx.command("Scoreboard Colors", "ulx ungroupcolor", ulx.ungroupcolor, "!ungroupcolor")
ungroupcolor:addParam{ type=ULib.cmds.StringArg, completes=ulx.group_names, hint="group", error="invalid group \"%s\" specified", ULib.cmds.restrictToCompletes }
ungroupcolor:defaultAccess( ULib.ACCESS_SUPERADMIN )
ungroupcolor:help( "Removes a groups scoreboard color." )