Category:Buildable functions
From Fortress Forever Wiki
Jump to navigationJump to search
These are functions that can be applied to machines built by players, such as sentry guns. UsageCFFBuildableObject:function(parameters) or CFFSentryGun:function(parameters) or CFFDispener:function(parameters) Probably mancannons and detpacks would apply here as well Examplefunction player_killed ( player_victim, damageinfo ) -- if no damageinfo do nothing if not damageinfo then return end -- Entity that is attacking local attacker = damageinfo:GetAttacker() -- If no attacker do nothing if not attacker then return end elseif IsSentrygun(attacker) then attacker = CastToSentrygun(attacker) --attacker now refers to a CFFSentryGun object; --we can do sentry specific stuff, as well as general buildable stuff. player_attacker = attacker:GetOwner() --We now know who owns the sentry who killed this player end end CFFBuildableObject -- The basic form of buildable
CFFSentryGun -- Sentrygun is a type of buildable, and inherits all of the above.
|
This category currently contains no pages or media.