1
0

Return early if the caller isn't valid

This commit is contained in:
Redox 2022-05-15 06:03:09 +02:00 committed by Brandon Sturgeon
parent ab5da86232
commit da7a73a070

View File

@ -22,13 +22,15 @@ E2Helper.Descriptions["plyGetSpeed"] = "Gets the speed of the player."
local plys = {}
net.Receive("wire_expression2_playercore_sendmessage", function( len, ply )
local ply = net.ReadEntity()
if not IsValid( ply ) then return end
if ply and not plys[ply] then
plys[ply] = true
-- printColorDriver is used for the first time on us by this chip
WireLib.AddNotify(msg1, NOTIFY_GENERIC, 7, NOTIFYSOUND_DRIP3)
WireLib.AddNotify(msg2, NOTIFY_GENERIC, 7)
chat.AddText(Color(255, 50, 50),"After this message, ", ply, " can send you a 100% realistically fake people talking, including admins.")
chat.AddText(Color(255, 50, 50),"Look the console to see if the message is form an expression2")
plys[ply] = true
-- printColorDriver is used for the first time on us by this chip
WireLib.AddNotify(msg1, NOTIFY_GENERIC, 7, NOTIFYSOUND_DRIP3)
WireLib.AddNotify(msg2, NOTIFY_GENERIC, 7)
chat.AddText(Color(255, 50, 50),"After this message, ", ply, " can send you a 100% realistically fake people talking, including admins.")
chat.AddText(Color(255, 50, 50),"Look the console to see if the message is form an expression2")
end
LocalPlayer():PrintMessage(HUD_PRINTCONSOLE, "[E2] " .. ply:Name() .. ": ")