ULX

Author Topic: gui.OpenURL not working if there is more than one command?  (Read 2245 times)

0 Members and 1 Guest are viewing this topic.

Offline Jerpy

  • Newbie
  • *
  • Posts: 21
  • Karma: 2
gui.OpenURL not working if there is more than one command?
« on: January 25, 2015, 01:55:45 PM »
So currently I have a working script that opens our donation page in the steam overlay by typing !donate
Here is the script:
Code: [Select]
function donateCommand( pl, text, public )
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://www.test.com")]])
end
end
hook.Add( "PlayerSay", "Chat", donateCommand )

If I were to have two seperate scripts with two different commands, it breaks the first one. So for example if I add a seperate script to have !joingroup open our steam community page, it will break the !donate command and the donate command will not function, just the joingroup one. Yes, I am changing the function and hook name. So joingroup is function joingroupCommand and the hook is also joingroupCommand. Is there anything else I'm missing here? I'm not that great with this stuff sometimes

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: gui.OpenURL not working if there is more than one command?
« Reply #1 on: January 25, 2015, 01:57:24 PM »
The second argument to hook.Add is a unique Identifier for your hook. Make it unique.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Jerpy

  • Newbie
  • *
  • Posts: 21
  • Karma: 2
Re: gui.OpenURL not working if there is more than one command?
« Reply #2 on: January 25, 2015, 02:08:53 PM »
Thank you, that did it
Edit: my second question now would be, how do you make it so when entering and sending this chat command, you would be automatically added to the "member" ulx group?
« Last Edit: January 25, 2015, 02:12:11 PM by Jerpy »

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: gui.OpenURL not working if there is more than one command?
« Reply #3 on: January 25, 2015, 02:22:41 PM »
Thank you, that did it
Edit: my second question now would be, how do you make it so when entering and sending this chat command, you would be automatically added to the "member" ulx group?
yes
http://forums.ulyssesmod.net/index.php/topic,7856.0.html
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.

Offline Jerpy

  • Newbie
  • *
  • Posts: 21
  • Karma: 2