Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: rocky123xo on January 23, 2013, 08:06:46 PM

Title: Ugh
Post 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?
Code: [Select]
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 )


Code: [Select]
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 )
Title: Re: Ugh
Post by: Stickly Man! on January 23, 2013, 08:59:29 PM
Code: [Select]
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.
Title: Re: Ugh
Post by: rocky123xo on January 23, 2013, 09:16:07 PM
Wow. Didn't even notice that. Thanks!