-
Notifications
You must be signed in to change notification settings - Fork 1
SprayMesh Extended
Chev edited this page Nov 6, 2023
·
4 revisions
A list of hooks for SprayMesh Extended can be found here.
None
Determines whether or not a spray should be placed.
This is serverside, meaning if the spray is blocked, it will be blocked for all players.
Arguments
- Player
ply
: The owner of the incoming spray. - table
tr
: TheTraceResult
data of the incoming spray.
Returns
Return false
to block the spray for all players, return anything else to allow it
Example
This example blocks sprays for users who are muted (via ULX/ULib).
hook.Add("SprayMesh.ShouldAllowSpray", "SprayMesh.ULXMute", function(ply, tr)
-- Block this player from placing their spray if they are muted (via ULX)
if ply.gimp then return false end
end)
Called when a spray is sent to all connected players.
Arguments
- Player
ply
: The owner of the spray. - string
url
: The URL of the spray. - Vector
hitpos
: The trace result hit position of the spray. In simplified terms, this is simply the spray's position in the world.
Returns
Does not return anything
Example
Log placed sprays to ULX logs.
hook.Add("SprayMesh.OnSpraySent", "SprayMesh.LogPlacedSpraysToULX", function(ply, url, hitpos)
local formatMsg = Format(
"[SprayMesh Extended] %s (Steam ID %s) placed a spray at %s (URL: %s)",
ply:Nick(),
ply:SteamID64(),
hitpos,
url
)
ulx.logString(formatMsg)
end)
Determines whether or not a spray should be placed.
This is clientside, meaning if the spray is blocked, it will only be blocked for that client.
Arguments
- table
sprayData
: The SprayData table (contains things like the player's Steam ID 64, player name, spray position, normal, etc.)
Returns
Return false
to block the spray for the client, return anything else to allow it