Ulysses
General => Developers Corner => Topic started by: xXshadowXx on September 13, 2009, 10:27:51 PM
-
If I want to do something in a script based on whether or not someone is in a particular Ulib usergroup, how would I go about doing it?
ie
function GiveTool (Ply)
if (USER IS IN GROUP "poweruser") then
Msg("he is a poweruser!")
Ply:Give("gmod_tool")
else
Msg("he's in some other group... so no toolgun for him.")
end
end
hook.Add( "PlayerSpawn", "GiveTool", GiveTool)
what would go here: (USER IS IN GROUP "poweruser")
also, is this the best way to do something like this? (i cant use LoadOut)
-
GetUserGroup (http://ulyssesmod.net/docs/files/lua/ULib/shared/sh_ucl-lua.html#Player:GetUserGroup) or CheckGroup, which is right below that. Both of these functions only exist in SVN right now, though!
-
cool thanks :)
-
I like using IsUserGroup("groupname"), IsAdmin(), and IsSuperAdmin().
It is really whatever you want to do. IsAdmin does all admin groups.