I googled and googled, yet I have not found something that can do this. I want to have a command (e.g. !group) that will open our Steam group in the Steam browser if they type it. I'm currently using Exsto but I can change admin mods if they add this feature.
Should not be hard to find at all, but here you go.
[CODE]if ( SERVER ) then
hook.Add( "PlayerSay", "steamgroupcommand", function( _p, _text, public )
if ( _text == "!group" ) then
_p:ConCommand( "steamgroup" );
return "";
end
end );
else
concommand.Add( "steamgroup", function()
gui.OpenURL( "http://steamcommunity.com/groups/redpredatorgaming" ); --My Steam Group is called Red Predator Gaming, change this url with yours!
end );
end[/CODE]
Put this code in your garrysmod/lua/autorun/server folder, and name it whatever you like.
What does[lua]
return ""; [/lua]
mean?
[QUOTE=YourStalker;45674903]What does[lua]
return ""; [/lua]
mean?[/QUOTE]
Doesn't print in chat that the player ran the command.
[QUOTE=BVictorB;45674822]Put this code in your garrysmod/lua/autorun/server folder, and name it whatever you like.[/QUOTE]
No, you need to put it in garrysmod/lua/autorun because it's a shared file, thus containing both serverside and clientside code.
EDIT: You might aswell do it all clientside.
[lua]
if CLIENT then
hook.Add("OnPlayerChat", "OpenGroup", function(ply, txt)
if txt ~= "!group" then return end
if ply ~= LocalPlayer() then return end
gui.OpenURL( "http://steamcommunity.com/groups/GROUP" )
end)
end
[/lua]
Or you could use my addon [URL="http://fcpn.ch/dfit9"]GroupR[/URL] to give rewards when they join the group.
[QUOTE=Jarva;45675572]No, you need to put it in garrysmod/lua/autorun because it's a shared file, thus containing both serverside and clientside code.
EDIT: You might aswell do it all clientside.
[lua]
if CLIENT then
hook.Add("OnPlayerChat", "OpenGroup", function(ply, txt)
if txt ~= "!group" then return end
if ply ~= LocalPlayer() then return end
gui.OpenURL( "http://steamcommunity.com/groups/GROUP" )
end)
end
[/lua]
Or you could use my addon [URL="http://fcpn.ch/dfit9"]GroupR[/URL] to give rewards when they join the group.[/QUOTE]
You are right, im sorry for giving wrong information!
[QUOTE=Jarva;45675572]
Or you could use my addon [URL="http://fcpn.ch/dfit9"]GroupR[/URL] to give rewards when they join the group.[/QUOTE]
Interesting, a Steam group rewards addon that isn't on CoderHire.
That's why I made it.
Sorry, you need to Log In to post a reply to this thread.