LUA Mysteries

So sorry for posting in wrong area…

http://www.facepunch.com/threads/1181879?p=35836859#post35836859
That’s where the original post is now.

First off I have a ULX plugin that warns people, but instead of warning the target it warns everyone in the server.
I’ve looked at it over and over but notice nothing that is wrong.

Someone PLEASE help… Either add more code to it to make it work or change the code.


local CATEGORY_NAME = "Utility"

function ulx.warn(calling_ply, target_plys, reason)
    for _, v in ipairs( target_plys ) do
        umsg.Start("ULX_Warn" , target)
            umsg.String(reason)
        umsg.End()
    end
    if reason and reason ~= "" then
        ulx.fancyLogAdmin( calling_ply, "#A warned #T (#s)", target_plys, reason )
    else
        ulx.fancyLogAdmin( calling_ply, "#A warned #T", target_plys )
    end
end

usermessage.Hook("ULX_Warn",function(um)
    local reason = um:ReadString()
    --[[local pl = um:ReadEntity()
    
    local adminname
    if not ValidEntity(pl) then
        adminname = "(Unknown)"
    else
        adminname = pl:Nick()
    end]]
    
    local dframe = vgui.Create("DFrame")
    dframe:SetSize(200,80)
    --dframe:SetTitle("Warning from ".. adminname)
    dframe:SetTitle("You have received a warning")
    dframe:Center()
    dframe:MakePopup()
    
    local dtextentry = vgui.Create("DTextEntry" , dframe)
    dtextentry:SetPos(0,22)
    dtextentry:SetSize(200,58)
    dtextentry:SetMultiline(true)
    dtextentry:SetText(reason)
    dtextentry:SetEditable(false)
end )

local warn = ulx.command( CATEGORY_NAME, "ulx warn", ulx.warn, "!warn" )
warn:addParam{ type=ULib.cmds.PlayersArg }
warn:addParam{ type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine }
warn:defaultAccess( ULib.ACCESS_ADMIN )
warn:help( "Warns target(s)." )


I also have another problem. I can’t get the AWP in TTT to have a smokey trace after the bullet is shot, but it works perfectly in the gamemode “SniperWars.”

All three files should be located in there. (line_tracer), (ttt_awp), and (sniper_normal.)

http://www.mediafire.com/?4ko6buowo5fsqgc