• Regarding bots
    0 replies, posted
[QUOTE]So my situation is I'd like to use gm_cmd to transfer my cache on server start. First, I can not run this immediately because GetHostName() returns "Garry's Mod" if called directly in an lua script (because it runs too early). I can't just add a timer, because timers do not run until a player or bot has joined. CLARIFICATION: I need GetHostName() beacuse I'd like the directory addresses to be generated automatically, not hardcoded in. So, I'm thinking I should just add a bot when the server starts, which will let the timer go. However, game.ConsoleCommand("bot\n"), if called directly, doesn't add the bot correctly because it is probably called too early. Does anyone know what I can do about this? My ultimate goal is to call GetHostName() and get the correct value, without requiring a player to join. Of course, it is possible to work around this problem by kicking the first player who joins, or something of that type, but that is not preferable. Edit: InitPostEntity is still too early, GetHostName() = "Garry's Mod" Edit2: Initialize also too early[/QUOTE]FIX: Hooking on Tick (Apparently Tick runs once before any players join)
Sorry, you need to Log In to post a reply to this thread.