I've just added PointShop to my server and I've been trying to add player models to it.
I managed to add a couple of them, one being [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=175697854"]Daedric Armour[/URL], and the other [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=238855334"]Obama[/URL](links to workshop).
But I've stumbled upon some that aren't as simple as the ones mentioned above, like [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=219267230"]Atlas[/URL]. It has more then one .mdl file and I don't really know what to do...
Here's some of the code I have:
This is in the Pointshop folder.
[CODE]ITEM.Name = 'Atlas'
ITEM.Price = 9000
ITEM.Model = 'models\bots\survivor_mechanic.mdl'
function ITEM:OnEquip(ply, modifications)
if not ply._OldModel then
ply._OldModel = ply:GetModel()
end
timer.Simple(1, function() ply:SetModel(self.Model) end)
end
function ITEM:OnHolster(ply)
if ply._OldModel then
ply:SetModel(ply._OldModel)
end
end
[/CODE]
This one is in Portal 2 Atlas Playermodel/lua/autorun
[CODE]if(SERVER) then
player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
end
list.Set( "PlayerOptionsModel", "Atlas", "models/bots/survivor_mechanic.mdl" )
--// File Generated By Fox-Warrior's Resources Generator Version 2.06 \\--
if (SERVER) then
resource.AddFile( "models/survivors/anim_mechaniz.mdl" )
resource.AddFile( "models/bots/survivor_mechanic.mdl" )
resource.AddFile( "models/bots/survivor_mechanic.dx80.vtx" )
resource.AddFile( "models/bots/survivor_mechanic.dx90.vtx" )
resource.AddFile( "models/bots/survivor_mechanic.phy" )
resource.AddFile( "models/bots/survivor_mechanic.vvd" )
resource.AddFile( "models/bots/survivor_mechanic.vtx" )
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.mdl" )
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.dx80.vtx" )
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.dx90.vtx" )
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.vvd" )
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.vtx" )
resource.AddFile( "materials/models/survivors/mechanic/ballbot_frame.vtf" )
resource.AddFile( "materials/models/survivors/mechanic/ballbot_frame_normal.vtf" )
resource.AddFile( "materials/models/survivors/mechanic/ballbot_shell.vmt" )
resource.AddFile( "materials/models/survivors/mechanic/ballbot_shell.vtf" )
resource.AddFile( "materials/models/survivors/mechanic/ballbot_shell_normal.vtf" )
resource.AddFile( "materials/models/survivors/mechanic/bot_eye_lights.vmt" )
resource.AddFile( "materials/models/survivors/mechanic/bot_eye_lights.vtf" )
resource.AddFile( "materials/models/survivors/mechanic/bot_eye_ring_lights.vmt" )
resource.AddFile( "materials/models/survivors/mechanic/bot_eye_ring_lights.vtf" )
end[/CODE]
Not really sure if there's more to it then just these 2 files, or if I made some mistake in the code, but the model won't even show up in the PointShop.
What exactly is the issue? Also, if this is for TTT, you can delete
[code]if(SERVER) then
player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
end
list.Set( "PlayerOptionsModel", "Atlas", "models/bots/survivor_mechanic.mdl" )[/code]
Try either MDL. There's only 2 of them the rest are materials for it. See if one works if not try the other.
The problem was the model wouldn't show up in the PointShop, but I figured what the problem was...
Apparently when copied directly from FTP the little "/" comes as "\", so I had it messed up here:
[CODE]ITEM.Model = 'models\bots\survivor_mechanic.mdl'[/CODE]
But its fine now... Though I wonder how can I make the model not reset after every round start?
Also is there a way to see the model's hands in first person? In the example I used there seems to be models for the hands...
[QUOTE=Pink Raccoon;45728638]The problem was the model wouldn't show up in the PointShop, but I figured what the problem was...
Apparently when copied directly from FTP the little "/" comes as "\", so I had it messed up here:
[CODE]ITEM.Model = 'models\bots\survivor_mechanic.mdl'[/CODE]
But its fine now... Though I wonder how can I make the model not reset after every round start?
Also is there a way to see the model's hands in first person? In the example I used there seems to be models for the hands...[/QUOTE]
resource.AddFile( "models/bots/arms/v_arms_mechanic_new.mdl" )
That's probably the hands model right there now that I look at it.
As for round reset do this:
"Go to player_ext.lua,then remove or comment out line 271"
From someone having the same problem in 2013. This is smithy285's post not mine just quoting it for you.
I thought that could be the it, but I have no idea on how to add it to the model so it shows up in my server...
Thanks for the fast replies as well :smile:
[QUOTE=Onii_Chan;45728700]resource.AddFile( "models/bots/arms/v_arms_mechanic_new.mdl" )
That's probably the hands model right there now that I look at it.
As for round reset do this:
"Go to player_ext.lua,then remove or comment out line 271"
From someone having the same problem in 2013. This is smithy285's post not mine just quoting it for you.[/QUOTE]
Do NOT do that. The file has completely changed and will just mess up the gamemode.
[editline]18th August 2014[/editline]
[QUOTE=Pink Raccoon;45728775]I thought that could be the it, but I have no idea on how to add it to the model so it shows up in my server...
Thanks for the fast replies as well :smile:[/QUOTE]
FastDL or WorkshopDL.
[editline]18th August 2014[/editline]
[QUOTE=Pink Raccoon;45728638]The problem was the model wouldn't show up in the PointShop, but I figured what the problem was...
Apparently when copied directly from FTP the little "/" comes as "\", so I had it messed up here:
[CODE]ITEM.Model = 'models\bots\survivor_mechanic.mdl'[/CODE]
But its fine now... Though I wonder how can I make the model not reset after every round start?
Also is there a way to see the model's hands in first person? In the example I used there seems to be models for the hands...[/QUOTE]
Use forward slashes. Back slashes are escape characters.
[QUOTE=code_gs;45728823]Do NOT do that. The file has completely changed and will just mess up the gamemode.[/QUOTE]
Yeah, I noticed line 271 was an if sentence, but then I looked at line 272:
[CODE]hook.Call("PlayerSetModel", GAMEMODE, self)[/CODE]
I thought commenting that out would work, but it didnt change a single thing in-game... So I still don't know how to make models stop resetting.
[QUOTE=code_gs;45728823]FastDL or WorkshopDL.[/QUOTE]
I have the files in my server and everything, but no where in the code its indicating its using the arms .mdl file:
[CODE]ITEM.Name = 'Atlas'
ITEM.Price = 9000
ITEM.Model = 'models/bots/survivor_mechanic.mdl'
[/CODE]
I believe I'm misunderstanding your issue; what exactly is the problem?
Here:
This is thirdperson view:
[IMG]http://puu.sh/aXWQ9/6cb67146ec.jpg[/IMG]
Now, same pic, firstperson:
[IMG]http://puu.sh/aXWRD/8962bad3e8.jpg[/IMG]
There is a model for the hands in the folder it seems, how do I make it work?
Call Player:SetupHands() after changing his player model.
Run this code shared.
[code]hook.Add( "PlayerSetHandsModel", "AtlasHands", function( ply, ent )
if ( ply:GetModel() == "models/bots/survivor_mechanic.mdl" ) then
timer.Simple( 1, function() ent:SetModel( "models/bots/arms/v_arms_mechanic_new.mdl" ) end )
end
end )[/code]
[editline]18th August 2014[/editline]
[QUOTE=Robotboy655;45729116]Call Player:SetupHands() after changing his player model.[/QUOTE]
Depends if the creator tied the hands to the model.
[QUOTE=code_gs;45729149]Depends if the creator tied the hands to the model.[/QUOTE]
Pretty sure he did:
[code]
player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )[/code]
OP should replce this:
[code]
if(SERVER) then
player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
end
list.Set( "PlayerOptionsModel", "Atlas", "models/bots/survivor_mechanic.mdl" )[/code]
With this though:
[code]
player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
[/code]
[editline]18th August 2014[/editline]
list.Set( "PlayerOptionsModel", ... ) is [B]no longer used for more than a year.[/B]
[QUOTE=code_gs;45729149]Run this code shared.
[code]hook.Add( "PlayerSetHandsModel", "AtlasHands", function( ply, ent )
if ( ply:GetModel() == "models/bots/survivor_mechanic.mdl" ) then
timer.Simple( 1, function() ent:SetModel( "models/bots/arms/v_arms_mechanic_new.mdl" ) end )
end
end )[/code][/QUOTE]
Which file should I be adding that to exactly? The one in the poitshop folder, or the lua/autorun in the player model folder?
Also, bare in mind I have very little knowledge in coding... No idea what [QUOTE=RobotBoy655]Call Player:SetupHands() after changing his player model.[/QUOTE] means.
Put this in a lua/autorun file:
[code]player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
hook.Add( "PlayerSetHandsModel", "PostSetupHands", function( ply, ent )
timer.Simple( 3, function() ply:SetupHands() end ) -- Run after a delay to override anything else setting the hand model
end )[/code]
[QUOTE=code_gs;45729846]Put this in a lua/autorun file:
[code]player_manager.AddValidModel( "Atlas", "models/bots/survivor_mechanic.mdl" )
player_manager.AddValidHands( "Atlas", "models/bots/arms/v_arms_mechanic_new.mdl", 0, "00000000" )
hook.Add( "PlayerSetHandsModel", "PostSetupHands", function( ply, ent )
timer.Simple( 3, function() ply:SetupHands() end ) -- Run after a delay to override anything else setting the hand model
end )[/code][/QUOTE]
Did that, got this in console:
[CODE]MDLCache: weapons\arms\v_arms_mechanic_new.mdl needs to be recompiled
Requesting texture value from var "$basetexture" which is not a texture value (material: trails/tube)
Requesting texture value from var "$basetexture" which is not a texture value (material: trails/tube)
[/CODE]
[editline]18th August 2014[/editline]
More urgent now would be the model reset at round start though...
Contact the author about that first issue. As for the second issue, a lot of things could be causing that. Just put the SetModel in a timer to make sure it gets set last.
Sorry, you need to Log In to post a reply to this thread.