Giter Site home page Giter Site logo

Comments (7)

Vurv78 avatar Vurv78 commented on June 14, 2024

Fyi that won't do anything unless the server has really bad code trusting the client because you can't modify serverside files.
You can see the file structure for where hook.lua should go

Also you could just modify the functions themselves, ie doing

debug.getregistry()["Player"].IsAdmin = function() return true end

from autorun-rs.

Aholicknight avatar Aholicknight commented on June 14, 2024

@Vurv78 The server I am on actually does have bad code, I did it with another script and I was able to access the custom debug menus.

And thank you, I will do what you suggested now

from autorun-rs.

Aholicknight avatar Aholicknight commented on June 14, 2024

@Vurv78

Also you could just modify the functions themselves, ie doing

debug.getregistry()["Player"].IsAdmin = function() return true end

So with this, what would the updated hook.lua be then?

from autorun-rs.

Vurv78 avatar Vurv78 commented on June 14, 2024

You wouldn't need hook.lua if you did that, would just be using autorun.lua.

Also just found out that is a completely lua function that uses Entity:GetNWString internally, so you would actually do something like

local Entity = debug.getregistry().Entity

local old = Entity.GetNWString
function Entity:GetNWString(key, fallback)
    if key == "UserGroup" and self == LocalPlayer() then return "superadmin" end
    return old(self, key, fallback)
end

from autorun-rs.

Aholicknight avatar Aholicknight commented on June 14, 2024

Thank you, I will see if this works.

from autorun-rs.

Aholicknight avatar Aholicknight commented on June 14, 2024

@Vurv78 Yup this works. Thank you! What would I have to add if I wanted to change ConVar's? (example: TestingMode = CreateConVar( "gmt_testing", 0, { FCVAR_ARCHIVE, FCVAR_DONTRECORD, FCVAR_REPLICATED }, "GMT testing mode" )) Is this even possible?

from autorun-rs.

Vurv78 avatar Vurv78 commented on June 14, 2024

Assuming it's implemented in C, CreateConVar returns a ConVar object, you can override the value a convar has by changing the methods like ConVar:GetInt() depending on ConVar:GetName().

Also ideally if you just want to mess with specific server scripts you could still use hook.lua to return modified versions of the scripts you manually make so you don't need to deal with hooking all these functions.

from autorun-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.