Hi since models don't download on my server. Someone suggested i use force download too make players download them how do i set this up?
You have to use LUA to do this.
In the garrysmod/garrysmod/lua/autorun/server/ folder, create a new file called something.lua
Open the file and add in this code:
[lua]resource.AddFile("file path here")[/lua]
*Please note that something.lua can be named anything you want.
I'm trying to force download of an [url=http://www.garrysmod.org/downloads/?a=view&id=35496]RT screen[/url] that's on the server.
Here's my lua file in the server folder:
[lua]resource.AddFile("addons/RT Screen/materials/models/pimple_RTScreen/RT.vmt")
resource.AddFile("addons/RT Screen/materials/models/pimple_RTScreen/RT.vtf")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.dx80.vtx")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.dx90.vtx")
resource.AddFile("addons/RT Screen/models/pimple/rtscreen.mdl")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.phy")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.sw.vtx")
resource.AddFile("addons/RT Screen/models/pimple/rtscreen.vvd")
resource.AddFile("addons/RT Screen/settings/spawnlist/RTScreen.txt")[/lua]
Here's the weird thing, when I join I download all the files but when my friend (who downloaded it manually from garrysmod.org) spawns it, I still see an error. Does anyone know what's wrong?
[QUOTE=anothermartz;16402938]I'm trying to force download of an [url=http://www.garrysmod.org/downloads/?a=view&id=35496]RT screen[/url] that's on the server.
Here's my lua file in the server folder:
[lua]resource.AddFile("addons/RT Screen/materials/models/pimple_RTScreen/RT.vmt")
resource.AddFile("addons/RT Screen/materials/models/pimple_RTScreen/RT.vtf")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.dx80.vtx")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.dx90.vtx")
resource.AddFile("addons/RT Screen/models/pimple/rtscreen.mdl")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.phy")
resource.AddFile("addons/RT Screen/models/pimple/RTScreen.sw.vtx")
resource.AddFile("addons/RT Screen/models/pimple/rtscreen.vvd")
resource.AddFile("addons/RT Screen/settings/spawnlist/RTScreen.txt")[/lua]
Here's the weird thing, when I join I download all the files but when my friend (who downloaded it manually from garrysmod.org) spawns it, I still see an error. Does anyone know what's wrong?[/QUOTE]
I have the exact same problem with my shuriken SWEP
I know what your doing wrong.
Simply use:
resource.AddFile("materials/models/pimple_RTScreen/RT.vmt")
You must leave out the addon folder or anything else. the possible is:
resource.AddFile("materials/models/pimple_RTScreen/RT.vmt")
resource.AddFile("models/models/pimple_RTScreen/RT.vmt")
resource.AddFile("settings/models/pimple_RTScreen/RT.vmt")
I guess it would work for settings, but you must leave out some of path!
open notepad add this
resource.AddFile( "Directory" );
Eg.
-----
resource.AddFile( "models/weapons/model.mdl" );
----
If you want multipul files to download just add more lines Eg
resource.AddFile( "models/weapons/model.mdl" );
resource.AddFile( "models/weapons/model.mdl" );
resource.AddFile( "models/weapons/model.mdl" );
resource.AddFile( "models/weapons/model.mdl" );
resource.AddFile( "models/weapons/model.mdl" );
Then save the file as name.lua
and add it to lua\autorun\
If its an addon dont add
resource.AddFile( "addons/name/models/weapons/model.mdl" );
keep it as
resource.AddFile( "models/weapons/model.mdl" );
, simple :)
Hope this helped.
- Shane
doesnt work for me.
RAGE! Yeah, It doesn't work for me either D:
resource.AddFile("lua/autorun.lua");
resource.AddFile("lua/entities.lua");
resource.AddFile("lua/weapons.lua");
resource.AddFile("lua/entities/text_label/cl_init.lua");
resource.AddFile("lua/entities/text_label/init.lua");
resource.AddFile("lua/entities/text_label/shared.lua");
resource.AddFile("lua/autorun/labeler_shared.lua");
resource.AddFile( "lua/autorun/labeler/cl_labeler.lua");
resource.AddFile("lua/autorun/labeler/cl_vgui.lua");
resource.AddFile("lua/autorun/labeler/cl_vgui_elements.lua");
resource.AddFile("lua/autorun/labeler/labeler.lua");
resource.AddFile("lua/weapons/gmod_tool/stools/labeler.lua");
Anything you see wrong?
Hi, I can't get force downloads working at all.
I'm trying to force download ulx and U restrict
resource.AddFile("ulx\info.txt")
resource.AddFile("ulx\cfg\gamemodes\sandbox.ini")
resource.AddFile("ulx\cfg\maps\gm_construct.ini")
resource.AddFile("ulx\cfg\server.ini")
resource.AddFile("ulx\motd.txt")
AddCSLuaFile("ulx\lua\ULib\modules\ulx_init.lua")
AddCSLuaFile("ulx\lua\ulx\base.lua")
AddCSLuaFile("ulx\lua\ulx\cl_init.lua")
AddCSLuaFile("ulx\lua\ulx\cl_lib.lua")
AddCSLuaFile("ulx\lua\ulx\end.lua")
AddCSLuaFile("ulx\lua\ulx\init.lua")
AddCSLuaFile("ulx\lua\ulx\lib.lua")
AddCSLuaFile("ulx\lua\ulx\log.lua")
AddCSLuaFile("ulx\lua\ulx\sh_defines.lua")
AddCSLuaFile("ulx\lua\ulx\modules\chat.lua")
AddCSLuaFile("ulx\lua\ulx\modules\fun.lua")
AddCSLuaFile("ulx\lua\ulx\modules\menus.lua")
AddCSLuaFile("ulx\lua\ulx\modules\rcon.lua")
AddCSLuaFile("ulx\lua\ulx\modules\slots.lua")
AddCSLuaFile("ulx\lua\ulx\modules\teleport.lua")
AddCSLuaFile("ulx\lua\ulx\modules\toolmode.lua")
AddCSLuaFile("ulx\lua\ulx\modules\user.lua")
AddCSLuaFile("ulx\lua\ulx\modules\util.lua")
AddCSLuaFile("ulx\lua\ulx\modules\vote.lua")
AddCSLuaFile("ulx\lua\ulx\modules\votemap.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\adminmenu.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\banmenu.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\clientmenu.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\mainmenu.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\mapsmenu.lua")
AddCSLuaFile("ulx\lua\ulx\modules\cl\motdmenu.lua")
Lua files automatically download.
Ok. Do this: I KNOW this is old, but noone here is doing it right soooo:
if SERVER then
AddCSLuaFile( "file.lua" ) -- The name of this lua.
resource.AddFile("sound/lolwut.mp3") -- Notice the 3 spaces.
resource.AddFile("material/model/lolwut.mdl")
end
Sorry, you need to Log In to post a reply to this thread.