General > Developers Corner
Help with gui boxes
easer7:
helllooooo =33 I just made a script called getkarma, and despite the name, it SETS karma, and I wnt to make a ULX command that sets karma, I know how to put it in the XGUI but i dont know how to make a box of target players and a box of how much karma to set it to
Help?
Megiddo:
Look at other ULX commands for a template of how to create your own. You don't need to explicitly add it to XGUI as XGUI will intelligently figure out what you need on its own, assuming you create the command in ULX correctly!
easer7:
awesome thanks!
easer7:
hey i got this so far
function ulx.setkarma( calling_ply, command, argv, args )
if #argv < 2 then
ULib.tsay( ply, ulx.LOW_ARGS, true )
return
end
local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err, true )
return
end
local amount = tonumber( argv[ 2 ] ) or 1000;
for k, v in pairs( player.GetAll() ) do
if ( string.find(string.lower( v:Targets() ), targets) ) then
v:SetLiveKarma(amount);
v:SetBaseKarma(amount);
end;
end;
end;
end
ulx.concommand( "setkarma", ulx.setkarma, "<user(s)> - Gives target(s) karma.", ULib.ACCESS_ADMIN, "!setkarma", _, ulx.ID_PLAYER_HELP )
ulx.addToMenu( ulx.ID_MCLIENT, "setkarma", "ulx setkarma" )
but i dont know where to go from here, can you help me?
JamminR:
Seems you're looking at an OLD ulx command set up. We've not used that style in over a year, heck, perhaps two.
What version of ULX and Gmod are you running??
EDIT - See also - old vs new, with well documented comments.
http://forums.ulyssesmod.net/index.php/topic,4464.msg17838.html#msg17838
Navigation
[0] Message Index
[#] Next page
Go to full version