Player Properties

From GTA Network Wiki
Jump to: navigation, search

Player Properties

Table of properties (and/or methods) on the player:

Name Type Accessibility Description
isInVehicle Boolean Read-Only True or false if the player is in a vehicle or not.
vehicleSeat Int32 Read-Only Number of vehicle seat where the player is sitting.
team Int32 Writeable Get or set the player's team-number.
ping Int32 Read-Only Gets the player ping in milliseconds.
wantedLevel Int32 Writeable Wanted level of player.
name String Writeable The player's name.
socialClubName String Read-Only Player's Social Club name. (NOTE: Can be changed and/or spoofed!)
velocity Vector3 Read-Only? Get (and set?) the player's current velocity.
weapons GTANetworkShared.WeaponHash[] Writeable? Array of weapons the player has.
currentWeapon GTANetworkShared.WeaponHash Writeable? Get (and set?) which weapon the player is currently holding.
address String Read-Only Player IP-address.
seatbelt Boolean Read-Only? Get (and set?) True or False wether player is wearing a seatbelt or not.
health Int32 Writeable Get and set the player's health.
armor Int32 Writeable Get and set the player's armor.
onFire Boolean Read-Only True or False if the player is on fire or not.
isParachuting Boolean Read-Only True or False if the player is parachuting or not.
inFreefall Boolean Read-Only True or False if the player is in a free fall or not.
isAiming Boolean Read-Only True or False if the player is aiming or not.
isShooting Boolean Read-Only True or False if the player is shooting or not.
isReloading Boolean Read-Only True or False if the player is reloading or not.
isInCover Boolean Read-Only True or False if the player is covering or not.
isOnLadder Boolean Read-Only True or False if the player is on a ladder or not.
aimingPoint Vector3 Read-Only Coordinates of where the player's is aiming.
dead Boolean Read-Only True or False when the player is dead or not.
nametag String Writeable Text on the player's "3d label".
nametagVisible Boolean Writeable Get or Set wether the player's "3d label" should be visible or not.
nametagColor GTANetworkServer.Constant.Color Writeable The color of the player's "3d label".
spectating Boolean Writeable True or False if the player is on spectating or not.
freezePosition Boolean Writeable True or False if the player is frozen or not.
position Vector3 Writeable Get or set the coordinates of the player's position.
rotation Vector3 Writeable Get or set the coordinates of the player's rotation (view-angle).
IsNull Boolean UNKNOWN TBD
exists Boolean UNKNOWN TBD
type GTANetworkShared.EntityType UNKNOWN TBD
transparency Int32 Writeable Transparency of the player model.
dimension Int32 Writeable Get or set a player's virtual world.
invincible Boolean Writeable Sets a player invincible as in passive mode.
collisionless Boolean Writeable No collisions with other objects, not even the ground. Useful for a "free-fly" mode.
model Int32 Writeable "Skin" of the player.

Usage example(s)

.invincible

[Command("godmode")]
public void GodMode(Client player) {
	if(player.invincible) {
		player.invincible = false;
		API.sendChatMessageToPlayer(player, "GodMode Disabled!");
	} else {
		player.invincible = true;
		API.sendChatMessageToPlayer(player, "GodMode Enabled!");
	}
}


Page under construction!