General > Developers Corner

Trying to merge ulx adduser/removeuser and FAdmin setaccess into one

<< < (2/3) > >>

strategos:
Instead of doing that I'm just going to give overriding Fadmin to ulx usergroups a shot.

JamminR:
Strategos, you're going from a right track to something perhaps even more challenging.
The code examples you're showing should, with a bit of proper syntax, work.

LuaTenshi:
I said the following to Strategos in steam chat. (Its only slightly edited so excuse me for any grammar and or spelling mistakes.)


--- Quote from: HeLLFox_15 ---So what you do is check with ULX what rank they are in ULX (Using Gamemode.PlayerInitialSpawn), check if they are in a certain file (the file will be edited by the lua).
If they are not it will rank them and add thier SteamID to that file and put what ever rank they are beside it so it will look like STEAM_0:0:8767896.Admin
Every time some one joins, it will check their rank and steamID,
if they are already in the list under the same rank it wont do any thing how ever if their rank has changed it will go in the file look for the line that their steam ID is at
and change the rank name beside it, afcorse it will rank them in FAdmin before doing that.
So that is my idea, on how you can intergrade it.

I the following commands will help you.

http://wiki.garrysmod.com/?title=Gamemode.PlayerInitialSpawn
http://wiki.garrysmod.com/?title=File.Write
http://wiki.garrysmod.com/?title=File.Append
http://wiki.garrysmod.com/?title=File.Read

Good Luck. (Don't worry I am thinking of making the script. :P)

--- End quote ---

Also a question, would Player.IsUserGroup return what group a person is in ULX, if the server is running ULX?

Also how would I turn this...


--- Code: ---"superadmin"
{
"can_target" "!%officer, !%owner"
"team"
{
"color_green" "0"
"health" "200"
"color_red" "255"
"order" "4"
"index" "23"
"name" "Superadmins"
"color_blue" "0"
}
"allow"
{
"All of thier commands"
}
"inherit_from" "admin"
}
"user"
{
"can_target" "%user"
"team"
{
"color_red" "255"
"color_green" "212"
"order" "9"
"index" "28"
"name" "User"
"color_blue" "0"
}
"allow"
{
"All of thier commands"
}
}
"moderator"
{
"team"
{
"color_green" "129"
"color_red" "255"
"name" "Moderator"
"health" "101"
"order" "6"
"index" "25"
"maxHealth" "101"
"color_blue" "255"
}
"can_target" "!%officer,!%owner,!%admin,!%superadmin"
"allow"
{
"All of thier commands"
}
"inherit_from" "vip"
}
"admin"
{
"can_target" "!%superadmin,!%officer,!%owner"
"team"
{
"color_green" "255"
"health" "150"
"color_red" "0"
"order" "5"
"index" "24"
"name" "Admins"
"color_blue" "0"
}
"allow"
{
"All of thier commands"
"sbox_weapons" "access tag"
"weapons" "access tag"
}
"inherit_from" "moderator"
}

--- End code ---

into this...


--- Code: ---"superadmin"
"user"
"moderator"
"admin"

--- End code ---

The above transformation, makes it easier to get a list of all the created ranks built in, and custom.

Megiddo:
IsUserGroup is passed a string and returns true if the user belongs to that group you specify and false if they do not. This function is implemented by Garry.
GetUserGroup is implemented by us and should have been included in default gmod, in my opinion.

To get a list of groups, just take a peek at ULib.ucl.groups. The information stored below ULib.ucl is what ULib uses for all access control. Feel free to read from these tables, but do not change any of them or you may get strange behavior. :)

LuaTenshi:
I decided to kind of bump this, because it seems that more and more users are switching to RP, and better FAdmin compatibility never hurt any one.

I am going to start working on this gain as soon as I can.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version