[ Trouble Pointshop] Adding Items on TTT Server

Well, i’m starting on this and i’m trying to get a TTT Server. I add ULX and PointShop (and Pointshop Extras) and im trying to add custom skins to players but, when i do, the server download the files and in-game, we may to see that:

http://img689.imageshack.us/img689/1294/geau.png

I dont know why is this error but this is my lua files.

This is Item.lua


ITEM.Price = 3000
ITEM.Model = 'models/player/techknow/cpt_a.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

And this is the resource.lua


if ( SERVER ) then
player_manager.AddValidModel( "Captain America", "models/player/techknow/cpt_america/cpt_a.mdl" );


AddCSLuaFile( 'assassin.lua' ) ;
end


list.Set( "PlayerOptionsModel", "Captain America", "models/player/techknow/cpt_america/cpt_a.mdl" );


--// File Generated By Fox-Warrior's Resources Generator Version 2.06 \\--


if (SERVER) then
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.mdl" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.dx80" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.dx90" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.phy" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.sw" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.vvd" )
    resource.AddFile( "models/player/techknow/cpt_america/cpt_a.xbox" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/body.vmt" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/body.vtf" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/body_n.vtf" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/shield.vmt" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/shield.vtf" )
    resource.AddFile( "materials/models/player/techknow/cpt_america/shield_n.vtf" )
end


Change this:



ITEM.Model = 'models/player/techknow/cpt_a.mdl'


to:



ITEM.Model = 'models/player/techknow/cpt_america/cpt_a.mdl'


Also, for future reference, when you use resource.AddFile instead of resource.AddSingleFile, you only have to add the .mdl and .vmt. Garry’s Mod will automatically add the other ones (.dx80, .dx90, .vtf, etc) if they have the same name.

I changed and in game is the same, the “Error” model. I don’t know what i’m doing bad… Someone can help me, please??

Are you absolutely sure that you are downloading the model? If it “downloads” each time you connect, then it doesn’t actually download. It should only download once.

If you are, make sure the model is located in models/player/techknow/cpt_america/ folder.

Absolutely sure that i’m downloading the file because it download once a time and no more. And i’ve got on my models/player/cpt_america/ folder There’s the prove of that.

http://img843.imageshack.us/img843/5589/l7ru.png

The folder name on your screenshot is cpt_marvel, not cpt_america.

Hmmmm true, but i dont know why is cpt_marvel is created, i’ve downloaded and in my code there’s a “cpt_america” folder, not marvel… I’m trying to change this.

Edit: Well, i changed the folder’s name “cp_marvel” to “cpt_america” and the model continue being “ERROR”

You can’t just change a folder name, the model relies on the absolute paths.

  • The model in that folder not the one he’s specifying in pointshop item :v:

Ok then… I delete the folder in my GarrysMod game folder and let the server download again. In my resource.lua file i specified to download:

resource.AddFile( “models/player/techknow/cpt_america/cpt_a.mdl” )

So when i access to server, i download (again) the folder with models… To check if download the “cpt_america” folder or create another one… Then i edit this to solve this problem.

Edit: Ok. I did it. I deleted the folder “cpt_america” folder of my game and enter my server. It downloaded only 2 files “cpt_a.phy” and “cpt_a.vvd”. I changed again in resource.lua:


resource.AddFile( "models/player/techknow/cpt_a.mdl" )

to


resource.AddFile( "models/player/techknow/cpt_america/cpt_a.mdl" )

The server made me to download all model files. And when i enter the server (with all files on garrysmod folder) the same ERROR model. Someone have some idea what’s wrong?

C’mon guyz, i need some help with this! (BUMP)

You specified the wrong model in your pointshop item.
“models/player/techknow/cpt_a.mdl” should be “models/player/techknow/cpt_america/cpt_a.mdl”.