General > Developers Corner
Command added to xgui doesn't work
iSnipeu:
--- Quote from: Eccid on December 16, 2012, 05:04:10 AM ---
--- Code: ---local CATEGORY_NAME = "TTT"
function ulx.tttadminreport(calling_ply)
ply:ConCommand(calling_ply, "ttt_version")
end
local tttadminreport = ulx.command(CATEGORY_NAME, "Admin Report", ulx.tttadminreport)
tttadminreport:defaultAccess(ULib.ACCESS_ADMIN )
tttadminreport:help("Displays all death information in the console.")
--- End code ---
This is what I have currently, I'm using ttt_version so i can test this script alon on the server, now when I press it though, it comes back "Unkown Command 'Admin' "
--- End quote ---
Use "ulx adminreport" for the second arg.
JamminR:
To expand on Isnipeu a bit (I could see someone thinking 'which' second arg)
The portion here;
--- Code: ---local <name of object, best if same as command> = ulx.command( "<STRING- help category, ex Fun>", "<STRING - console command, example 'ulx <this>'>", <literal function name>, "<STRING - command used in chat to perform action>, <BOOLEAN-hide saychat or not>, <BOOLEAN-require spaces after command or not> )
--- End code ---
Here's MrPresident's explode command from the conversion tutorial I link to previously, edited to use all the parameters (booleans at end, not required).
--- Code: ---local explode = ulx.command( "Fun", "ulx explode", ulx.explode, "!explode", false, true )
--- End code ---
See what it means now?
See what you have to change?
Eccid:
I changed it, now it's just back to doing nothing -_-
JamminR:
You've not got the player console command structured right.
If the player running the command indeed has a working console command called ttt_version, then the following should work better for you or the person running it.
--- Code: ---calling_ply:ConCommand( "ttt_version" )
--- End code ---
Eccid:
Nothing seems to work, now I get this in the console when i click the button
"Invalid command entered. If you need help, please type "ulx help" in your console."
Here's my code, if you guys can't figure it out either, I'm done. I don't have time to dedicate to a lost cause.
--- Code: ---local CATEGORY_NAME = "TTT"
function ulx.tttadminreport(calling_ply)
calling_ply:ConCommand(calling_ply, "ttt_version")
end
local tttadminreport = ulx.command(CATEGORY_NAME, "ulx tttadminreport", ulx.tttadminreport)
tttadminreport:defaultAccess(ULib.ACCESS_ADMIN )
tttadminreport:help("Displays all death information in the console.")
--- End code ---
I've also tried every combination of the line
--- Code: --- calling_ply:ConCommand(calling_ply, "ttt_version")
--- End code ---
that I can think of.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version