darkrp force model

is there a way to force a custom model on a player. What i want to do is give my friend a custom skin without giving him a whole class i know this is most likely a simple if statement

I don’t remember where, but put this somewhere(appreciated if someone remembers where)

[lua]if( ply:SteamID() == “friends steamid” ) then
ply:SetModel( “modelpath” )

If anyone could help him out more, I’d appreciate it.

i dont even know why i made this post

hook.Add( “PlayerSetModel”, “FriendsModel”, function( pl )
if pl:SteamID() == “Your friends steam ID here.” then
pl:SetModel( “model/path/to/model.mdl” )
end )

I don’t know if DarkRP calls the PlayerSetModel hook in it, but if it does then that should work.

thanks man i hope it works

do i put it in player.lua


i tried it in a bunch of luas and it didnt work fuck oh well thanks anyway


lol i swear to god last question am i suppose to put something in “Friendsmodel”

Naw. Did you put it in the init.lua?

yeah and for some reason it still wont work

Can someone please help

Try the darkrp release thread alot of people here wont help people using darkrp

What i did was i put this code if not pl:SteamID() == “steamidhere” then
if CfgVars[“enforceplayermodel”] == 1 then
for k,v in pairs(RPExtraTeams) do
if ply:Team() == k then
if type(v.model) == “table” then
local ChosenModel = ply.rpChosenModel or ply:GetInfo(“rp_playermodel”)
ChosenModel = string.lower(ChosenModel)

				local found
				for _,Models in pairs(v.model) do
					if ChosenModel == string.lower(Models) then
						EndModel = Models
						found = true
				if not found then
					EndModel = v.model[math.random(#v.model)]
				EndModel = v.model

but whenever anyone else spawns put that player they are some weird stick figure thing what do i have to do

If you add that hook, go find GM:PlayerSpawn() and make sure it is calling GM:PlayerSetModel(), if it’s not add:


function PlayerSpawn(ply)
if  ply:SteamID == ("SteamID Here") then 

ply:SetModel ("models/name.mdl")

Wouldnt this work?

ill try what you said i just thought my big problem was that the cfgvar didnt let anyone when the value was one. I don’t want everyone changing their model as then rp will be totally messed up with people being gangsters but appearing as a swat officer