General > Developers Corner

gui.OpenURL not working if there is more than one command?

(1/1)

Jerpy:
So currently I have a working script that opens our donation page in the steam overlay by typing !donate
Here is the script:

--- Code: ---function donateCommand( pl, text, public )
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://www.test.com")]])
end
end
hook.Add( "PlayerSay", "Chat", donateCommand )
--- End code ---

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

Bytewave:
The second argument to hook.Add is a unique Identifier for your hook. Make it unique.

Jerpy:
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?

bender180:

--- Quote from: 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?

--- End quote ---
yes
http://forums.ulyssesmod.net/index.php/topic,7856.0.html

Jerpy:

--- Quote from: bender180 on January 25, 2015, 02:22:41 PM ---yes
http://forums.ulyssesmod.net/index.php/topic,7856.0.html

--- End quote ---
Wow, this is 100x better than what I wanted. Thanks!

Navigation

[0] Message Index

Go to full version