From GTA Network Wiki
(Redirected from Player Properties)
Jump to: navigation, search

Client class

dialog-warning.pngRework required!

The contents of this page are possibly invalid or incomplete. Please treat the contents of this page with caution!

If you are able to, please modify the page so that it's factually correct.

The Client class represent a player in your server.

Client inherits the Entity class.



using GTANetworkServer;

Client (Player) Properties

Name Type Accessibility Description
handle GTANetworkShared.NetHandle Writeable Handle of the player.
vehicle GTANetworkServer.Vehicle Read-Only  ?
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!)
isCEFenabled Boolean Read-Only  ?
velocity GTANetworkShared.Vector3 Writeable Get (and set?) the player's current velocity.
weapons GTANetworkShared.WeaponHash[] Read-Only Array of weapons the player has.
currentWeapon GTANetworkShared.WeaponHash Read-Only Get (and set?) which weapon the player is currently holding.
address String Read-Only Player IP-address.
seatbelt Boolean Writeable 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 GTANetworkShared.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 Read-Only True or False if the player is on spectating or not.
freezePosition Boolean Writeable True or False if the player is frozen or not. (Not readable ?)
position GTANetworkShared.Vector3 Writeable Get or set the coordinates of the player's position.
rotation GTANetworkShared.Vector3 Writeable Get or set the coordinates of the player's rotation (view-angle).
IsNull Boolean Read-Only TBD
exists Boolean Read-Only TBD
type GTANetworkShared.EntityType Read-Only 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.

Client (Player) Methods

Name Return Parameters Description
get_handle() GTANetworkShared.NetHandle Getter of handle attribute.
get_vehicle() GTANetworkServer.Vehicle Getter of vehicle attribute.
get_isInVehicle() Boolean Getter of isInVehicle attribute.
get_vehicleSeat() Int32 Getter of vehicleSeat attribute.
get_team() Int32 Getter of team attribute.
get_ping() Int32 Getter of ping attribute.
get_wantedLevel() Int32 Getter of wantedLevel attribute.
get_name() String Getter of name attribute.
get_socialClubName() String Getter of socialClubName attribute.
get_isCEFenabled() Boolean Getter of isCEFenabled attribute.
get_velocity() GTANetworkShared.Vector3 Getter of velocity attribute.
get_weapons() GTANetworkShared.WeaponHash[] Getter of weapons attribute.
get_currentWeapon() GTANetworkShared.WeaponHash Getter of currentWeapon attribute.
get_address() String Getter of address attribute.
get_seatbelt() Boolean Getter of seatbelt attribute.
get_health() Int32 Getter of health attribute.
get_armor() Int32 Getter of armor attribute.
get_onFire() Boolean Getter of onFire attribute.
get_isParachuting() Boolean Getter of isParachuting attribute.
get_inFreefall() Boolean Getter of inFreefall attribute.
get_isAiming() Boolean Getter of isAiming attribute.
get_isShooting() Boolean Getter of isShooting attribute.
get_isReloading() Boolean Getter of isReloading attribute.
get_isInCover() Boolean Getter of isInCover attribute.
get_isOnLadder() Boolean Getter of isOnLadder attribute.
get_aimingPoint() GTANetworkShared.Vector3 Getter of aimingPoint attribute.
get_dead() Boolean Getter of dead attribute.
get_nametag() String Getter of nametag attribute.
get_nametagVisible() Boolean Getter of nametagVisible attribute.
get_nametagColor() GTANetworkServer.Constant.Color Getter of nametagColor attribute.
get_spectating() Boolean Getter of spectating attribute.
get_position() GTANetworkShared.Vector3 Getter of position attribute.
get_rotation() GTANetworkShared.Vector3 Getter of rotation attribute.
get_IsNull() Boolean Getter of IsNull attribute.
get_exists() Boolean Getter of exists attribute.
get_type() GTANetworkShared.EntityType Getter of type attribute.
get_transparency() Int32 Getter of transparency attribute.
get_dimension() Int32 Getter of dimension attribute.
get_invincible() Boolean Getter of invincible attribute.
get_collisionless() Boolean Getter of collisionless attribute.
get_model() Int32 Getter of model attribute.
ban() Void Ban the client(player).
ban() Void String reason Ban the client(player) with a reason.
freeze() Void Boolean freeze Freeze the player.
ban() Void String reason Ban the client(player) with a reason.
kill() Void Kill the player ?
detonateStickies() Void  ?
resetNametag() Void  ?
resetNametagColor() Void  ?
spectate() Void  ?
spectate() Void GTANetworkServer.Client player  ?
stopSpectating() Void  ?
set_freezePosition() Void Boolean value  ?
set_position() Void GTANetworkShared.Vector3 value  ?
set_rotation() Void GTANetworkShared.Vector3 value  ?
set_transparency() Void Int32 value  ?
set_dimension() Void Int32 value  ?
set_invincible() Void Boolean value  ?
set_collisionless() Void Boolean value  ?
delete() Void  ?
movePosition() Void GTANetworkShared.Vector3 target , Int32 duration  ?
moveRotation() Void GTANetworkShared.Vector3 target ,Int32 duration
attachTo() Void GTANetworkShared.NetHandle entity ,String bone , GTANetworkShared.Vector3 offset , GTANetworkShared.Vector3 rotation  ?
detach() Void  ?
detach() Void Boolean resetCollision  ?
createParticleEffect() Void String ptfxLib ,String ptfxName ,GTANetworkShared.Vector3 offset ,GTANetworkShared.Vector3 rotation ,System.Single scale ,Int32 bone  ?
setSyncedData() Void String key , System.Object value  ?
getSyncedData() System.Object String key  ?
resetSyncedData() Void String key  ?
hasSyncedData() Boolean String key  ?
setData() Void String key ,System.Object value  ?
getData() System.Object String key  ?
resetData() Void String key  ?
hasData() Boolean String key  ?
set_handle() Void GTANetworkShared.NetHandle value  ?
op_Implicit() GTANetworkShared.NetHandle GTANetworkServer.Client c  ?
Equals() Boolean System.Object obj  ?
op_Equality() Boolean GTANetworkServer.Client left ,GTANetworkServer.Client right  ?
op_Inequality() Boolean GTANetworkServer.Client left ,GTANetworkServer.Client right  ?
set_team() Void Int32 value  ?
set_wantedLevel Void Int32 value  ?
set_name() Void String value  ?
set_velocity() Void GTANetworkShared.Vector3 value  ?
set_seatbelt() Void Boolean value  ?
set_health() Void Int32 value  ?
set_armor() Void Int32 value  ?
set_nametag() Void String value  ?
set_nametagVisible() Void Boolean value  ?
set_nametagColor() Void GTANetworkServer.Constant.Color value  ?
sendChatMessage() Void String message  ?
sendChatMessage() Void String sender ,String message  ?
setIntoVehicle() Void GTANetworkShared.NetHandle car ,Int32 seat  ?
warpOutOfVehicle() Void GTANetworkShared.NetHandle car  ?
setSkin() Void GTANetworkServer.PedHash newSkin  ?
setDefaultClothes() Void  ?
playAnimation() Void String animDict ,String animName ,Int32 flag  ?
playScenario() Void String scenarioName  ?
stopAnimation() Void  ?
setClothes() Void Int32 slot ,Int32 drawable ,Int32 texture  ?
setAccessories() Void Int32 slot ,Int32 drawable ,Int32 texture  ?
getClothesDrawable() Int32 Int32 slot  ?
getClothesTexture() Int32 Int32 slot  ?
getAccessoryDrawable() Int32 Int32 slot  ?
getAccessoryTexture() Int32 Int32 slot  ?
clearAccessory() Void Int32 slot  ?
giveWeapon() Void GTANetworkShared.WeaponHash weapon ,Int32 ammo,Boolean equipNow ,Boolean ammoLoaded  ?
removeWeapon() Void GTANetworkShared.WeaponHash weapon  ?
removeAllWeapons() Void  ?
setWeaponTint() Void GTANetworkShared.WeaponHash weapon ,GTANetworkServer.WeaponTint tint  ?
getWeaponTint() GTANetworkServer.WeaponTint GTANetworkShared.WeaponHash weapon  ?
setWeaponComponent() Void GTANetworkShared.WeaponHash weapon ,GTANetworkServer.WeaponComponent component  ?
removeWeaponComponent() Void GTANetworkShared.WeaponHash weapon ,GTANetworkServer.WeaponComponent component  ?
hasGotWeaponComponent() Boolean GTANetworkShared.WeaponHash weapon ,GTANetworkServer.WeaponComponent component  ?
GetAllWeaponComponents() GTANetworkServer.WeaponComponent[] GTANetworkShared.WeaponHash weapon  ?
kick() Void  ?
kick() Void String reason  ?
ToString() String  ?
GetHashCode() Int32  ?
GetType() System.Type  ?

Usage example(s)


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!");