LUA Mysteries

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


for _, v in ipairs( target_plys ) do
        umsg.Start("ULX_Warn" , target)
            umsg.String(reason)
        umsg.End()
    end

This should be


umsg.Start("ULX_Warn",target_plys)
umsg.String(reason)
umsg.End()

Still warns everyone in the server. Scripts hate me.

BUMP
Sorry, but need help.

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). :slight_smile:

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:

[LUA]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).” )[/LUA]

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.