• xPermissions - Permission Denied.
    50 replies, posted
[QUOTE=tazy4tazy;33928022]Because, a owner will look in the database and think "God, I have to translate every SteamID in here." (fuuuuu face)[/QUOTE] Yes, because storing player names will help the owner bunches after they change their name.
[QUOTE=Derek_SM;33928071]Yes, because storing player names will help the owner bunches after they change their name.[/QUOTE] Ehh, what? I mean, if they change their name, it gets updated. so. Also, If anyone makes an admin mod, this can be very useful for seeing if a player has permission to kick/ban/godmode
If I was going to make my own admin mod (which I have), I would create my own permissions system.
Not tested (edited while deprived of sleep), but I think this is a lot more presentable of a script: [lua]if not sql.TableExists("xpermissions") then sql.Query("CREATE TABLE xpermissions (playername TINYTEXT, steamid TINYTEXT, permissions TEXT, PRIMARY KEY(steamid));") end hook.Add("PlayerInitialSpawn", "xPermissionsPlayerInitialSpawn", function(ply) local result = sql.QueryValue("SELECT permissions FROM `xpermissions` WHERE `steamID` = '"..ply:SteamID().."';") if result == nil or not result then sql.Query("INSERT INTO `xpermissions` (playername, steamid, permissions)VALUES('"..sql.SQLStr(ply:Nick()).."', '"..ply:SteamID().."', '');") ply:SetNWString("xpermissions", "") else sql.Query("UPDATE `xpermissions` SET playername='"..sql.SQLStr(ply:Nick()).."' WHERE `steamid` = '"..ply:SteamID().."';") ply:SetNWString("xpermissions", result) end end function _R.Player.GetPermissions() local perms = self:GetNWString("xpermissions") if string.find(perms ";") ~= nil then return string.Explode(";", perms) else return {} end end function _R.Player.HasPermission(perm) if type(perm) ~= "string" then return false end local plyperms = self:GetPermissions() return table.HasValue(plyperms, "*") or table.HasValue(plyperms, perm) end function _R.Player.SetPermissions(perms) if CLIENT then return false end if type(perms) ~= "table" then return false end sql.Query("UPDATE `xpermissions` SET permissions='"..table.concat(perms, ";").."' WHERE `steamid` = '"..self:SteamID().."';") self:SetNWString("xpermissions", table.concat(perms, ";")) end function _R.Player.GivePermission(perm) if CLIENT then return false end if type(perm) ~= "string" then return false end local perms = self:GetPermissions() table.insert(perms, perm) self:SetPermissions(perms) end function _R.Player.RemovePermission(perm) if CLIENT then return false end if type(perm) ~= "string" then return false end local newperms = {} for _,v in pairs(self:GetPermissions()) do if v ~= perm then table.insert(newperms, v) end end self:SetPermissions(newperms) end[/lua] Additionally, networked variables are slow and make people cringe. [editline]Taco[/editline] Don't get me wrong, I'm not trying to bash your release. I'm just trying to help you improve your Lua skills.
[QUOTE=tazy4tazy;33928106]Ehh, what? I mean, if they change their name, it gets updated. so. Also, If anyone makes an admin mod, this can be very useful for seeing if a player has permission to kick/ban/godmode[/QUOTE] Would it now? Read line 32 closely.
[QUOTE=tazy4tazy;33919257]I've been working on an addon called xPermissions, which is basicly something for Lua coders to implement into scripts.[/QUOTE] [url=http://wiki.bukkit.org/Setting_Up_Bukkit_Permissions]The entire concept is taken from Bukkit's community[/url] and makes far less sense in GMod's, where addons create their own inherent user interaction limitations without dependency on a separate library.
And any half-decent admin mod comes with useful functions like "player:HasAccess(ACCESS_KICK)" anyways Most of the time those admin mods also override _R.Player.IsAdmin accordingly so prop protections or anything like that can take advantage of it w/o requiring said HasAccess function.
You inspired me to make a really complex version of this using my frank (fruit rank) addon as its base, and with MySQL [thumb]http://www.bananatree.im/i/yF2lUjyeVrM.png[/thumb]
[QUOTE=amcfaggot;33929085][url=http://wiki.bukkit.org/Setting_Up_Bukkit_Permissions]The entire concept is taken from Bukkit's community[/url] and makes far less sense in GMod's, where addons create their own inherent user interaction limitations without dependency on a separate library.[/QUOTE] What if I don't want ASSMod and all those kinds of addons on my server? What if I want to base everything off of one particular rank system? There's nothing wrong with that.
[QUOTE=wauterboi;33930915]What if I don't want ASSMod and all those kinds of addons on my server? What if I want to base everything off of one particular rank system? There's nothing wrong with that.[/QUOTE] yeah this was actually the idea behind frank, everything managed by 1 system which can easily be modified to do what you need
[QUOTE=Banana Lord.;33933934]yeah this was actually the idea behind frank, everything managed by 1 system which can easily be modified to do what you need[/QUOTE] That was the idea I wanted to make with xPermissions. Also, how do you use Sublime Text's project thing?
[QUOTE=wauterboi;33930915]What if I don't want ASSMod and all those kinds of addons on my server? What if I want to base everything off of one particular rank system? There's nothing wrong with that.[/QUOTE] You're right, then the question becomes what if I do want to base everything off of one particular rank system, and that conflicts with another addon I already have. Now that you've created a plugin which relies on a system to eliminate interop issues, you've got to... oh wait, write more interop code to keep both Permissions, er, "xPermissions" and ASSMOD/ULX+ULib/etc. working together.
[QUOTE=amcfaggot;33942930]You're right, then the question becomes what if I do want to base everything off of one particular rank system, and that conflicts with another addon I already have. Now that you've created a plugin which relies on a system to eliminate interop issues, you've got to... oh wait, write more interop code to keep both Permissions, er, "xPermissions" and ASSMOD/ULX+ULib/etc. working together.[/QUOTE] What the hell? I just said [b]what if I don't want all those addons on my server?[/b] You make no sense, or maybe you're misreading what I wrote.
[QUOTE=wauterboi;33946428]What the hell? I just said [b]what if I don't want all those addons on my server?[/b] You make no sense, or maybe you're misreading what I wrote.[/QUOTE] I think you're missing my point. My point is, not everyone decides to not use all of those addons. Maybe they want to, or have a community where they need to use one of those. When you have such addons being used, to keep things from breaking you have to write additional interop code. Your situation calls for a user which uses nothing but plugins using xPermissions.
[QUOTE=amcfaggot;33949349]I think you're missing my point. My point is, not everyone decides to not use all of those addons. Maybe they want to, or have a community where they need to use one of those. When you have such addons being used, to keep things from breaking you have to write additional interop code. Your situation calls for a user which uses nothing but plugins using xPermissions.[/QUOTE] I just wanted to make xPermissions because alot of my scripts need something to use for permissions, because Player.IsAdmin isn't the best thing to use.
So you release something that is useful for pretty much just you.
Stop bashing.
I don't see any use for it, but did you fix your bug where it doesn't work on dedicated servers?
[QUOTE=amcfaggot;33949349]I think you're missing my point. My point is, not everyone decides to not use all of those addons. Maybe they want to, or have a community where they need to use one of those. When you have such addons being used, to keep things from breaking you have to write additional interop code. Your situation calls for a user which uses nothing but plugins using xPermissions.[/QUOTE] Why are you so stupid? I just said [b]no plugins or addons[/b]. None. That doesn't mean, "I'm using addons with xPermissions." That means I'm using xPermissions for [b]my own use[/b]. Why is that so hard to get through your brain?
[QUOTE=Chessnut;33952604]So you release something that is useful for pretty much just you.[/QUOTE] I don't see you releasing anything you snobby asshole. You can't speak for everyone, [b]someone[/b] might find it useful. You never know. [QUOTE=Banana Lord.;33930287]You inspired me to make a really complex version of this using my frank (fruit rank) addon as its base, and with MySQL [thumb]http://www.bananatree.im/i/yF2lUjyeVrM.png[/thumb][/QUOTE] your npp style looks like a fruit I'm sure all your first releases( if you even fucking have any), weren't top quality. He released something because [b]someone[/b] might find it useful, and get his name out there. So since all you 'pros', 90% of you which haven't released [b]anything[/b] or contributed anything( except for foolish criticism ), just stop? lol [QUOTE=wauterboi;33955643]Why are you so stupid? I just said [b]no plugins or addons[/b]. None. That doesn't mean, "I'm using addons with xPermissions." That means I'm using xPermissions for [b]my own use[/b]. Why is that so hard to get through your brain?[/QUOTE] No need to throw insults, and I assure you amcfaggot is not "so stupid", I can tell he's not and I don't even know him. Now, why don't you all just leave it at what it is and just leave this guy alone? You don't want to discourage him to never release anything again, he could, one day, release something great.
[QUOTE=LauScript;33956216]your npp style looks like a fruit[/QUOTE] Sublime Text 2 [img]http://www.facepunch.com/fp/emoot/engleft.gif[/img] But like you said, this release is just fine, even if it isn't very advanced yet. Some people might find it useful.
Sorry, you need to Log In to post a reply to this thread.