• Print

Author Topic: i need a command  (Read 5869 times)

0 Members and 1 Guest are viewing this topic.

Offline babci21

  • Newbie
  • *
  • Posts: 2
  • Karma: -1
i need a command
« on: October 08, 2014, 03:36:21 pm »
I need a command like say u say !getaddons it bring the player who said that to the href or url to the workshop for the addons so if anyone can for this url http://steamcommunity.com/sharedfiles/filedetails/?id=295885854
so peaple can download the addons im using on my server and so no one complains about errors every were :/ like with WAC.
Thx And Good Day!

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: i need a command
« Reply #1 on: October 08, 2014, 04:39:31 pm »
This is untested, but I think it'll work
Let me know if you get any errors
Code: Lua
  1. function ulx.getaddons( calling_ply )
  2.         calling_ply:SendLua("gui.OpenURL('http://steamcommunity.com/sharedfiles/filedetails/?id=295885854')")
  3. end
  4. local getaddons = ulx.command( "Custom", "ulx getaddons", ulx.getaddons, "!getaddons" )
  5. getaddons:defaultAccess( ULib.ACCESS_ALL )
  6. getaddons:help( "Opens the page of our addon collection" )

EDIT -JamminR - Removed BBS tags for url
« Last Edit: September 01, 2019, 03:01:44 pm by JamminR »

Offline babci21

  • Newbie
  • *
  • Posts: 2
  • Karma: -1
Re: i need a command
« Reply #2 on: October 09, 2014, 03:26:10 pm »
[ERROR] LuaCmd:1: ')' expected near '['
  1. unknown - LuaCmd:0

That is the error

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: i need a command
« Reply #3 on: October 09, 2014, 04:39:58 pm »
Remove this from line #2:
Code: [Select]
[url][/url]
So it should look like this:
Code: [Select]
function ulx.getaddons( calling_ply )
calling_ply:SendLua("gui.OpenURL('http://steamcommunity.com/sharedfiles/filedetails/?id=295885854')")
end
local getaddons = ulx.command( "Custom", "ulx getaddons", ulx.getaddons, "!getaddons" )
getaddons:defaultAccess( ULib.ACCESS_ALL )
getaddons:help( "Opens the page of our addon collection" )
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: i need a command
« Reply #4 on: October 09, 2014, 07:55:36 pm »
Oh oops
Didn't notice when I pasted in that link into the code it still had the URL code from the forum
Sorry about that :P

  • Print