• How do i make/download a addon so then "!donate" it comes up with a window to our donate page.
    11 replies, posted
Hello Fellow Humans I've got a question. How do i make/download a addon so then "!donate" it comes up with a window to our donate page? I've seen this in TF2 and Gmod. Its going to be on a Darkrp server, with Ulx, Wire and all the basic addons Thanks for your attention.
Use gui.OpenURL("Url here")
Mkay? In what file?
the one you have !donate set up in
What? I havn't made any files yet? Arnt there a tutorial for this?
If you can't figure out how to make a file, you shouldn't be accepting donations
Ooooohhhhh! Now I get it. But just because English isnt my native language, you dont have to be like that. Anyway, in what file should I add the gui.OpenURL or should I make a new file?
a thing I whipped up in another thread, too lazy to make it open with chat commands place in lua/autorun/client. it appears when the scoreboard is visible [lua]function DisplayAccount( p, bool ) if !p or !bool then return end if !Panel then Panel = vgui.Create("DFrame") Panel:SetPos( 0, 0 ) Panel:SetSize(155, 74) Panel:SetTitle( LocalPlayer():Nick().."'s Account") -- replace with a string if you want Panel:SetDraggable(true) -- change this if you want the panel to be draggable (true or false) Panel:ShowCloseButton(false) -- i dont recommend setting this to true Panel:MakePopup() Panel:SetMouseInputEnabled(true) Panel:SetKeyBoardInputEnabled(false) Panel:SetDrawOnTop(false) local Donate = vgui.Create("DButton", Panel) Donate:SetPos( 18, 28 ) -- oh god Donate:SetSize( 120, 40 ) Donate:SetText( "Donate" ) Donate.DoClick = function() gui.OpenURL("[URL="http://www.urlhere.com/"]http://www.urlhere.com[/URL]") -- CHANGE THIS URL TO YOUR DONATION PAGE end end if bool == "true" then Panel:SetVisible(true) elseif bool == "false" then Panel:SetVisible(false) end end hook.Add("ScoreboardHide", "ScoreboardHide.DisplayAccount", function() DisplayAccount(LocalPlayer(), "false") gui.EnableScreenClicker(false) end) hook.Add("ScoreboardShow", "ScoreboardShow.DisplayAccount", function() DisplayAccount(LocalPlayer(), "true") gui.EnableScreenClicker(true) end)[/lua]
[CODE]function donateCommand( pl, text, teamonly ) if (text == "!donate") then pl:SendLua([[gui.OpenURL("enter a url")]]) -- Change ADDRESS to your chosen page. for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has viewed our donation page!" ) end end end hook.Add( "PlayerSay", "dcommand", donateCommand )[/CODE] drop that in a file in lua/autorun.
[QUOTE=nedamakolion;39633951]Hello Fellow Humans [blah blah blah] "!donate" [blah blah blagh] [/QUOTE] You are not..
[QUOTE=bender180;39696673][CODE]function donateCommand( pl, text, teamonly ) if (text == "!donate") then pl:SendLua([[gui.OpenURL("enter a url")]]) -- Change ADDRESS to your chosen page. for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has viewed our donation page!" ) end end end hook.Add( "PlayerSay", "dcommand", donateCommand )[/CODE] drop that in a file in lua/autorun.[/QUOTE] Thank you! worked for me and my server!
Sorry, you need to Log In to post a reply to this thread.