Difference between revisions of "Category:Buildable functions"
From Fortress Forever Wiki
Jump to navigationJump to search (New page: These are functions that can be applied to machines built by players, such as sentry guns. ===Usage=== CFFBuildableObject:''function''(''parameters) or CFFSentryGun:''function''(''param...) |
(No difference)
|
Revision as of 09:10, 12 May 2009
These are functions that can be applied to machines built by players, such as sentry guns.
Usage
CFFBuildableObject:function(parameters)
or
CFFSentryGun:function(parameters)
or
CFFDispener:function(parameters)
Probably mancannons and detpacks would apply here as well
Example
function 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
- GetTeamId
- GetOwner
- GetTeam
CFFSentryGun -- Sentrygun is a type of buildable
- GetLevel
This category currently contains no pages or media.