Player#

Functions related to the player entity and methods of the player object

bool IsAlive(entity ent)#
bool IsValid(entity ent)#
entity GetLocalViewPlayer()#

player you’re watching (can be replay)

entity GetLocalClientPlayer()#
array<entity> GetPlayerArray()#
array<entity> GetPlayerArrayEx(string class, int team, vector origin, float radius)#

returns a list of every player of the specified class in radius relative to origin. The parameter class must be one of these strings: titan, pilot or any.

array<entity> GetPlayerArrayOfTeam(int team)#

array of players from team index

array<entity> GetPlayerArrayOfTeam_Alive(int team)#

every player alive in team

array<entity> GetPlayerArrayOfEnemies_Alive(int team)#
array<entity> GetSortedPlayers(IntFromEntityCompare compareFunc, int team)#

returns list of every player in team sorted by compareFunc. If team is 0 returns a sorted array of every player. squirrel compare function example

GetSortedPlayers(int function(entity player1, entity player2) {
    if(player1.GetPlayerGameStat(PGS_PING)>player2.GetPlayerGameStat(PGS_PING))
        return 1

    else if(player1.GetPlayerGameStat(PGS_PING)<player2.GetPlayerGameStat(PGS_PING))
        return -1

    return 0 }, 0)
entity GetTitanFromPlayer(entity player)#

if the player is a titan, returns the player. If not, returns the player’s pet titan

int GetActivePilotLoadoutIndex(entity player)#
float GetHealthFrac(entity player)#
int GetPersistentSpawnLoadoutIndex(entity player, string playerClass)#

playerClasses: "pilot" "titan". This returns null for every other string.

PilotLoadoutDef GetPilotLoadoutFromPersistentData(entity player, int loadoutIndex)#

stored loadout data of player

float GetShieldHealthFrac(entity)#
void GiveArmor(entity player, int amount)#
void GivePilotLoadout(entity player, int loadout)#
void GiveWeaponPowerUp(entity player, string newWeapon)#
void AddThreatScopeColorStatusEffect(entity weaponOwner)#
int RemoveThreatScopeColorStatusEffect(entity player)#
bool IsInScoreboard(entity player)#
bool IsPartyMember(entity player)#
bool IsPlayerEliminated(entity player)#
bool IsPlayerFemale(entity player)#
bool IsRespawnAvailable(entity player)#
bool IsTitanAvailable(entity player)#
class player : public entity#
entity GetActiveWeapon()#
int GetActiveWeaponPrimaryAmmoLoaded()#
vector GetAngles()#

direction the entity is facing

entity GetAntiTitanWeapon()#
vector GetAttachmentAngles()#
vector GetAttachmentOrigin()#
int GetBodyGroupModelCount()#
string GetBossPlayerName()#
int GetCinematicEventFlags()#
entity GetCockpit()#
entity GetFirstPersonProxy()#
bool GetForcedDialogueOnly()#
int GetGen()#
float GetLastPingTime()#
int GetLevel()#
int GetLifeState()#
entity GetLocalClientPlayer()#
entity GetLocalViewPlayer()#
array<entity> GetMainWeapons()#
int GetMaxHealth()#
asset GetModelName()#
float GetNextTitanRespawnAvailable()#
int GetNumPingsAvailable()#
float GetObjectiveEndTime()#
entity GetObjectiveEntity()#
int GetObjectiveIndex()#

returns the index of the player objective. ObjIndex 0 means no objective

int GetObserverMode()#

returns either OBS_MODE_IN_EYE (first person) or OBS_MODE_CHASE (third person)

entity GetOffhandWeapon(int slot)#
array<entity> GetOffhandWeapons()#
vector GetOrigin()#

entity position

entity GetParent()#
entity GetPetTitan()#

auto titan of player

int GetPingGroupAccumulator()#
float GetPingGroupStartTime()#
string GetPlayerClass()#

“titan”, “spectator” or “pilot”

int GetPlayerGameStat(int PGS)#

returns the score of the player in the provided category. some categories are: PGS_KILLS, PGS_DEATHS, PGS_SCORE etc.

string GetPlayerName()#

player (origin) username

string GetPlayerNameWithClanTag()#
bool GetPlayerNetBool(string net_bool_name)#

example

GetPlayerNetBool( "shouldShowWeaponFlyout" )
string GetPlayerSettings()#
string GetPlayerSettingsField(string)#

some settings: "weaponClass" "gravityscale" "airSpeed" "airAcceleration"

int GetShieldHealth()#
int GetShieldHealthMax()#
int GetTeam()#
entity GetTitanSoul()#
if IsTitan() | player.GetPetTitan().GetTitanSoul() if !IsTitan()
vector GetVelocity()#
vector GetViewForward()#
entity GetViewModelEntity()#
vector GetViewRight()#
vector GetViewUp()#
vector GetViewVector()#
int GetWeaponAmmoStockpile()#
int GetXP()#
float GetZoomFrac()#

0.0 (no zoom) - 1.0 (full zoom)

void GiveOffhandWeapon(string name, int slot)#
void GiveWeapon(string weapon)#
void TakeOffhandWeapon(int offhandIndex)#

can be used for titans as well. some constants are: OFFHAND_ORDNANCE OFFHAND_SPECIAL OFFHAND_LEFT OFFHAND_INVENTORY OFFHAND_MELEE OFFHAND_EQUIPMENT OFFHAND_ANTIRODEO

void TakeWeaponNow(string weaponToSwitch)#
void SetActiveWeaponByName(string newWeapon)#
void SetBodygroup(int bodyGroupIndex, int stateIndex)#
void SetDodgePowerDelayScale(float delay)#
void SetHealth(int health)#
void SetLastPingTime(float time)#
void SetMaxHealth(int health)#
void SetNumPingsAvailable(int num)#
void SetNumPingsUsed(int num)#
void SetOrigin(vector origin)#
void SetPowerRegenRateScale(float scale)#
void SetShieldHealth(float health)#
void SetShieldHealthMax(float health)#
void SetTitanDisembarkEnabled(bool enabled)#
vector CameraPosition()#
void CockpitStartDisembark()#
bool ContextAction_IsActive()#
bool ContextAction_IsBusy()#
vector EyeAngles()#
vector EyePosition()#
int FindBodyGroup(string bodyGroup)#
int LookupAttachment(string attachment = "")#
void Lunge_ClearTarget()#
int Minimap_GetZOrder()#
bool HasBadReputation()#
bool HasMic()#
bool InPartyChat()#
bool IsEjecting()#
bool IsHologram()#
bool IsHuman()#
bool IsInThirdPersonReplay()#
bool IsMuted()#
bool IsPartyLeader()#
bool IsPhaseShifted()#
bool IsPlayer()#
bool IsScriptMenuOn()#
bool IsTalking()#
bool IsTitan()#
bool IsUsingOffhandWeapon()#
bool IsWatchingKillReplay()#
bool IsWatchingReplay()#
bool IsWeaponDisabled()#
bool Lunge_IsActive()#
bool PlayerMelee_IsAttackActive()#
entity GetMeleeWeapon()#