• darkrp force model
    11 replies, posted
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" ) end[/lua] If anyone could help him out more, I'd appreciate it. i dont even know why i made this post
[lua] hook.Add( "PlayerSetModel", "FriendsModel", function( pl ) if pl:SteamID() == "Your friends steam ID here." then pl:SetModel( "model/path/to/model.mdl" ) end end ) [/lua] 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 [editline]04:47AM[/editline] i tried it in a bunch of luas and it didnt work fuck oh well thanks anyway [editline]04:58AM[/editline] 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 break end end if not found then EndModel = v.model[math.random(#v.model)] end else EndModel = v.model end break end end 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: [lua] hook.Add("PlayerSpawn","CallingSetModel",function(ply) GAMEMODE:PlayerSetModel(ply) end) [/lua]
[code]function PlayerSpawn(ply) if ply:SteamID == ("SteamID Here") then ply:SetModel ("models/name.mdl") end end[/code] 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
Sorry, you need to Log In to post a reply to this thread.