• Addon init file not found?
    17 replies, posted
I am somewhat new to Lua, and this is my first folder addon. When I load the server, nothing happens. When I try to run it manually with lua_openscript, it says the file is not found. This is only happening on my dedicated server, singleplayer works fine. Here is the GitHub: [url]https://github.com/ajgeiss0702/GMapRotate[/url]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/AddCSLuaFile]AddCSLuaFile[/url] (you mist call this function from server, not client)
Thank you for the reply, (I have changed that now) but the server still cannot find the file. I have placed everything in that GitHub into a folder in the add ons folder.
it's still the same on the github. Also, you need two separate if client/server statements. [CODE] AddCSLuaFile( "nextmap/cl_nextmap.lua" ) if SERVER then include("nextmap/sv_nextmap.lua") include("nextmap/sv_config.lua") end if CLIENT then include("nextmap/cl_nextmap.lua") end[/CODE]
[QUOTE=MrRalgoman;52285214]it's still the same on the github. Also, you need two separate if client/server statements. [CODE] AddCSLuaFile( "nextmap/cl_nextmap.lua" ) if SERVER then include("nextmap/sv_nextmap.lua") include("nextmap/sv_config.lua") end if CLIENT then include("nextmap/cl_nextmap.lua") end[/CODE][/QUOTE] yeah, I haven't pushed it yet. and, I will try that. [editline]28th May 2017[/editline] It still cannot find the file.
Post the error
[code]Running script autorun/nextmap_init.lua... Couldn't include file 'autorun/nextmap_init.lua' (File not found) (<nowhere>) [/code]
No part in your code attempts to include autorun/nextmap_init.lua, when does that error show up? IIRC lua_openscript only runs scripts in your root lua folder
Ok, thanks. nextmap_init.lua is in autorun, so the server should run it automatically, right? It is still not running, so whats wrong?
[QUOTE=ajg0702;52285359]Ok, thanks. nextmap_init.lua is in autorun, so the server should run it automatically, right? It is still not running, so whats wrong?[/QUOTE] First make sure it's not running (Print at the top of the file) Then make sure the directory is proper (addons/base_directory/lua) (If your server is on a Linux system) Then make sure your base directory is written in lowercase as uppercase symbols can cause issues
[QUOTE=JasonMan34;52285486]First make sure it's not running (Print at the top of the file) Then make sure the directory is proper (addons/base_directory/lua) (If your server is on a Linux system) Then make sure your base directory is written in lowercase as uppercase symbols can cause issues[/QUOTE] Thank you! I will try those things soon. I am running my dedicated server on linux, so I made the folder lowercase. [B][U]I can confirm that the init is not running[/U][/B] is anyone going to help me?
If everything is right, the code would run. What's the path to your code?
[QUOTE=JasonMan34;52287197]If everything is right, the code would run. What's the path to your code?[/QUOTE] The path is (starting from server root) garrysmod/addons/gmaprotate Everything in GitHub is in that folder
What about lua/autorun/server
[QUOTE=gonzalolog;52289153]What about lua/autorun/server[/QUOTE] What do you mean? Shoulder the files just in the auto running folder be executed by the server already? I know it works because when i run it in single player, it works fine.
[QUOTE=ajg0702;52289689]I know it works because when i run it in single player, it works fine.[/QUOTE] Well then clearly something on the server is not set up right. That code ran perfectly fine when I put it on my server's addons folder
[QUOTE=JasonMan34;52290194]Well then clearly something on the server is not set up right. That code ran perfectly fine when I put it on my server's addons folder[/QUOTE] What wouldn't be set up right on the server? Any ideas?
Something New! It is running now, but with a completely different problem. Should I create a different thread?
Sorry, you need to Log In to post a reply to this thread.