Hey guys.
I wanna use a Text.contain function with a check which will go like this:
if ply:IsUserGroup(text.contain("admin"))
how will i do that?
string.find would be the function you're looking for.
[url]http://wiki.garrysmod.com/page/string/find[/url]
This example sets a boolean value to _bIsAdmin for your purpose.
[lua]local _group = string.lower( ply:GetNWString( "UserGroup" ) );
local _bIsAdmin = ( string.find( _group, "admin" ) > 0 );[/lua]
Sorry, you need to Log In to post a reply to this thread.