[HOW TO] Skin Admin

Hello guys How me to make a skin only for the administrator?
That simple users couldn’t use it?
How to forbid to use a skin to users?


(User was banned for this post ("wrong section, didn't read the rules sticky" - postal))

Why do people use skin as a word to replace ‘model’? It just pisses me off.

@Sm63: What do you think someone with no lua knowledge can do with that function… nothing.



hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply)
if ply:IsAdmin() then
ply:SetModel("models/path/to/your/admin/model.mdl")
end
end)


Add this to a server-side lua file.

From my knowledge there were no changes from Garry’s Mod 12 to Garry’s Mod 13 about IsAdmin/IsSuperAdmin.
The first thing I did when I started coding was an admin mod :v:
And btw, you don’t have to include the IsSuperAdmin because if you read the wiki

would of been not so oblivious to you.

I’m sorry if I hurt your feelings, I edited my post.

It’s ok, you didn’t have to <3

How to forbid to use a skin to users?

The user group or certain users? If it’s the latter, use ply:SteamID() for specific players. If you mean the user group, if not ply:IsAdmin() or not ply:IsSuperAdmin().

Like freaky said,



hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply)
if ply:IsAdmin() then
ply:SetModel("models/path/to/your/admin/model.mdl")
end
end


Should work I’d assume.

It’s actually:



hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply)
    if ply:IsAdmin() then
        ply:SetModel("models/path/to/your/admin/model.mdl")
    end
end)


You probabbly forgot copying the ) at the end :stuck_out_tongue:

I just took it out because I don’t think it has a use…

It has to be there, otherwise it will cause a syntax error. Look closer :smiley:
hook.Add is a function: hook.Add(hookname, uniquename, function() end) - the last ) is required here.