• [HOW TO] Skin Admin
    11 replies, posted
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? [highlight](User was banned for this post ("wrong section, didn't read the rules sticky" - postal))[/highlight]
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexdd36.html[/url] 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. [CODE] hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply) if ply:IsAdmin() then ply:SetModel("models/path/to/your/admin/model.mdl") end end) [/CODE] Add this to a server-side lua file.
[QUOTE=freakyy;44233433]@Sm63: Why do you link to the old wiki? What about the current? And what do you think someone with no lua knowledge can do with that function.. nothing. [/QUOTE] 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 [quote]Player.IsAdmin will return true is the player is an admin OR a superadmin. Therefore you don't need 2 separate checks[/quote] would of been not so oblivious to you.
I'm sorry if I hurt your feelings, I edited my post.
[QUOTE=freakyy;44233688]I'm sorry if I hurt your feelings, I edited my post.[/QUOTE] 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, [code] hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply) if ply:IsAdmin() then ply:SetModel("models/path/to/your/admin/model.mdl") end end [/code] Should work I'd assume.
It's actually: [code] hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply) if ply:IsAdmin() then ply:SetModel("models/path/to/your/admin/model.mdl") end end) [/code] You probabbly forgot copying the ) at the end :P
[QUOTE=freakyy;44236246]It's actually: [code] hook.Add("PlayerSpawn", "GiveAdminSkin", function(ply) if ply:IsAdmin() then ply:SetModel("models/path/to/your/admin/model.mdl") end end) [/code] You probabbly forgot copying the ) at the end :P[/QUOTE] I just took it out because I don't think it has a use...
It [B]has[/B] to be there, otherwise it will cause a syntax error. Look closer :D hook.Add is a function: hook.Add(hookname, uniquename, function() end) - the last ) is required here.
Sorry, you need to Log In to post a reply to this thread.