• Print

Author Topic: "Not Allow" string?  (Read 4682 times)

0 Members and 1 Guest are viewing this topic.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
"Not Allow" string?
« on: February 06, 2015, 06:37:03 pm »
Alright, so I've run into an issue. I want this:


to be able to restrict certain strings just like this:


But my addon just shows this: (yes I know it says respawn, but that's because I broke giveweapon when trying to make it work, but it says the same thing anyways)



This is my code
Code: Lua
  1. function ulx.giveweapon( calling_ply, target_plys, weapon )
  2.        
  3.        
  4.         local affected_plys = {}
  5.         for i=1, #target_plys do
  6.                 local v = target_plys[ i ]
  7.                
  8.                 if not v:Alive() then
  9.                 ULib.tsayError( calling_ply, v:Nick() .. " is dead", true )
  10.                
  11.                 else
  12.                 v:Give(weapon)
  13.                 table.insert( affected_plys, v )
  14.                 end
  15.         end
  16.         ulx.fancyLogAdmin( calling_ply, "#A gave #T weapon #s", affected_plys, weapon )
  17. end
  18.        
  19.        
  20. local giveweapon = ulx.command( CATEGORY_NAME, "ulx giveweapon", ulx.giveweapon, "!giveweapon" )
  21. giveweapon:addParam{ type=ULib.cmds.PlayersArg }
  22. giveweapon:addParam{ type=ULib.cmds.StringArg, hint="weapon_357" }
  23. giveweapon:defaultAccess( ULib.ACCESS_ADMIN )
  24. giveweapon:help( "Give a player a weapon - !giveweapon" )
« Last Edit: February 06, 2015, 06:42:38 pm by Bite That Apple »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

  • Print