Two Questions; Pointshop Models and !donate command

I’m sure these are questions that have been asked, and I know they are since I’ve seen similar threads.
None of them helped me.

So I have two questions then :

#1 How would I go about adding custom models to the points shop?

#2 How would I make it so a chat command (such as !rules or !donate) would open the steam browser to a specific website.

Any help is appreciated.

To add custom models, go to the point shop addon folder/lua/items/playermodels
copy the kliener.lua
paste it rename it to modelname.lua
open it in notepad++
Rename ITEM.Name = “model name”
change the price in ITEM.Price
and on ITEM.Model
type the path to the model This is case sensitive
example
models/player/ironman.mdl

then go to
root/lua/autorun/server
and create a lua file called fastdl.lua
open it up and for every model do resource.AddFile
example
resource.AddFile( “models/player/ironman.mdl” )

There you go,

I’ll give that try when I’m up tomorrow, on my phone right now :P.
Thanks for answering, I’ll post results tomorrow :smiley:

Where i wrote “modelname” you change that to whatever your model name is, make sure for the .lua that its lower case and no spaces, here is an example of an iron man model

garrysmod/addons/pointshop-master/lua/items/playermodels/ironman.lua
inside ironman.lua
[lua]
ITEM.Name = ‘Iron Man’
ITEM.Price = 500
ITEM.Model = ‘models/player/ironman.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

function ITEM:PlayerSetModel(ply)
ply:SetModel(self.Model)
end
[/lua]
then in the fastdl.lua which is inside
garrysmod/lua/autorun/server
is
resource.AddFile( “models/player/ironman.mdl” )

Things to note:
when you type “models/player/ironman.mdl”
it will search the models in the servers root and in the addons folder,
so if your player model is in addons, example
garrysmod/addons/Iron Man Player Model/models/player/ironman.mdl
It will find that.

Just a simple lua command, not difficult to make




function forumCommand( pl, text, teamonly )
if (text == “!forum”) then
pl:SendLua([[gui.OpenURL(“http://yourpage.com/forum”)]]) – Change ADDRESS to your chosen page.
for k, v in pairs(player.GetAll()) do v:ChatPrint( “Player " … pl:Nick() … " is visiting our forums!” )

	end
end

end
hook.Add( “PlayerSay”, “fcommand”, forumCommand )




This is currently the one I’m using on my server.

Thanks jello!

That worked, and now I have one for anything else I want to add!

Really appreciate all the help, my questions have been answered.