Difference between revisions of "Category:Player functions"

From Fortress Forever Wiki
Jump to navigationJump to search
(New page: This is just a dump of commands that we'll get to documenting later. These lack parameter information and the list is incomplete. ===Usage=== CFFPlayer:''function''(''parameters'') ===Ex...)
 
(Added explanations for player:functions)
Line 15: Line 15:
 
end</pre>
 
end</pre>
 
<pre>
 
<pre>
AddAmmo   ,   &CFFPlayer::LuaAddAmmo
+
AddAmmo([[Lua:Flags#Ammo]], integer) Gives ammunition to the player
  AddArmor   ,  &CFFPlayer::AddArmor
+
  AddArmor(integer) Gives armor to the player
  AddFrags   ,  &CFFPlayer::IncrementFragCount
+
  AddFrags(integer) Adds to the player's kill count
  AddFortPoints   ,   &CFFPlayer::AddFortPoints
+
  AddFortPoints(integer, string) Gives the player Fortress Points. String is an explanation for the points, eg. "Hunted Escape"
  AddHealth   ,  &CFFPlayer::AddHealth
+
  AddHealth(integer) Gives the player health points. Negative numbers will hurt the player
  GetClass   ,  &CFFPlayer::GetClassSlot
+
  integer GetClass() Returns the class of the player as a number (0-9)
  GetName   ,  &CFFPlayer::GetPlayerName
+
string GetClassName() Returns the class of the player as a string
  GetArmor   ,  &CFFPlayer::GetArmor
+
  string GetName() Returns the name of the player
  GetMaxArmor   ,  &CFFPlayer::GetMaxArmor
+
  integer GetArmor() Returns the player's armor level
  GetHealth   ,  &CFFPlayer::GetHealth
+
  integer GetMaxArmor() Returns the player's max armor
  GetMaxHealth   ,  &CFFPlayer::GetMaxHealth
+
  integer GetHealth() Returns the player's health points
  HasItem   ,  &CFFPlayer::HasItem
+
  integer GetMaxHealth() Returns the player's max health
  IsFeetDeepInWater   ,  &CFFPlayer::IsFeetDeepInWater
+
  boolean HasItem(string) returns true or false is the player is holding the named [[Lua:info_ff_script]]
  IsInNoBuild   ,  &CFFPlayer::IsInNoBuild
+
  boolean IsFeetDeepInWater()
  IsUnderWater   ,  &CFFPlayer::IsUnderWater
+
  boolean IsInNoBuild()
  IsWaistDeepInWater   ,  &CFFPlayer::IsWaistDeepInWater
+
  boolean IsUnderWater()
  IsInAttack1   ,  &CFFPlayer::IsInAttack1
+
  boolean IsWaistDeepInWater()
  IsInAttack2   ,  &CFFPlayer::IsInAttack2
+
  boolean IsInAttack1() Is the player pressing his *primary attack* key?
  IsInUse   ,  &CFFPlayer::IsInUse
+
  boolean IsInAttack2()
  IsInJump   ,  &CFFPlayer::IsInJump
+
  boolean IsInUse()
  IsInForward   ,  &CFFPlayer::IsInForward
+
  boolean IsInJump()
  IsInBack   ,  &CFFPlayer::IsInBack
+
  boolean IsInForward()
  IsInMoveLeft   ,  &CFFPlayer::IsInMoveLeft
+
  boolean IsInBack()
  IsInMoveRight   ,  &CFFPlayer::IsInMoveRight
+
  boolean IsInMoveLeft()
  IsInLeft   ,  &CFFPlayer::IsInLeft
+
  boolean IsInMoveRight()
  IsInRight   ,  &CFFPlayer::IsInRight
+
  boolean IsInLeft()
  IsInRun   ,  &CFFPlayer::IsInRun
+
  boolean IsInRight()
  IsInReload   ,  &CFFPlayer::IsInReload
+
  boolean IsInRun()
  IsInSpeed   ,  &CFFPlayer::IsInSpeed
+
  boolean IsInReload()
  IsInWalk   ,  &CFFPlayer::IsInWalk
+
  boolean IsInSpeed() same as walk?
  IsInZoom   ,  &CFFPlayer::IsInZoom
+
  boolean IsInWalk()
  IsOnGround   ,  &CFFPlayer::IsOnGround
+
  boolean IsInZoom()
  IsInAir   ,  &CFFPlayer::IsInAir
+
  boolean IsOnGround()
  IsDucking   ,  &CFFPlayer::IsDucking
+
  boolean IsInAir()
  MarkRadioTag   ,  &CFFPlayer::SetRadioTagged
+
  boolean IsDucking()
  RemoveAmmo  ,   &CFFPlayer::LuaRemoveAmmo
+
  MarkRadioTag() No uses found
  RemoveArmor  ,  &CFFPlayer::RemoveArmor
+
  AddAmmo([[Lua:Flags#Ammo]], integer) Takes ammunition from the player
  RemoveLocation   ,  &CFFPlayer::RemoveLocation
+
  AddArmor(integer) Takes armor from the player
  Respawn   ,  &CFFPlayer::KillAndRemoveItems
+
  RemoveLocation(entityId) Clears the player's location info? Never used.
  SetDisguisable   ,  &CFFPlayer::SetDisguisable
+
  Respawn() Respawn the player.
  IsDisguisable   ,  &CFFPlayer::GetDisguisable
+
  SetDisguisable(boolean) Allow/disallow a spy to use disguise
  SetCloakable   ,  &CFFPlayer::SetCloakable
+
  boolean IsDisguisable() returns whether the player is allowed to disguise
  IsCloakable   ,  &CFFPlayer::IsCloakable
+
  SetCloakable(boolean) Allow/disallow a spy to use cloak
  SetRespawnable   ,  &CFFPlayer::SetRespawnable
+
  boolean IsCloakable() returns whether the player is allowed to cloak
  IsRespawnable   ,  &CFFPlayer::IsRespawnable
+
  SetRespawnable(boolean) Send false to make players stay dead (unable to respawn).
  SetLocation   ,   &CFFPlayer::SetLocation
+
  boolean IsRespawnable() See above.
  SetRespawnDelay  ,  &CFFPlayer::LUA_SetPlayerRespawnDelay
+
  SetLocation(entityId, string, Lua:Flags#Team) Sends text to the player's location HUD. Team determines the color of the text.
  GetActiveWeaponName   ,   &CFFPlayer::GetActiveWeaponName
+
  SetRespawnDelay  Probably should send this an integer or float.
  GiveWeapon   ,   &CFFPlayer::GiveNamedItem
+
  string GetActiveWeaponName() returns the [[Lua:weapon_classes]] of the weapon equipped by the player, eg. "ff_weapon_spanner"
  RemoveWeapon   ,   &CFFPlayer::TakeNamedItem
+
  GiveWeapon(string) Give the player a weapon, specified by [[Lua:weapon_classes]]
  RemoveAllWeapons   ,  &CFFPlayer::RemoveAllItems
+
  RemoveWeapon(string) Take from the player a weapon, specified by [[Lua:weapon_classes]]
  IsCloaked   ,  &CFFPlayer::IsCloaked
+
  RemoveAllWeapons() Strip all the player's weapons.
  IsDisguised   ,  &CFFPlayer::IsDisguised
+
  boolean IsCloaked()
  GetDisguisedClass   ,  &CFFPlayer::GetDisguisedClass
+
  boolean IsDisguised()
  GetDisguisedTeam   ,  &CFFPlayer::GetDisguisedTeam
+
  integer GetDisguisedClass()
  AddEffect   ,   &CFFPlayer::LuaAddEffect
+
  integer GetDisguisedTeam()
  IsEffectActive   ,  &CFFPlayer::LuaIsEffectActive
+
  AddEffect( [[Lua:Flags#EF]], EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER ) Adds a status affect to the player
  RemoveEffect   ,  &CFFPlayer::LuaRemoveEffect
+
  boolean IsEffectActive [[Lua:Flags#EF]])
  GetSteamID   ,  &CFFPlayer::GetSteamID
+
  RemoveEffect( [[Lua:Flags#EF]]) Cancels a status effect on the player
  GetPing   ,  &CFFPlayer::GetPing
+
  integer GetSteamID()
  GetPacketloss   ,  &CFFPlayer::GetPacketloss
+
  integer GetPing()
  IsAlive   ,  &CFFPlayer::IsAlive
+
  GetPacketloss()
 +
  boolean IsAlive()
 
</pre>
 
</pre>
 
[[Category:Lua]]
 
[[Category:Lua]]
 
[[Category:Lua_Commands]]
 
[[Category:Lua_Commands]]

Revision as of 21:53, 15 February 2010

This is just a dump of commands that we'll get to documenting later. These lack parameter information and the list is incomplete.

Usage

CFFPlayer:function(parameters)

Example

function location_info:ontouch( touch_entity )

	-- set the location of the player
	if IsPlayer( touch_entity ) then
		local player = CastToPlayer( touch_entity )
		--this new variable is of type CFFPlayer; we can use any player function on it
		player:SetLocation(entity:GetId(), self.text, self.team)
	end
end
AddAmmo([[Lua:Flags#Ammo]], integer) Gives ammunition to the player
 AddArmor(integer) Gives armor to the player
 AddFrags(integer) Adds to the player's kill count
 AddFortPoints(integer, string) Gives the player Fortress Points. String is an explanation for the points, eg. "Hunted Escape"
 AddHealth(integer) Gives the player health points. Negative numbers will hurt the player
 integer GetClass() Returns the class of the player as a number (0-9)
 string GetClassName() Returns the class of the player as a string
 string GetName() Returns the name of the player
 integer GetArmor() Returns the player's armor level
 integer GetMaxArmor() Returns the player's max armor
 integer GetHealth() Returns the player's health points
 integer GetMaxHealth() Returns the player's max health
 boolean HasItem(string) returns true or false is the player is holding the named [[Lua:info_ff_script]]
 boolean IsFeetDeepInWater()
 boolean IsInNoBuild()
 boolean IsUnderWater()
 boolean IsWaistDeepInWater()
 boolean IsInAttack1() Is the player pressing his *primary attack* key?
 boolean IsInAttack2()
 boolean IsInUse()
 boolean IsInJump()
 boolean IsInForward()
 boolean IsInBack()
 boolean IsInMoveLeft()
 boolean IsInMoveRight()
 boolean IsInLeft()
 boolean IsInRight()
 boolean IsInRun()
 boolean IsInReload()
 boolean IsInSpeed() same as walk?
 boolean IsInWalk()
 boolean IsInZoom()
 boolean IsOnGround() 
 boolean IsInAir()
 boolean IsDucking()
 MarkRadioTag() No uses found
 AddAmmo([[Lua:Flags#Ammo]], integer) Takes ammunition from the player
 AddArmor(integer) Takes armor from the player
 RemoveLocation(entityId) Clears the player's location info? Never used.
 Respawn() Respawn the player.
 SetDisguisable(boolean) Allow/disallow a spy to use disguise
 boolean IsDisguisable() returns whether the player is allowed to disguise
 SetCloakable(boolean) Allow/disallow a spy to use cloak
 boolean IsCloakable() returns whether the player is allowed to cloak
 SetRespawnable(boolean) Send false to make players stay dead (unable to respawn).
 boolean IsRespawnable() See above.
 SetLocation(entityId, string, Lua:Flags#Team) Sends text to the player's location HUD. Team determines the color of the text.
 SetRespawnDelay   Probably should send this an integer or float.
 string GetActiveWeaponName() returns the [[Lua:weapon_classes]] of the weapon equipped by the player, eg. "ff_weapon_spanner"
 GiveWeapon(string) Give the player a weapon, specified by [[Lua:weapon_classes]]
 RemoveWeapon(string) Take from the player a weapon, specified by [[Lua:weapon_classes]]
 RemoveAllWeapons() Strip all the player's weapons.
 boolean IsCloaked()
 boolean IsDisguised() 
 integer GetDisguisedClass()
 integer GetDisguisedTeam()
 AddEffect( [[Lua:Flags#EF]], EFFECT_DURATION, ICON_DURATION, SPEED_MULTIPLIER ) Adds a status affect to the player
 boolean IsEffectActive [[Lua:Flags#EF]])
 RemoveEffect( [[Lua:Flags#EF]]) Cancels a status effect on the player
 integer GetSteamID()
 integer GetPing()
 GetPacketloss()
 boolean IsAlive()

This category currently contains no pages or media.