Is there anyway to open url using lua?
For example:
in serveraction menu i added "visit forum now".
if some one choose it he should redirect to the forum.
(In the same way like clicking on a »url« on server info)
Thanks and Regards,
Ajmin
local open_cmd -- this needs to stay outside the function, or it'll re-sniff every time... function open_url(url) if not open_cmd then if package.config:sub(1,1) == '\\' then -- windows open_cmd = function(url) -- Should work on anything since (and including) win'95 os.execute(string.format('start "%s"', url)) end -- the only systems left should understand uname... elseif (io.popen("uname -s"):read'*a') == "Darwin" then -- OSX/Darwin ? (I can not test.) open_cmd = function(url) -- I cannot test, but this should work on modern Macs. os.execute(string.format('open "%s"', url)) end else -- that ought to only leave Linux open_cmd = function(url) -- should work on X-based distros. os.execute(string.format('xdg-open "%s"', url)) end end end open_cmd(url) end
sv_sound2(id,path or url) sv_sound2(id,"http://unrealsoftware.de/sound.mp4"); -- EXAMPLE
http://unrealsoftware.de/cs2d/sounds/sound_name.format