Author Topic: Help with a command  (Read 2302 times)

0 Members and 1 Guest are viewing this topic.

Offline [SC] Paul

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Help with a command
« 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?

Offline bender180

  • Full Member
  • ***
  • Posts: 217
  • Karma: 42
    • Benders Villa
Re: Help with a command
« Reply #1 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 )
Made community pool and community bowling and for the life of me couldn't tell you why they are popular.
Also made the ttt ulx commands.

Offline [SC] Paul

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Help with a command
« Reply #2 on: April 14, 2013, 02:06:15 PM »
That worked thanks! :D