• Sending a ULX command to server?
    2 replies, posted
Hey guys, i want to make a simple lua script wich sends every 20 minutes a 'ulx showsite' command but it doesn't work, what is bad here? i'm using the incorrect native function to send the command? [CODE] if (SERVER) then concommand.Add("TestPub",Publicidad) timer.Create("Publicidad", 1200, 0, function() -- 1200 seg = 20 minutos ConCommand( "ulx showsite * argmod.16mb.com/GIF.html" )-- CMD para mostrar end) end function Publicidad(ply,cmd,args) if not ply:IsSuperAdmin() then return end print("Probando publicidad...") if ConCommand( "ulx showsite * argmod.16mb.com/GIF.html" ) then print("Ejecutada con éxito!") else print("La publicidad no se ejecutó :c") end end [/CODE] Greetings!
The command should part should have been concommand.Run but that's an internal function and you shouldn't do it, you should use [code]RunConsoleCommand("ulx", "showsite", "*", "http://argmod.16mb.com/GIF.html")[/code] Personally for something like this you may want to check out: [URL="http://wiki.garrysmod.com/page/gui/OpenURL"]http://wiki.garrysmod.com/page/gui/OpenURL[/URL] [code]for k, v in pairs( player.GetAll() ) do -- Do something end[/code]
[QUOTE=JamesScott;51948366]The command should part should have been concommand.Run but that's an internal function and you shouldn't do it, you should use [code]RunConsoleCommand("ulx", "showsite", "*", "http://argmod.16mb.com/GIF.html")[/code] Personally for something like this you may want to check out: [URL="http://wiki.garrysmod.com/page/gui/OpenURL"]http://wiki.garrysmod.com/page/gui/OpenURL[/URL] [code]for k, v in pairs( player.GetAll() ) do -- Do something end[/code][/QUOTE] I'll check it out, thanks a lot! :smile:
Sorry, you need to Log In to post a reply to this thread.