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.

DarkRP identifier for pm replys?

Discussion in 'DarkRP Modding Questions & Help' started by Quangasaurusrex, Aug 11, 2019.

  1. Is there any sort of DarkRP identifier for people who reply to Pms? I'm trying to make a /re command to reply back to the earliest private message, but so far I can only tell there are certain names like in this pm

    Code (Text):


    local function PM(ply, args)
        local namepos = string.find(args, " ")
        if not namepos then
            DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", DarkRP.getPhrase("arguments"), ""))
            return ""
        end


        local name = string.sub(args, 1, namepos - 1)
        local msg = string.sub(args, namepos + 1)


        if msg == "" then
            DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("invalid_x", DarkRP.getPhrase("arguments"), ""))
            return ""
        end


        local target = DarkRP.findPlayer(name)
        if target == ply then return "" end


        if target then
            local col = team.GetColor(ply:Team())
            local pname = ply:Nick()
            local col2 = Color(255, 255, 255, 255)
            DarkRP.talkToPerson(target, col, "(PM) " .. pname, col2, msg, ply)
            DarkRP.talkToPerson(ply, col, "(PM) " .. pname, col2, msg, ply)
        else
            DarkRP.notify(ply, 1, 4, DarkRP.getPhrase("could_not_find", tostring(name)))
        end


        return ""
    end
    DarkRP.defineChatCommand("pm", PM, 1.5)
     
     

Share This Page