Difference between revisions of "Lua:Flags"
From Fortress Forever Wiki
Jump to navigationJump to searchSqueek-10494 (talk | contribs) |
|||
Line 143: | Line 143: | ||
player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER ) | player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER ) | ||
+ | </pre></code> | ||
+ | }} | ||
+ | |||
+ | {{Lua:FlagType | ||
+ | |prefix=AT | ||
+ | |usage=Returns a specific "apply to" ID; Applies various commands to players, or to the entire server. Use with [[ApplyToAll]](ApplyToFlags), [[ApplyToTeam]](team, ApplyToFlags), or [[ApplyToPlayer]](player, ApplyToFlags) (not all flags are suitable for all functions). | ||
+ | |flags= | ||
+ | {{Lua:Flag|AT.kKillPlayers|}} | ||
+ | {{Lua:Flag|AT.kRespawnPlayers|}} | ||
+ | {{Lua:Flag|AT.kDropItems|}} | ||
+ | {{Lua:Flag|AT.kForceDropItems|}} | ||
+ | {{Lua:Flag|AT.kThrowItems|}} | ||
+ | {{Lua:Flag|AT.kForceThrowItems|}} | ||
+ | {{Lua:Flag|AT.kReturnCarriedItems|}} | ||
+ | {{Lua:Flag|AT.kReturnDroppedItems|}} | ||
+ | {{Lua:Flag|AT.kRemoveRagdolls|}} | ||
+ | {{Lua:Flag|AT.kRemovePacks|}} | ||
+ | {{Lua:Flag|AT.kRemoveProjectiles|}} | ||
+ | {{Lua:Flag|AT.kRemoveBuildables|}} | ||
+ | {{Lua:Flag|AT.kRemoveDecals|}} | ||
+ | {{Lua:Flag|AT.kEndMap|}} | ||
+ | {{Lua:Flag|AT.kReloadClips|}} | ||
+ | {{Lua:Flag|AT.kAllowRespawn|}} | ||
+ | {{Lua:Flag|AT.kDisallowRespawn|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kChangeClassScout|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSniper|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSoldier|}} | ||
+ | {{Lua:Flag|AT.kChangeClassDemoman|}} | ||
+ | {{Lua:Flag|AT.kChangeClassMedic|}} | ||
+ | {{Lua:Flag|AT.kChangeClassHWGuy|}} | ||
+ | {{Lua:Flag|AT.kChangeClassPyro|}} | ||
+ | {{Lua:Flag|AT.kChangeClassSpy|}} | ||
+ | {{Lua:Flag|AT.kChangeClassEngineer|}} | ||
+ | {{Lua:Flag|AT.kChangeClassCivilian|}} | ||
+ | {{Lua:Flag|AT.kChangeClassRandom|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kChangeTeamBlue|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamRed|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamYellow|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamGreen|}} | ||
+ | {{Lua:Flag|AT.kChangeTeamSpectator|}} | ||
+ | |||
+ | {{Lua:Flag|AT.kStopPrimedGrens|}} | ||
+ | |||
+ | |example= | ||
+ | <code><pre> | ||
+ | ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips }) | ||
</pre></code> | </pre></code> | ||
}} | }} | ||
[[Category:Lua]] | [[Category:Lua]] |
Revision as of 20:45, 11 May 2009
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 )
EF
Returns a specific status effect's ID
|
Example
local player = CastToPlayer( player_entity )
SPEED_MULTIPLIER = 2.0
EFFECT_DURATION = -1 -- Infinite duration
ICON_DURATION = 0
player:AddEffect( EF.kSpeedlua1, EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER )
AT
Returns a specific "apply to" ID; Applies various commands to players, or to the entire server. Use with ApplyToAll(ApplyToFlags), ApplyToTeam(team, ApplyToFlags), or ApplyToPlayer(player, ApplyToFlags) (not all flags are suitable for all functions).
|
Example
ApplyToAll({ AT.kRemovePacks, AT.kRemoveProjectiles, AT.kRespawnPlayers, AT.kRemoveBuildables, AT.kRemoveRagdolls, AT.kStopPrimedGrens, AT.kReloadClips })