• Admin
    4 replies, posted
I got 2 questions dealing with admins. 1. Instead of searching if the user's Steam ID, is there anyway to have it check if the user's group is admin or superadmin? 2. In Lua, how do you make a player admin? I know there's either a console command or you can add their Steam ID to a certain .txt, but it'd be nice to know how to do it in Lua easier.
1. Take a look at [url=http://wiki.garrysmod.com/?title=Player.IsAdmin]this[/url], [url=http://wiki.garrysmod.com/?title=Player.IsSuperAdmin]this[/url], and [url=http://wiki.garrysmod.com/?title=Player.IsUserGroup]this[/url]. 2. Not sure.
function ccAdminCheck(ply) if ply:IsAdmin() or ply:IsSuperAdmin() then ply.ConCommand(msg, "This player is an admin of some kind!") else ply.ConCommand(msg, "This player is not an admin!") concommand.add("admincheck", ccAdminCheck) 2. ULX did it, look through their addgroup code.
[lua]ply:SetNWString( "UserGroup", "superadmin" )[/lua]
Ah, I don't like ULX so much because of how it works. I guess I can browse through that or ASS Mod. Thanks guys!
Sorry, you need to Log In to post a reply to this thread.