1. Post #1
    Your local friendly Lua helper!
    bobbleheadbob's Avatar
    July 2011
    184 Posts
    function SetTime(ply, cmd, arg) --This concommand changes the world time. daylight.minute is the current world time.
    	local time = arg[1]
    	
    	if ply:Team() == 2 then
    		if ply:CanAfford(GetConVar("arena_timechangecost"):GetInt()) then
    			daylight.minute = time
    		end
    	end
    end
    concommand.Add("arena_settime", SetTime)

    This command HAS to be placed on a serverside file, but it is meant to be run by a player.
    Problem is, when I run it, nothing happens and it says UNKNOWN COMMAND.

    If I'm correct, the only way to get info from the client to the server is through concommands. How can I get this concommand to work then?

  2. Post #2
    I love you Danny <3
    Chessnut's Avatar
    August 2011
    2,689 Posts
    You can also use datastream.

    Anyways to run the command, just do RunConsoleCommand("coolbeans")
    Reply With Quote Edit / Delete Reply United States Show Events Lua Helper Lua Helper x 1 (list)

  3. Post #3
    Your local friendly Lua helper!
    bobbleheadbob's Avatar
    July 2011
    184 Posts
    You can also use datastream.

    Anyways to run the command, just do RunConsoleCommand("coolbeans")
    I head datastream will be removed by the release of the beta.

    Also, is there a way to run it by actually typing it in console instead of only though lua?

  4. Post #4
    I love you Danny <3
    Chessnut's Avatar
    August 2011
    2,689 Posts
    Either do what I said above or type the command into the console.

  5. Post #5
    Your local friendly Lua helper!
    bobbleheadbob's Avatar
    July 2011
    184 Posts
    Either do what I said above or type the command into the console.
    Well see that's the problem. The command isn't showing up for the client. When I type it out and run it it just tells me the concommand doesn't exist.

  6. Post #6
    I love you Danny <3
    Chessnut's Avatar
    August 2011
    2,689 Posts
    Check if the script is being ran, and if there are any errors.
    Reply With Quote Edit / Delete Reply United States Show Events Lua Helper Lua Helper x 1 (list)

  7. Post #7
    Your local friendly Lua helper!
    bobbleheadbob's Avatar
    July 2011
    184 Posts
    Check if the script is being ran, and if there are any errors.
    Suddenly it works. Thanks anyway! :)