Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: rocky123xo on January 23, 2013, 08:06:46 PM
-
Two custom ULX commands are clashing. I fixed it earlier, and it's doing it again.
I have two custom chat commands, both linking to websites. Here they are. Problem is, they don't work together, one works, the other doesn't. Any ideas?
function forumCommand( pl, text, teamonly )
if (text == "!forum") then
pl:SendLua([[gui.OpenURL("http://dark.freeforums.org")]]) -- Change ADDRESS to your chosen page.
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has gone to our forum!" )
end
end
end
hook.Add( "PlayerSay", "Chat", forumCommand )
function donateCommand( pl, text, teamonly )
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://dark.freeforums.org/donations-t6.html")]]) -- Change ADDRESS to your chosen page.
for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has considered donating!" )
end
end
end
hook.Add( "PlayerSay", "Chat", donateCommand )
-
hook.Add( "PlayerSay", "Chat", donateCommand )
The second string "Chat" is supposed to be the name of the hook you're creating-- in other words, it should be a unique name that won't get used anywhere else. Change each hook to have different strings there, and you should be good.
-
Wow. Didn't even notice that. Thanks!