Difference between revisions of "Lua:Flags"
From Fortress Forever Wiki
Jump to navigationJump to searchSqueek-10494 (talk | contribs) |
Squeek-10494 (talk | contribs) |
||
Line 85: | Line 85: | ||
... | ... | ||
end | end | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=Ammo | ||
+ | |usage=Returns a specific ammo type's ID; predominately used to add or remove ammo from a player | ||
+ | |flags= | ||
+ | {{Lua:Flag|Ammo.kShells|[[Reference:Ammo#Shell|Shell]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kCells|[[Reference:Ammo#Cell|Cell]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kNails|[[Reference:Ammo#Nail|Nail]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kRockets|[[Reference:Ammo#Rocket|Rocket]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kDetpack|[[Reference:Ammo#Detpack|Detpack]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kManCannon|[[Reference:Ammo#Jump Pad|Jump Pad]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kGren1|[[Reference:Grenades|Primary grenade]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kGren2|[[Reference:Grenades|Secondary grenade]] ammo type}} | ||
+ | {{Lua:Flag|Ammo.kInvalid|Unknown}} | ||
+ | |example= | ||
+ | <code><pre> | ||
+ | local player = CastToPlayer( player_entity ) | ||
+ | |||
+ | player:AddAmmo( Ammo.kNails, 400 ) | ||
+ | player:AddAmmo( Ammo.kShells, 400 ) | ||
+ | player:AddAmmo( Ammo.kRockets, 400 ) | ||
+ | player:AddAmmo( Ammo.kCells, 400 ) | ||
+ | player:AddAmmo( Ammo.kDetpack, 1 ) | ||
+ | player:AddAmmo( Ammo.kManCannon, 1 ) | ||
</pre></code> | </pre></code> | ||
}} | }} | ||
[[Category:Lua]] | [[Category:Lua]] |
Revision as of 17:06, 20 December 2008
Team
Returns a specific team's ID
|
Example
local player = CastToPlayer( touch_entity )
if player:GetTeamId() == Team.kRed then
...
end
Grenade
Returns a specific grenade's ID
|
Example
local grenade = CastToGrenade( explode_entity )
if grenade:Type() == Grenade.kNormal then
...
end
Damage
Returns a specific damage type's ID; predominately used to detect fall damage
|
Example
local damagetype = damageinfo:GetDamageType()
if damagetype == Damage.kFall then
...
end
Ammo
Returns a specific ammo type's ID; predominately used to add or remove ammo from a player
|
Example
local player = CastToPlayer( player_entity )
player:AddAmmo( Ammo.kNails, 400 )
player:AddAmmo( Ammo.kShells, 400 )
player:AddAmmo( Ammo.kRockets, 400 )
player:AddAmmo( Ammo.kCells, 400 )
player:AddAmmo( Ammo.kDetpack, 1 )
player:AddAmmo( Ammo.kManCannon, 1 )