diff -r a/DARKRP/DarkRP/changelog.txt b/DARKRP/DarkRP/changelog.txt 0a1,12 > VERSION 2.2.19.9 (Ninth Maintenance Release for 2.2.19) > Feb 2, 2009 > Updated by: philxyz > > -- New > [Add by philxyz] Max 15% hunger on respawn to discourage respawn-snacking. > > -- Old > [Fix by philxyz] Can't vote "No". > [Removed by philxyz] rp_grant and rp_revoke functionality. Laggy and never used. > > 2c14 < Jan 25th, 2009 --- > Jan 25, 2009 56c68 < Jan 05, 2009 --- > Jan 5, 2009 389c401 < May 08, 2008 --- > May 8, 2008 405c417 < May 05, 2008 --- > May 5, 2008 420c432 < May 04, 2008 --- > May 4, 2008 438c450 < May 03, 2008 --- > May 3, 2008 488c500 < February 4, 2008 --- > Feb 4, 2008 496c508 < February 3, 2008 --- > Feb 3, 2008 514c526 < January 26, 2008 --- > Jan 26, 2008 557c569 < June 30, 2007 --- > Jun 30, 2007 597c609 < February 1, 2007 --- > Feb 1, 2007 625c637 < January 30, 2007 --- > Jan 30, 2007 632c644 < January 29, 2007 --- > Jan 29, 2007 diff -r a/DARKRP/DarkRP/gamemode/admincc.lua b/DARKRP/DarkRP/gamemode/admincc.lua 29c29 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 88c88 < if not (ply:EntIndex() == 0 or DB.HasPriv(ply, ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 212c212 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 235c235 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 262c262 < if not ply:HasPriv(ADMIN) then --- > if not (ply:IsAdmin() or ply:IsSuperAdmin()) then 302c302 < if not ply:HasPriv(ADMIN) then --- > if not (ply:IsAdmin() or ply:IsSuperAdmin()) then 335c335 < if not ply:HasPriv(ADMIN) then --- > if not (ply:IsAdmin() or ply:IsSuperAdmin()) then 358c358 < if not ply:HasPriv(ADMIN) then --- > if not (ply:IsAdmin() or ply:IsSuperAdmin()) then 382c382 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 416c416 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 470c470 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 509c509 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 536c536 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 593c593 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 638c638 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 693c693 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 738c738 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 755,759d754 < if (target:HasPriv(ADMIN) or target:IsAdmin() or target:IsSuperAdmin()) and (not ply:IsAdmin() or not ply:IsSuperAdmin()) then < ply:PrintMessage(2, "Normal RP admins can not kick or ban another admin!") < return < end < 775c770 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 788,792d782 < if (target:HasPriv(ADMIN) or target:IsAdmin() or target:IsSuperAdmin()) and (not ply:IsAdmin() or not ply:IsSuperAdmin()) then < ply:PrintMessage(2, "Normal RP admins can not kick or ban another admin!") < return < end < 918,1019d907 < function ccGrantPriv(ply, cmd, args) < if not ply:IsSuperAdmin() then < ply:PrintMessage(2, "You're not a super admin!") < return < end < < if not args[1] or (not args[1] and not args[2]) then < Msg("Usage: rp_grant [tool|phys|admin|prop|cp|mayor] [Nick|SteamID|UserID]\n") < return < end < < local target = FindPlayer(args[2]) < < if target then < if args[1] == "tool" then < DB.GrantPriv(target, TOOL) < Notify(target, 1, 4, ply:Nick() .. " has granted you toolgun priveleges.") < elseif args[1] == "admin" then < DB.GrantPriv(target, ADMIN) < Notify(target, 1, 4, ply:Nick() .. " has granted you admin priveleges.") < elseif args[1] == "phys" then < DB.GrantPriv(target, PHYS) < Notify(target, 1, 4, ply:Nick() .. " has granted you physgun priveleges.") < elseif args[1] == "prop" then < DB.GrantPriv(target, PROP) < Notify(target, 1, 4, ply:Nick() .. " has granted you prop spawn priveleges.") < elseif args[1] == "mayor" then < DB.GrantPriv(target, MAYOR) < Notify(target, 1, 4, ply:Nick() .. " has granted you /mayor priveleges.") < elseif args[1] == "cp" then < DB.GrantPriv(target, CP) < Notify(target, 1, 4, ply:Nick() .. " has granted you /cp priveleges.") < else < if ply:EntIndex() == 0 then < Msg("There is not a " .. args[1] .. " privilege!\n") < else < ply:PrintMessage(2, "There is not a " .. args[1] .. " privilege!") < end < end < else < if ply:EntIndex() == 0 then < Msg("Could not find player: " .. args[2] .. "\n") < else < ply:PrintMessage(2, "Could not find player: " .. args[2]) < end < return < end < end < concommand.Add("rp_grant", ccGrantPriv) < AddHelpLabel(-1, HELP_CATEGORY_ADMINCMD, "rp_grant [tool|phys|admin|prop|cp|mayor] [Nick|SteamID|UserID] - Gives a privilege to a player.") < < function ccRevokePriv(ply, cmd, args) < if not ply:IsSuperAdmin() then < ply:PrintMessage(2, "You're not a super admin!") < return < end < < if not args[1] or (not args[1] and not args[2]) then < Msg("Usage: rp_revoke [tool|phys|admin|prop|cp|mayor] [Nick|SteamID|UserID]\n") < return < end < < local target = FindPlayer(args[2]) < < if target then < if args[1] == "tool" then < DB.RevokePriv(target, TOOL) < Notify(target, 1, 4, ply:Nick() .. " has revoked your toolgun priveleges.") < elseif args[1] == "admin" then < DB.RevokePriv(target, ADMIN) < Notify(target, 1, 4, ply:Nick() .. " has revoked your admin priveleges.") < elseif args[1] == "phys" then < DB.RevokePriv(target, PHYS) < Notify(target, 1, 4, ply:Nick() .. " has revoked your physgun priveleges.") < elseif args[1] == "prop" then < DB.RevokePriv(target, PROP) < Notify(target, 1, 4, ply:Nick() .. " has revoked your prop spawn priveleges.") < elseif args[1] == "mayor" then < DB.RevokePriv(target, MAYOR) < Notify(target, 1, 4, ply:Nick() .. " has revoked your /mayor priveleges.") < elseif args[1] == "cp" then < DB.RevokePriv(target, CP) < Notify(target, 1, 4, ply:Nick() .. " has revoked your /cp priveleges.") < else < if ply:EntIndex() == 0 then < Msg("There is not a " .. args[1] .. " privilege!\n") < else < ply:PrintMessage(2, "There is not a " .. args[1] .. " privilege!") < end < end < else < if ply:EntIndex() == 0 then < Msg("Could not find player: " .. args[2] .. "\n") < else < ply:PrintMessage(2, "Could not find player: " .. args[2]) < end < return < end < end < concommand.Add("rp_revoke", ccRevokePriv) < AddHelpLabel(-1, HELP_CATEGORY_ADMINCMD, "rp_revoke [tool|phys|admin|prop|cp|mayor] [Nick|SteamID|UserID] - Revokes a privilege from a player.") < 1022c910 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 1033c921 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then 1044c932 < if not (ply:EntIndex() == 0 or ply:HasPriv(ADMIN)) then --- > if not (ply:EntIndex() == 0 or ply:IsAdmin() or ply:IsSuperAdmin()) then Only in a/DARKRP/DarkRP/gamemode: admins.lua diff -r a/DARKRP/DarkRP/gamemode/cl_helpvgui.lua b/DARKRP/DarkRP/gamemode/cl_helpvgui.lua 9c9 < self.title:SetText("DarkRP 2.2.19.8") --- > self.title:SetText("DarkRP 2.2.19.9") diff -r a/DARKRP/DarkRP/gamemode/cl_vgui.lua b/DARKRP/DarkRP/gamemode/cl_vgui.lua 59c59 < panel:SetMouseInputEnabled(inputenabled) --- > panel:SetMouseInputEnabled(true) 62c62 < local label = vgui.Create("DLabel") --- > local label = vgui.Create("Label") 75c75 < local ybutton = vgui.Create("DButton") --- > local ybutton = vgui.Create("Button") 79d78 < ybutton:SetCommand("!") 81d79 < ybutton:SetActionFunction(_G["YesVoteFunc" .. voteid]) 88,94c86 < table.insert(VoteVGUI, ybutton) < < _G["NoVoteFunc" .. voteid] = function(msg) < LocalPlayer():ConCommand("vote " .. voteid .. " 2\n") < end < < local nbutton = vgui.Create("DButton") --- > local nbutton = vgui.Create("Button") 98d89 < nbutton:SetCommand("!") diff -r a/DARKRP/DarkRP/gamemode/data.lua b/DARKRP/DarkRP/gamemode/data.lua 6d5 < sql.Query("CREATE TABLE IF NOT EXISTS darkrp_privs('steam' TEXT NOT NULL, 'admin' INTEGER NOT NULL, 'mayor' INTEGER NOT NULL, 'cp' INTEGER NOT NULL, 'tool' INTEGER NOT NULL, 'phys' INTEGER NOT NULL, 'prop' INTEGER NOT NULL, PRIMARY KEY('steam'));") 16d14 < DB.CreatePrivs() 23,53d20 < function DB.CreatePrivs() < if reset_all_privileges_to_these_on_startup then < sql.Begin() < sql.Query("DELETE FROM darkrp_privs;") < local already_inserted = {} < for k, v in pairs(Person) do < local admin = 0 < local mayor = 0 < local cp = 0 < local tool = 0 < local phys = 0 < local prop = 0 < for a, b in pairs(Person[k]) do < if b == ADMIN then admin = 1 end < if b == MAYOR then mayor = 1 end < if b == CP then cp = 1 end < if b == TOOL then tool = 1 end < if b == PHYS then phys = 1 end < if b == PROP then prop = 1 end < end < if already_inserted[Person[k]] then < sql.Query("UPDATE darkrp_privs SET admin = " .. admin .. ", mayor = " .. mayor .. ", cp = " .. cp .. ", tool = " .. tool .. ", phys = " .. phys .. ", prop = " .. prop .. " WHERE steam = " .. sql.SQLStr(Person[k]) .. ";") < else < sql.Query("INSERT INTO darkrp_privs VALUES(" .. sql.SQLStr(k) .. ", " .. admin .. ", " .. mayor .. ", " .. cp .. ", " .. tool .. ", " .. phys .. ", " .. prop .. ");") < already_inserted[Person[k]] = true < end < end < sql.Commit() < end < end < 96,190d62 < function DB.Priv2Text(priv) < if priv == ADMIN then < return "admin" < elseif priv == MAYOR then < return "mayor" < elseif priv == CP then < return "cp" < elseif priv == TOOL then < return "tool" < elseif priv == PHYS then < return "phys" < elseif priv == PROP then < return "prop" < else < return false < end < end < < function DB.HasPriv(ply, priv) < if priv == ADMIN and (ply:IsSuperAdmin() or ply:IsAdmin()) then return true end < < local p = DB.Priv2Text(priv) < if not p then return false end < < -- If there is a current cache of priveleges < if DB.privcache then < -- If there is a cache structure for this user < if DB.privcache[ply:SteamID()] then < -- If the cache indicates that they have the privilege < if DB.privcache[ply:SteamID()][priv] == 1 then < return true < else < return false < end < -- If there is no cache for this user < else < -- Find out whether they have this privelege < local result = tonumber(sql.QueryValue("SELECT " .. sql.SQLStr(p) .. " FROM darkrp_privs WHERE steam = " .. sql.SQLStr(ply:SteamID()) .. ";")) < < DB.privcache[ply:SteamID()] = {} < < -- Create cache entries based on the database status < if result == 1 then < DB.privcache[ply:SteamID()][priv] = 1 < return true < else < DB.privcache[ply:SteamID()][priv] = 0 < return false < end < end < -- If the cache is nonexistent < else < local result = tonumber(sql.QueryValue("SELECT " .. sql.SQLStr(p) .. " FROM darkrp_privs WHERE steam = " .. sql.SQLStr(ply:SteamID()) .. ";")) < < DB.privcache = {} < DB.privcache[ply:SteamID()] = {} < < if result == 1 then < DB.privcache[ply:SteamID()][priv] = 1 < return true < else < DB.privcache[ply:SteamID()][priv] = 0 < return false < end < end < end < < function DB.GrantPriv(ply, priv) < local steamID = ply:SteamID() < local p = DB.Priv2Text(priv) < if not p then return false end < if tonumber(sql.QueryValue("SELECT COUNT(*) FROM darkrp_privs WHERE steam = " .. sql.SQLStr(steamID) .. ";")) > 0 then < sql.Query("UPDATE darkrp_privs SET " .. p .. " = 1 WHERE steam = " .. sql.SQLStr(steamID) .. ";") < else < sql.Begin() < sql.Query("INSERT INTO darkrp_privs VALUES(" .. sql.SQLStr(steamID) .. ", 0, 0, 0, 0, 0, 0);") < sql.Query("UPDATE darkrp_privs SET " .. p .. " = 1 WHERE steam = " .. sql.SQLStr(steamID) .. ";") < sql.Commit() < end < -- privelege structure altered, regenerate cache on lookups < DB.privcache = nil < return true < end < < function DB.RevokePriv(ply, priv) < local steamID = ply:SteamID() < local p = DB.Priv2Text(priv) < local val = tonumber(sql.QueryValue("SELECT COUNT(*) FROM darkrp_privs WHERE steam = " .. sql.SQLStr(steamID) .. ";")) < if not p or val < 1 then return false end < sql.Query("UPDATE darkrp_privs SET " .. p .. " = 0 WHERE steam = " .. sql.SQLStr(steamID) .. ";") < -- privelege structure altered, regenerate cache on lookups < DB.privcache = nil < return true < end < diff -r a/DARKRP/DarkRP/gamemode/init.lua b/DARKRP/DarkRP/gamemode/init.lua 154d153 < include("admins.lua") 441c440 < GM.Name = "DarkRP 2.2.19.8" --- > GM.Name = "DarkRP 2.2.19.9" diff -r a/DARKRP/DarkRP/gamemode/main.lua b/DARKRP/DarkRP/gamemode/main.lua 176c176 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 196c196 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 210c210 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 319c319 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 428c428 < if not ply:HasPriv(ADMIN) and not ply:IsAdmin() and not ply:IsSuperAdmin() then return "" end --- > if not ply:IsAdmin() and not ply:IsSuperAdmin() then return "" end 472c472 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 522c522 < if ValidEntity(trace.Entity) and trace.Entity.SID and (trace.Entity.SID == ply.SID or ply:HasPriv(ADMIN)) then --- > if ValidEntity(trace.Entity) and trace.Entity.SID and (trace.Entity.SID == ply.SID or ply:IsAdmin() or ply:IsSuperAdmin()) then 539c539 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 551c551 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 560c560 < if ply:HasPriv(ADMIN) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 999c999 < if (ply:Team() == TEAM_CHIEF and CfgVars["chiefjailpos"] == 1) or ply:HasPriv(ADMIN) then --- > if (ply:Team() == TEAM_CHIEF and CfgVars["chiefjailpos"] == 1) or ply:IsAdmin() or ply:IsSuperAdmin() then 1015c1015 < if (ply:Team() == TEAM_CHIEF and CfgVars["chiefjailpos"] == 1) or ply:HasPriv(ADMIN) then --- > if (ply:Team() == TEAM_CHIEF and CfgVars["chiefjailpos"] == 1) or ply:IsAdmin() or ply:IsSuperAdmin() then 1168c1168 < if ply:HasPriv(CP) or ply:HasPriv(ADMIN) or ply:HasPriv(MAYOR) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 1179c1179 < if ply:HasPriv(ADMIN) or ply:HasPriv(MAYOR) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 1582c1582 < if ply:HasPriv(ADMIN) or ply:HasPriv(MAYOR) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 1602c1602 < if ply:HasPriv(CP) or ply:HasPriv(ADMIN) or ply:HasPriv(MAYOR) then --- > if ply:IsAdmin() or ply:IsSuperAdmin() then 1669c1669 < if ply:Team() == TEAM_MAYOR or ply:HasPriv(ADMIN) then --- > if ply:Team() == TEAM_MAYOR or ply:IsAdmin() or ply:IsSuperAdmin() then 1685c1685 < if ply:Team() == TEAM_MAYOR or ply:HasPriv(ADMIN) then --- > if ply:Team() == TEAM_MAYOR or ply:IsAdmin() or ply:IsSuperAdmin() then 1740c1740 < if not ply:HasPriv(ADMIN) then --- > if not (ply:IsAdmin() or ply:IsSuperAdmin()) then 1765c1765 < if ply:HasPriv(ADMIN) then return true end --- > if ply:IsAdmin() or ply:IsSuperAdmin() then return true end 1789c1789 < if CfgVars["propspawning"] == 1 or ply:HasPriv(ADMIN) or ply:HasPriv(PROP) then --- > if CfgVars["propspawning"] == 1 or ply:IsAdmin() or ply:IsSuperAdmin() then diff -r a/DARKRP/DarkRP/gamemode/modules/HungerMod.lua b/DARKRP/DarkRP/gamemode/modules/HungerMod.lua 21c21 < ply:SetNWInt("Energy", 100) --- > if ply:GetNWInt("Energy") < 15 then ply:SetNWInt("Energy", 15) end diff -r a/DARKRP/DarkRP/gamemode/player.lua b/DARKRP/DarkRP/gamemode/player.lua 49,52d48 < < if self:IsSuperAdmin() or self:IsAdmin() then < self:GrantPriv(ADMIN) < end 89,96d84 < function meta:HasPriv(priv) < return DB.HasPriv(self, priv) < end < < function meta:GrantPriv(priv) < return DB.GrantPriv(self, priv) < end < 669c657 < if CfgVars["toolgun"] == 1 or ply:HasPriv(ADMIN) or ply:HasPriv(TOOL) then --- > if CfgVars["toolgun"] == 1 or ply:IsAdmin() or ply:IsSuperAdmin() then 673c661 < if CfgVars["physgun"] == 1 or ply:HasPriv(ADMIN) or ply:HasPriv(PHYS) then --- > if CfgVars["physgun"] == 1 or ply:IsAdmin() or ply:IsSuperAdmin() then 677c665 < if team == TEAM_POLICE or team == TEAM_CHIEF or ply:HasPriv(ADMIN) then --- > if team == TEAM_POLICE or team == TEAM_CHIEF or ply:IsAdmin() or ply:IsSuperAdmin() then 739c727 < ply:PrintMessage(HUD_PRINTTALK, "This server is running DarkRP 2.2.19.8") --- > ply:PrintMessage(HUD_PRINTTALK, "This server is running DarkRP 2.2.19.9") diff -r a/DARKRP/DarkRP/info.txt b/DARKRP/DarkRP/info.txt 4c4 < "version" "2.2.19.8" --- > "version" "2.2.19.9" diff -r a/DARKRP/README.TXT b/DARKRP/README.TXT 1c1 < ****** Instructions for DarkRP 2.2.19.8 with Spacetech's Simple Prop Protection v1.5 ****** --- > ****** Instructions for DarkRP 2.2.19.9 with Spacetech's Simple Prop Protection v1.5 ******