Want to improve the docs? Take a look at scripting-api-data!
Found a bug? jc3mp/bugs is a good place to let us know.
Name | Type | Description |
---|---|---|
vehicle | Vehicle or undefined | read only the players current vehicle |
client | RemoteClient | read only the associated RemoteClient of the player |
name | string | read only the Player's name |
networkId | number | read only the network id of this entity. It is not unique across different entities and will be re-assigned once this entity was destroyed |
health | number | the players current health |
invulnerable | boolean | whether the player is invulnerable to damage |
position | Vector3f | the Player's position in the game world |
respawnPosition | Vector3f | the position where the player respawns upon calling Player#Respawn |
rotation | Vector3f | the Player's rotation in the game world |
aimPosition | Vector3f | the position the player aims at |
selectedWeapon | PlayerWeapn | read only the currently selected(equipped) weapon |
weapons | Array<PlayerWeapon> or undefined | read only weapons in the inventory |
dimension | number | world dimension of the Player. |
Immediately kicks the Player from the Server.
Name | Type | Description |
---|---|---|
reason | string | reason for kicking the Player. currently unused (cannot be seen by the Player) |
jcmp.events.Add('PlayerReady', player => {
player.Kick('meow!');
});
Respawns the Player. The position is stored in
Player.respawnPosition
jcmp.events.Add('PlayerDeath', player => {
player.respawnPosition = player.position
player.Respawn();
});
Gives the Player a weapon.
returns: PlayerWeapn
Name | Type | Description |
---|---|---|
weaponHash | number | the weapon's hash |
ammo | number | desired ammunition. If the Player already has the weapon, it will increase the ammo by this number. |
equipNow | boolean | whether the weapon should be equipped automatically. |
jcmp.events.Add('PlayerReady', player => {
player.GiveWeapon(2307691279, 100, true);
});
returns: boolean
Name | Type | Description |
---|---|---|
p1 | number |
By becoming the newest member of our growing forums, we and hundreds of other players will always keep you up to date on everything JC3:MP related.