• Model Error
    8 replies, posted
Hear is the code [lua]if (SERVER) then player_manager.AddValidModel( "Adam Jensen" "models/player/adam_jensen.mdl" ) AddCSLuaFile( "adamjensen.lua" ) end player_manager.AddValidModel( "Adam Jensen", "models/player/adam_jensen.mdl" ); list.Set( "PlayerOptionsModel", "Adam Jensen", "models/player/adam_jensen.mdl" ); --// File Generated By Fox-Warrior's Resources Generator Version 2.05 \\-- if (SERVER) then resource.AddFile( "models/player/adam_jensen.mdl" ) resource.AddFile( "models/player/adam_jensen.dx80.vtx" ) resource.AddFile( "models/player/adam_jensen.dx90.vtx" ) resource.AddFile( "models/player/adam_jensen.phy" ) resource.AddFile( "models/player/adam_jensen.sw.vtx" ) resource.AddFile( "models/player/adam_jensen.vvd" ) resource.AddFile( "materials/models/player/adamjensen/coat-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/coat-0000.vtf" ) resource.AddFile( "materials/models/player/adamjensen/coat-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/eyes-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/eyes-0001.vtf" ) resource.AddFile( "materials/models/player/adamjensen/facehair.vmt" ) resource.AddFile( "materials/models/player/adamjensen/facehair.vtf" ) resource.AddFile( "materials/models/player/adamjensen/glasses.vmt" ) resource.AddFile( "materials/models/player/adamjensen/glasses.vtf" ) resource.AddFile( "materials/models/player/adamjensen/glasses_normal.vtf" ) resource.AddFile( "materials/models/player/adamjensen/hair.vmt" ) resource.AddFile( "materials/models/player/adamjensen/hair.vtf" ) resource.AddFile( "materials/models/player/adamjensen/hands-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/hands-0001.vtf" ) resource.AddFile( "materials/models/player/adamjensen/hands-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/head-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/head-0001.vtf" ) resource.AddFile( "materials/models/player/adamjensen/head-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/pants-shades-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/pants-shades-0000.vtf" ) resource.AddFile( "materials/models/player/adamjensen/pants-shades-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/vest-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/vest-0000.vtf" ) resource.AddFile( "materials/models/player/adamjensen/vest-0001.vtf" ) end[/lua] [editline]25th February 2015[/editline] For some reason i get a error on my server but all is fine with tehg coding there must be some thing wrong i get this in the console "[ERROR] addons/teenage mutant ninja turtle/lua/autorun/tmnt.lua:2: ')' expected near '"models/player/tmnt.mdl 1. unknown - addons/teenage mutant ninja turtle/lua/autorun/tmnt.lua:0" for all my models i added
You forgot a comma on the second line. Please wrap your code in [lua] tags next time.
[QUOTE=buu342;47212200]You forgot a comma on the second line. Please wrap your code in [lua] tags next time.[/QUOTE] How do you do that [editline]25th February 2015[/editline] If you know whats going on please help or ask for more information or over steam add me BeefyBadgerr
[QUOTE=BeeftBadgerr;47212208]How do you do that [/QUOTE] [lua]This is code wrapped in LUA tags. Quote this post to see how they work. [/lua]
[QUOTE=The Commander;47212253][lua]This is code wrapped in LUA tags. Quote this post to see how they work. [/lua][/QUOTE] Thanks
Try this: [code]if SERVER then AddCSLuaFile() end player_manager.AddValidModel( "Adam Jensen", "models/player/adam_jensen.mdl" ) list.Set( "PlayerOptionsModel", "Adam Jensen", "models/player/adam_jensen.mdl" ) if CLIENT then return end resource.AddFile( "models/player/adam_jensen.mdl" ) resource.AddFile( "materials/models/player/adamjensen/coat-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/coat-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/eyes-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/facehair.vmt" ) resource.AddFile( "materials/models/player/adamjensen/glasses.vmt" ) resource.AddFile( "materials/models/player/adamjensen/glasses_normal.vtf" ) resource.AddFile( "materials/models/player/adamjensen/hair.vmt" ) resource.AddFile( "materials/models/player/adamjensen/hands-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/hands-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/head-0001.vmt" ) resource.AddFile( "materials/models/player/adamjensen/head-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/pants-shades-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/pants-shades-0002.vtf" ) resource.AddFile( "materials/models/player/adamjensen/vest-0000.vmt" ) resource.AddFile( "materials/models/player/adamjensen/vest-0001.vtf" )[/code] Put this in lua/autorun
[code]player_manager.AddValidModel( "Adam Jensen" "models/player/adam_jensen.mdl" )[/code] to [code]player_manager.AddValidModel( "Adam Jensen", "models/player/adam_jensen.mdl" ) [/code] If you want something that automatically and recursively sets up the resource.Add[Single]?File instead of needing to run a utility when files change, take a look at this simple Lua script ( well document linking to the script needed ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url] It'll make adding resources much easier.. just drop them into your game-mode content folder.
[QUOTE=Acecool;47212465][code]player_manager.AddValidModel( "Adam Jensen" "models/player/adam_jensen.mdl" )[/code] to [code]player_manager.AddValidModel( "Adam Jensen", "models/player/adam_jensen.mdl" ) [/code] If you want something that automatically and recursively sets up the resource.Add[Single]?File instead of needing to run a utility when files change, take a look at this simple Lua script ( well document linking to the script needed ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url] It'll make adding resources much easier.. just drop them into your game-mode content folder.[/QUOTE] Just commenting on your script, I've found resource.AddFile to be a lot more reliable and efficient than AddSingleFile. With AddFile, you only have to add the .mdl and .vmt file (or .vtf if the texture doesn't have a .vmt). This is much more efficient especially with models, since you only have to call it once per model as opposed to five to six times with AddSingleFile.
Thanks it works non
Sorry, you need to Log In to post a reply to this thread.