ULX

Author Topic: Help please.  (Read 2455 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Help please.
« on: September 21, 2014, 08:17:39 PM »
Hey,
I need some help with my code. Its suppsed to be when someone types !yes into chat. it returns "Get denied. No." in console. Any help with my code would be appreacitated :)

Code: [Select]
function ulx.response( PrintMessage )
Player:PrintMessage( HUD_PRINTCONSOLE, "Get denied. No." )
end
end

local response = ulx.response( CATEGORY_NAME, "ulx response", ulx.response, "!yes" )
response:addParam{ type=ULib.cmds.PlayersArg }
response:defaultAccess ( ULib.ACESS.ADMIN )
response:help ( "A test script for creepy" )

This is my first code from scratch. So I may not get things a be a newb.
« Last Edit: September 23, 2014, 12:30:44 PM by BuilderGaming »
Newb Coder. Soon to get better

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Stupid Question -_-
« Reply #1 on: September 21, 2014, 09:16:58 PM »
If it's not obvious looking over our actual code files, see "NEW STUFF HERE" section of post from some years ago.
How-To/Comparison - ULX SVN vs old ULX release command structure
(Though, technically "new" when that post was written, we've been using the "new" style almost 5 years now)
Oh, and there's a heavily commented file attachment to that post of a previous converted "rocket" command MrPresident wrote.
Comments should be reasonably self explanatory.

Other good posts are the stickies at the top of our developer forum, where I moved your question to.
Want to patch or work on a Ulysses project? Use our codestyle.
ULib Documentation
Resources to get started with Lua
« Last Edit: September 21, 2014, 09:20:38 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: Help please.
« Reply #2 on: September 25, 2014, 12:42:33 PM »
*BUMP*
Newb Coder. Soon to get better

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Help please.
« Reply #3 on: September 25, 2014, 01:51:57 PM »
JamminR just gave you a bunch of resources to help you, yet you bump the thread.
For what?
Out of the Garry's Mod business.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Help please.
« Reply #4 on: September 25, 2014, 11:19:45 PM »
He posted code change. But, yeah, rather than 'bump', he should have posted a question or statement.
He's not paying attention/learning to read what Gmod errors are telling him.
Gmod would give him 3 errors off the bat.
One about table not expected, one about null variable, one about end of line/function.
1) He's using ULX 'playerSArg...which passes a table of players (even if table only has one player), not a single player .
2) He's not defining the variable for what Player is tied to in the print message.
3) He's also got two "end"s in the function that would only need one at this point.
« Last Edit: September 25, 2014, 11:23:38 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: Help please.
« Reply #5 on: September 26, 2014, 01:32:36 PM »
Still kinda don't get it. Could someone replicate what my code should look like so I can see what it should look like?
Newb Coder. Soon to get better

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Help please.
« Reply #6 on: September 26, 2014, 02:51:58 PM »
Sounds like you want someone to make it for you.
Out of the Garry's Mod business.

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: Help please.
« Reply #7 on: September 26, 2014, 02:53:50 PM »
I'm bored so I might try and through a rough script together for you, no promise though.
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given