Defines a property that can be used to ignite entities (from Sandbox)
properties.Add( "ignite", {
MenuLabel ="#ignite", -- Name to display on the context menu
Order =999, -- The order to display this property relative to other properties
MenuIcon ="icon16/fire.png", -- The icon to display next to the property
Filter =function( self, ent, ply ) -- A function that determines whether an entity is valid for this propertyif ( !IsValid( ent ) ) thenreturnfalseendif ( ent:IsPlayer() ) thenreturnfalseendif ( !CanEntityBeSetOnFire( ent ) ) thenreturnfalseendif ( !gamemode.Call( "CanProperty", ply, "ignite", ent ) ) thenreturnfalseendreturn!ent:IsOnFire()
end,
Action =function( self, ent ) -- The action to perform upon using the property ( Clientside )self:MsgStart()
net.WriteEntity( ent )
self:MsgEnd()
end,
Receive =function( self, length, ply ) -- The action to perform upon using the property ( Serverside )local ent =net.ReadEntity()
if ( !properties.CanBeTargeted( ent, ply ) ) thenreturnendif ( !self:Filter( ent, ply ) ) thenreturnendent:Ignite( 360 )
end} )