Ulysses

General => Developers Corner => Topic started by: [SC] Paul on April 14, 2013, 01:22:20 PM

Title: Help with a command
Post by: [SC] Paul on April 14, 2013, 01:22:20 PM
I want a command to open my donations page without players having to tab out I was using this
Code: [Select]
function donateCommand( pl, text, teamonly )
    if (text == "!donate") then
    pl:SendLua([[gui.OpenURL("http://myurl.com/donate")]]) -- Change ADDRESS to your chosen page.
    for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has donated to the server via !donate" )

end
end
end
hook.Add( "PlayerSay", "Chat", donateCommand )
All it done was display the text "Player Paul has donated to the server via !donate" does anyone know what i could do to fix this?
Title: Re: Help with a command
Post by: bender180 on April 14, 2013, 01:48:18 PM
Here this should be working ( at least it does on my server.)

Also make sure you put it in lua/autorun

Code: [Select]
function donateCommand( pl, text, teamonly )
    if (text == "!donate") then
    pl:SendLua([[gui.OpenURL("http://bendersvilla.net")]]) -- Change ADDRESS to your chosen page.
    for k, v in pairs(player.GetAll()) do v:ChatPrint( "" .. pl:Nick() .. " has gone to !donate." )

end
end
end
hook.Add( "PlayerSay", "ccdonate", donateCommand )
Title: Re: Help with a command
Post by: [SC] Paul on April 14, 2013, 02:06:15 PM
That worked thanks! :D