mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update doc/**/libplayer.md
This commit is contained in:
parent
3749c7524a
commit
a11845ee25
2 changed files with 26 additions and 26 deletions
|
|
@ -1,81 +1,81 @@
|
|||
# *player* library
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_pos(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Returns x, y, z coordinates of the player
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_pos(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Set player position
|
||||
|
||||
``` python
|
||||
``` lua
|
||||
player.get_vel(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Returns the x, y, z linear velocity of the player
|
||||
|
||||
``` python
|
||||
``` lua
|
||||
player.set_vel(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Sets x, y, z player linear velocity
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_rot(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Returns x, y, z of camera rotation (radians)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_rot(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Set camera rotation (radians)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_inventory(playerid: int) -> int, int
|
||||
```
|
||||
|
||||
Returns player inventory ID and selected slot index (0-9)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.is_flight() -> bool
|
||||
player.set_flight(bool)
|
||||
```
|
||||
|
||||
Getter and setter for player flight mode
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.is_noclip() -> bool
|
||||
player.set_noclip(bool)
|
||||
```
|
||||
|
||||
Getter and setter for player noclip mode (collisions disabled)
|
||||
|
||||
``` python
|
||||
``` lua
|
||||
player.set_spawnpoint(playerid: int, x: number, y: number, z: number)
|
||||
player.get_spawnpoint(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Point setter and getter added by player
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_selected_block(playerid: int) -> x,y,z
|
||||
```
|
||||
|
||||
Returns position of the selected block or nil
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_selected_entity(playerid: int) -> int
|
||||
```
|
||||
|
||||
Returns unique indentifier of the entity selected by player
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_entity(playerid: int) -> int
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,81 +1,81 @@
|
|||
# Библиотека *player*
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_pos(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Возвращает x, y, z координаты игрока
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_pos(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Устанавливает x, y, z координаты игрока
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_vel(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Возвращает x, y, z линейной скорости игрока
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_vel(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Устанавливает x, y, z линейной скорости игрока
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_rot(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Возвращает x, y, z вращения камеры (в радианах)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_rot(playerid: int, x: number, y: number, z: number)
|
||||
```
|
||||
|
||||
Устанавливает x, y вращения камеры (в радианах)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_inventory(playerid: int) -> int, int
|
||||
```
|
||||
|
||||
Возвращает id инвентаря игрока и индекс выбранного слота (от 0 до 9)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.is_flight() -> bool
|
||||
player.set_flight(bool)
|
||||
```
|
||||
|
||||
Геттер и сеттер режима полета
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.is_noclip() -> bool
|
||||
player.set_noclip(bool)
|
||||
```
|
||||
|
||||
Геттер и сеттер noclip режима (выключенная коллизия игрока)
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.set_spawnpoint(playerid: int, x: number, y: number, z: number)
|
||||
player.get_spawnpoint(playerid: int) -> number, number, number
|
||||
```
|
||||
|
||||
Сеттер и геттер точки спавна игрока
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_selected_block(playerid: int) -> x,y,z
|
||||
```
|
||||
|
||||
Возвращает координаты выделенного блока, либо nil
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_selected_entity(playerid: int) -> int
|
||||
```
|
||||
|
||||
Возвращает уникальный идентификатор сущности, на которую нацелен игрок
|
||||
|
||||
```python
|
||||
```lua
|
||||
player.get_entity(playerid: int) -> int
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue