Pivity

How To Make Shortcuts for darkrp server

Last read Never
#1

Hey I was wondering how to make shortcuts for my server, no i don't mean binds i mean where i can type !content and it will bring me to the content page. Any Help is appreciated thanks.

#2

Why did you post in 2 sections?

#3
Bytypad ๐Ÿ‘‘at 6th of March 2017 04:25:05
Why did you post in 2 sections?Didn't know it was script fodder talk only
#4

Addons like this are written in lua. They don't come out of thin air.

#5

function websiteCommand( pl, text, teamonly ) if (text == "WHATYOUTYPEINTHECHAT") then pl:SendLua([[gui.OpenURL("YOURWEBSITEHERE")]]) -- Change ADDRESS to your chosen page. for k, v in pairs(player.GetAll()) do v:ChatPrint( "PRINTEDINCHAT" )

end end end hook.Add( "PlayerSay", "Chat", websiteCommand )

Got it

#6

Use ``` tags on your post.

Also do not use SendLua. It's lazy, and awful. Learn how to network. For example...

util.AddNetworkString('shadyOpenMenu')

hook.Add('PlayerSay', 'shadyChatCommands', function(ply, txt, isTeam)
if (txt == 'commandhere') then
net.Start('shadyOpenMenu')
net.Send(ply)
end
end)

Then you'd do clientside...

net.Receive('shadyOpenMenu', function(len)
gui.OpenURL('website')
end)

Just off the top of my head, quickly whipped up as an example.

#7

Ulx has the functionality. I don't remember the code, but it is way easier than what Nooky did. Google ULX Forum Command and something should come up

#8

I heavily suggest avoiding ULX as it's way too bloated.

#9
function ulx.forums( calling_ply )
calling_ply:SendLua([[gui.OpenURL( "]] .. GetConVarString("forums_url") .. [[" )]])
end
local forums = ulx.command( "Menus", "ulx forums", ulx.forums, "!forums" )
forums:defaultAccess( ULib.ACCESS_ALL )
forums:help( "Get directed to our community forums" )

works for me

Agree x 1
Users viewing this thread
Nobody