Ulysses

General => Developers Corner => Topic started by: Jerpy on January 25, 2015, 01:55:45 PM

Title: gui.OpenURL not working if there is more than one command?
Post by: Jerpy 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
Title: Re: gui.OpenURL not working if there is more than one command?
Post by: Bytewave on January 25, 2015, 01:57:24 PM
The second argument to hook.Add is a unique Identifier for your hook. Make it unique.
Title: Re: gui.OpenURL not working if there is more than one command?
Post by: Jerpy 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?
Title: Re: gui.OpenURL not working if there is more than one command?
Post by: bender180 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 (http://forums.ulyssesmod.net/index.php/topic,7856.0.html)
Title: Re: gui.OpenURL not working if there is more than one command?
Post by: Jerpy on January 25, 2015, 03:13:17 PM
yes
http://forums.ulyssesmod.net/index.php/topic,7856.0.html (http://forums.ulyssesmod.net/index.php/topic,7856.0.html)
Wow, this is 100x better than what I wanted. Thanks!