Provides many helpful player functions.
More...
Provides many helpful player functions.
The Player class works with ::VSLib.EasyLogic.Notifications and builds on the Entity class.
void VSLib.Player.AllowPickups |
( |
long int |
BTN_PICKUP, |
|
|
long int |
BTN_THROW |
|
) |
| |
|
private |
Enables Amnesia/HL2 style object pickups. Currently does not work.
void VSLib.Player.BeginValvePickupObjects |
( |
string |
pickupSound = "Defibrillator.Use" , |
|
|
string |
throwSound = "Adrenaline.NeedleOpen" |
|
) |
| |
|
private |
Enables Valve-style object pickups with the USE key (E key). Similar to the Gravity Gun effect.
bool VSLib.Player.CanSeeLocation |
( |
Vector |
targetPos, |
|
|
int |
tolerance = 50 |
|
) |
| |
|
private |
Returns true if this player can see the inputted location in their vision.
- Parameters
-
targetPos | The vector location that you want to check if the player can see. |
tolerance | The tolerence of the result. 75 is the default Source field of view. |
bool VSLib.Player.CanSeeOtherEntity |
( |
Entity |
otherEntity, |
|
|
int |
tolerance = 50 |
|
) |
| |
|
private |
Returns true if this player can see the inputted entity.
bool VSLib.Player.CanTraceToLocation |
( |
Vector |
finishPos, |
|
|
int |
traceMask |
|
) |
| |
|
private |
void VSLib.Player.ClientCommand |
( |
string |
str | ) |
|
|
private |
Sends a client command to the player entity.
bool VSLib.Player.Defib |
( |
| ) |
|
|
private |
Defibs a dead player (also checks if player is dead first). Returns true if the player was defibbed.
void VSLib.Player.DisablePickups |
( |
| ) |
|
|
private |
Stops Amnesia/HL2 style object pickups. Currently does not work.
void VSLib.Player.DropAllWeapons |
( |
| ) |
|
|
private |
void VSLib.Player.DropPickup |
( |
| ) |
|
|
private |
Drops the held HL2/Amnesia physics-based object or the valve-style object
void VSLib.Player.DropWeaponSlot |
( |
slot |
| ) |
|
|
private |
Drops a weapon from a slot.
You can use global constants SLOT_PRIMARY, SLOT_SECONDARY, SLOT_THROW, SLOT_MEDKIT (also works for defibs), SLOT_PILLS (also works for adrenaline etc)
void VSLib.Player.EndValvePickupObjects |
( |
| ) |
|
|
private |
bool VSLib.Player.Extinguish |
( |
| ) |
|
|
private |
Extinguish a burning player (also checks if player is on fire first). Returns true if the player was extinguished.
Entity VSLib.Player.GetActiveWeapon |
( |
| ) |
|
|
private |
string VSLib.Player.GetCharacterName |
( |
| ) |
|
|
private |
Gets the character name (not steam name). E.g. "Nick" or "Rochelle"
Player VSLib.Player.GetCurrentAttacker |
( |
| ) |
|
|
private |
Returns the Player entity of the current attacker, or null if there is no entity attacking this player. Note that this function will only return the current hunter, smoker, charger, or jockey attacker. Boomer, tank, and spitter cannot "continuously" trap the survivor and attack, so they will not be returned. If there is no SI attacking this player, then null is returned. This function is applicable for Survivors only.
double VSLib.Player.GetFlowDistance |
( |
| ) |
|
|
private |
double VSLib.Player.GetFlowPercent |
( |
| ) |
|
|
private |
int VSLib.Player.GetHealthBuffer |
( |
| ) |
|
|
private |
Gets the player's health buffer.
object [] VSLib.Player.GetHeldItems |
( |
| ) |
|
|
private |
Gets the player's valve inventory (molotov, weapons, pills, etc).
int VSLib.Player.GetInventory |
( |
string |
itemName | ) |
|
|
private |
object [] VSLib.Player.GetInventoryTable |
( |
| ) |
|
|
private |
Returns the player's inventory table. You can use it like this:
local inv = player.GetInventoryTable();
inv["itemName"] <- 25; // change quantity to 25
string VSLib.Player.GetIPAddress |
( |
| ) |
|
|
private |
Gets the player's IP address.
string VSLib.Player.GetLastAbilityUsed |
( |
| ) |
|
|
private |
Returns the last ability that this player used. E.g. "ability_lunge" or "ability_tongue" or "ability_vomit" or "ability_charge" or "ability_spit" or "ability_ride" This function is applicable for SI only.
Player VSLib.Player.GetLastAttacker |
( |
| ) |
|
|
private |
Returns the player's last attacker (the last person who hurt this player). Null is returned if the "attacker" is the world or some other invalid object.
Vector VSLib.Player.GetLastDeathLocation |
( |
| ) |
|
|
private |
Gets the position where the player last died, or null if the player has not died yet
Player VSLib.Player.GetLastDefibbedBy |
( |
| ) |
|
|
private |
Returns the entity or player that last defibbed this player. If this player has not been defibbed or hasn't been defibbed by a valid player entity, returns null.
Player VSLib.Player.GetLastKilledBy |
( |
| ) |
|
|
private |
Returns the entity or player that last killed this player. If this player has not been killed yet or the killer is an invalid object, returns null.
Entity VSLib.Player.GetLastShovedBy |
( |
| ) |
|
|
private |
Returns the entity or player that last shoved this player. If this player has not been shoved yet, returns null.
Entity VSLib.Player.GetLastUsed |
( |
| ) |
|
|
private |
Returns the entity that this player last tried to "Use". If the player has not tried to use anything yet, returns null.
Player VSLib.Player.GetLastVomitedBy |
( |
| ) |
|
|
private |
Gets the last player who vomited this player, or returns null if the player has not been vomited on yet OR has not been vomited on by a valid player
string VSLib.Player.GetName |
( |
| ) |
|
|
private |
Vector VSLib.Player.GetNearbyLocation |
( |
double |
radius | ) |
|
|
private |
Gets a valid path point within a radius.
int VSLib.Player.GetPlayerType |
( |
| ) |
|
|
private |
Returns the type of player. E.g. Z_SPITTER, Z_TANK, Z_SURVIVOR, Z_HUNTER, Z_JOCKEY, Z_SMOKER, Z_BOOMER, Z_CHARGER, Z_COMMON, or UNKNOWN.
int VSLib.Player.GetReviveCount |
( |
| ) |
|
|
private |
Gets the player's revive count, or null if the player does not have revive information yet
Vector VSLib.Player.GetSpawnLocation |
( |
| ) |
|
|
private |
Gets the player's spawn location.
string VSLib.Player.GetSteamID |
( |
| ) |
|
|
private |
int VSLib.Player.GetSurvivorSlot |
( |
| ) |
|
|
private |
int VSLib.Player.GetTeam |
( |
| ) |
|
|
private |
Returns the team that this player is currently on, e.g. SURVIVORS or INFECTED.
string VSLib.Player.GetUniqueID |
( |
| ) |
|
|
private |
Gets the player's Unqiue ID (clean, formatted Steam ID).
int VSLib.Player.GetUserId |
( |
| ) |
|
|
private |
Gets the userid of the player.
void VSLib.Player.Give |
( |
string |
str | ) |
|
|
private |
The "give" concommand.
- Parameters
-
str | What to give the entity (for example, "health") |
void VSLib.Player.GiveAdrenaline |
( |
double |
time | ) |
|
|
private |
Gives the entity an adrenaline effect
void VSLib.Player.GiveAmmo |
( |
int |
amount | ) |
|
|
private |
Gives ammo to the player.
void VSLib.Player.GiveUpgrade |
( |
string |
upgrade | ) |
|
|
private |
Gives the player an upgrade
bool VSLib.Player.HasAward |
( |
int |
award | ) |
|
|
private |
Returns true if the player has earned some kind of award this round. For example, award 67 is when a player protects another player. If you do HasAward(67), the function will return true if and only if the player has protected another player sometime that round. So, you ask, how do I find out which number is what? Good question! Trial and error. Use EasyLogic.Notifications.OnAwarded hook to find out what awards are given when you do something in-game. Then use the number you find out to do whatever it is that you need to do. You may be thinking that it sounds complicated, but it's easier with VSLib than if you were to do the same without it.
void VSLib.Player.Incapacitate |
( |
| ) |
|
|
private |
bool VSLib.Player.IsAlive |
( |
| ) |
|
|
private |
Returns true if the player is alive.
bool VSLib.Player.IsDead |
( |
| ) |
|
|
private |
Returns true if the player is dead.
bool VSLib.Player.IsDying |
( |
| ) |
|
|
private |
Returns true if the player is dying.
bool VSLib.Player.IsFrustrated |
( |
| ) |
|
|
private |
Returns true if the player is a tank and is frustrated
bool VSLib.Player.IsGhost |
( |
| ) |
|
|
private |
Returns true if the entity is in ghost mode (i.e. infected ghost).
bool VSLib.Player.IsHangingFromLedge |
( |
| ) |
|
|
private |
Returns true if the entity is hanging off a ledge.
bool VSLib.Player.IsIncapacitated |
( |
| ) |
|
|
private |
Returns true if the entity is incapped.
bool VSLib.Player.IsInEndingSafeRoom |
( |
| ) |
|
|
private |
Returns true if the player is currently in the ending saferoom.
bool VSLib.Player.IsNearStartingArea |
( |
| ) |
|
|
private |
Returns true if the player is still around the starting area. Note that they can be outside the saferoom and still AROUND the starting area. This function will return true if they are near where they first spawned.
bool VSLib.Player.IsOnFire |
( |
| ) |
|
|
private |
Returns true if the entity is on fire.
bool VSLib.Player.IsPlayerEntityValid |
( |
| ) |
|
|
private |
Returns true if the player entity is valid or false otherwise.
bool VSLib.Player.IsSurvivorTrapped |
( |
| ) |
|
|
private |
Returns true if the Survivor player is trapped by an SI attacker like smoker, hunter, charger, or jockey.
void VSLib.Player.Kill |
( |
| ) |
|
|
private |
void VSLib.Player.NativePickupObject |
( |
Entity |
otherEnt | ) |
|
|
private |
Picks up the given VSLib Entity object using native L4D2 function.
void VSLib.Player.PlaySound |
( |
string |
file | ) |
|
|
private |
Plays a sound file to the player.
void VSLib.Player.Remove |
( |
string |
weaponName | ) |
|
|
private |
Removes a player's weapon.
void VSLib.Player.RemoveUpgrade |
( |
string |
upgrade | ) |
|
|
private |
Removes the player's upgrade
bool VSLib.Player.Revive |
( |
| ) |
|
|
private |
Revives a player (also checks if player is incapped first). Returns true if the player was revived.
void VSLib.Player.SetDamageEnabled |
( |
bool |
isEnabled | ) |
|
|
private |
void VSLib.Player.SetFlashlight |
( |
bool |
turnFlashOn | ) |
|
|
private |
Changes the flashlight state.
void VSLib.Player.SetHealthBuffer |
( |
int |
value | ) |
|
|
private |
Sets the player's health buffer.
void VSLib.Player.SetHoldDamage |
( |
double |
dmg | ) |
|
|
private |
void VSLib.Player.SetInventory |
( |
string |
itemName, |
|
|
int |
quantity |
|
) |
| |
|
private |
void VSLib.Player.SetReviveCount |
( |
int |
count | ) |
|
|
private |
Sets the player's revive count. Setting the value high enough could also make them go black and white.
void VSLib.Player.SetThrowDamage |
( |
double |
dmg | ) |
|
|
private |
void VSLib.Player.Stagger |
( |
| ) |
|
|
private |
void VSLib.Player.StaggerAwayFromEntity |
( |
Entity |
otherEnt | ) |
|
|
private |
Staggers this entity away from another entity
void VSLib.Player.StaggerAwayFromLocation |
( |
Vector |
loc | ) |
|
|
private |
Staggers this entity away from another location
string VSLib.Player.StopSound |
( |
string |
file | ) |
|
|
private |
Stops a sound on the player.
bool VSLib.Player.ValvePickupPickupRange |
( |
double |
range | ) |
|
|
private |
bool VSLib.Player.ValvePickupThrowPower |
( |
double |
power | ) |
|
|
private |
bool VSLib.Player.WasEverVomited |
( |
| ) |
|
|
private |
Returns true if this player was ever vomited this round
The documentation for this class was generated from the following file: