General > Developers Corner
Ulx completes
skillz:
Consider them read, I might buy a kindle first though.
Megiddo:
Once you've done all that and you know what pointers are (I'm sure they'll be covered in that book or blogs somewhere), you should read up on some of the Lua implementation details. It made a pretty significant impact on how I approached my code after I looked into it. Particularly in how I use tables -- the way Lua hybridizes tables is quite cool.
Megiddo:
Our issue with command case-sensitivity has now been fixed.
skillz:
Thats brilliant :), also
--- Code: ---function ulx.equipment( calling_ply, target_plys, equipment )
if not GetConVarString("gamemode") == "terrortown" then ULib.tsayError( calling_ply, gamemode_error, true ) else
for i=1, #target_plys do
target_plys[i]:GiveEquipmentItem(tonumber(equipment))
end
ulx.fancyLogAdmin( calling_ply, "#A gave #T " .. equipment, target_plys)
end
end
local equipment = ulx.command( CATEGORY_NAME, "ulx give equipment", ulx.equipment )
equipment:addParam{ type=ULib.cmds.PlayersArg }
equipment:addParam{ type=ULib.cmds.StringArg, completes=ulx.get_equipment, hint="Equipment", error="Invalid equpiment:\"%s\" specified", ULib.cmds.restrictToCompletes }
equipment:defaultAccess( ULib.ACCESS_SUPERADMIN )
equipment:help( "Give <target(s)> specified equpiment." )
--- End code ---
this is my code now but, after i changed the function name to lowercase i also had to change the name of the command that appears on the right of the xgui to lowercase as i got the same problem, just to let you know.
Megiddo:
I don't understand what you mean. Try explaining it a different way?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version