1. Post #1

    May 2012
    16 Posts
    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

  2. Post #2
    Gold Member
    Divran's Avatar
    April 2008
    2,624 Posts
    Code:
    for _, v in ipairs( target_plys ) do
            umsg.Start("ULX_Warn" , target)
                umsg.String(reason)
            umsg.End()
        end
    This should be
    Code:
    umsg.Start("ULX_Warn",target_plys)
    umsg.String(reason)
    umsg.End()
    Reply With Quote Edit / Delete Reply Windows 7 Sweden Show Events Lua Helper Lua Helper x 1Agree Agree x 1Disagree Disagree x 1Informative Informative x 1 (list)

  3. Post #3

    May 2012
    16 Posts
    Still warns everyone in the server. Scripts hate me.


    BUMP
    Sorry, but need help.

  4. Post #4
    Juze's Avatar
    November 2011
    57 Posts
    Code:
    for _, v in ipairs( target_plys ) do
            umsg.Start("ULX_Warn" , target)
                umsg.String(reason)
            umsg.End()
        end
    This should be
    Code:
    umsg.Start("ULX_Warn",target_plys)
    umsg.String(reason)
    umsg.End()
    I actually created this script. I did spot that error there, but it didn't change anything. We fixed it together with StpdKlown (or actually, he figured it out eventually). :)

    Also, it was a typo, I was supposed to have k,v instead of _,v. Here's the full script if anyone finds it useful:

    local CATEGORY_NAME = "Utility"
    
    function ulx.warn(calling_ply, target_plys, reason)
        for _, v in ipairs( target_plys ) do
            umsg.Start("ULX_Warn" , target_plys)
                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 dframe = vgui.Create("DFrame")
        dframe:SetSize(200,80)
        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)." )

    Works perfectly, no need to really use target_plys there as warning multiple people at once works anyway in usermessage, but I edited it anyway for your convenience.