1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Fadmin Modification

Discussion in 'DarkRP Modding Questions & Help' started by Pipo The Doge, Sep 11, 2018.

  1. Pipo The Doge

    Pipo The Doge New Member

    I want to edit console logs of fadmin. I highly modified it to make all commands print logs.

    (FAdmin) BooNauL (STEAM_0:0:934287334) teleported EmPleH

    I want it to be to be able to see SteamID thought Console.

    (FAdmin) BooNauL (STEAM_0:0:934287334) teleported EmPleH (STEAM_0:1:23472743)

    I tried mofiying this but I can't do what I want :(


    Code (Text):
    function FAdmin.Messages.ActionMessage(ply, target, messageToPly, MessageToTarget, LogMSG)
        if not target then return end
        local Targets = (target.IsPlayer and target:IsPlayer() and target:Nick()) or ""
        local targetID = (target.IsPlayer and target:IsPlayer() and target:SteamID()) or "ERROR"
        local plyNick = IsValid(ply) and ply:IsPlayer() and ply:Nick() or "Console"
        local plySteamID = IsValid(ply) and ply:IsPlayer() and ply:SteamID() or "Console"
        local bad = false

        if ply ~= target then
            if type(target) == "table" then
                if #target == 0 then Targets = "no one" bad = true end
                for k, v in pairs(target) do
                    local suffix = ((k == #target-1) and " and ") or (k ~= #target and ", ") or ""
                    local Name = (v == ply and "yourself") or v:Nick()

                    if v ~= ply then FAdmin.Messages.SendMessage(v, 2, string.format(MessageToTarget, plyNick)) end
                    Targets = Targets .. Name .. suffix
                end
            else
                FAdmin.Messages.SendMessage(target, 2, string.format(MessageToTarget, plyNick))
            end

            FAdmin.Messages.SendMessage(ply, bad and 1 or 4, string.format(messageToPly, Targets))

        else
            FAdmin.Messages.SendMessage(ply, bad and 1 or 4, string.format(messageToPly, "yourself"))
        end
       
        local action = plyNick .. " (" .. plySteamID .. ") " .. string.format(LogMSG, Targets:gsub("yourself", "themselves"))
        FAdmin.Log("FAdmin Action: " .. action)

        local haspriv = fn.Partial(fn.Flip(FAdmin.Access.PlayerHasPrivilege), "SeeAdmins")
        local plys = fn.Filter(haspriv, player.GetAll())
        if #plys == 0 then return end
        FAdmin.Messages.ConsoleNotify(plys, action)
    end
    Please help.
     
  2. Dancore

    Dancore Member

    Where are you editing this file?
     
  3. Pipo The Doge

    Pipo The Doge New Member

    gamemodes\darkrp\gamemode\modules\fadmin\fadmin\messaging
     
  4. Dancore

    Dancore Member

    You shouldn't be messing with the core files, instead make a module. No one will help if you're messing with core files.

    https://corefiles.darkrp.eu/
     
    Last edited: Sep 20, 2018 at 6:32 AM
  5. Pipo The Doge

    Pipo The Doge New Member

    I cannot edit fadmin without touching core
     
  6. (FPtje) Atheos

    (FPtje) Atheos Main Developer Staff Member

    That function you can. Create a new file, use some gamemode loaded hook, override the function.
     
  7. Pipo The Doge

    Pipo The Doge New Member

    Please can you make an example to override fadmin/adminchat. Thanks for helping me with lua!
    --- Double Post Merged, Sep 16, 2018 ---
    Also please write the small code to make it show the target SteamID too ;)
     
  8. Dancore

    Dancore Member

    Its gonna be hard to find someone to write you a code, but guiding you is something I'm willing to do.
     
  9. Pipo The Doge

    Pipo The Doge New Member

    bump. I don't want to pay 10$ for a simple fucking lua script.
    --- Double Post Merged, Sep 20, 2018 at 9:32 PM ---
    bump again. Please @FPtje help me. I'm a good dog :(
     
    Last edited: Sep 20, 2018 at 9:32 PM
  10. "i highly modified this file"
    "need someone else to do it"
    "help am good dog"

    lol what
     

Share This Page