Skip to content

Commit ea6ae25

Browse files
committed
1 parent 226928f commit ea6ae25

14 files changed

Lines changed: 481 additions & 0 deletions

File tree

docs/api.json

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4977,6 +4977,174 @@
49774977
"doc": "Virtual world id or nil."
49784978
}
49794979
},
4980+
{
4981+
"name": "ban",
4982+
"doc": "This function will ban the player on the server.",
4983+
"side": "server",
4984+
"category": "Player",
4985+
"params": [
4986+
{
4987+
"name": "player_id",
4988+
"type": "integer",
4989+
"doc": "Target player id."
4990+
},
4991+
{
4992+
"name": "reason",
4993+
"type": "string",
4994+
"doc": "Optional reason why the player was banned."
4995+
}
4996+
],
4997+
"returns": {
4998+
"type": "nil",
4999+
"doc": ""
5000+
}
5001+
},
5002+
{
5003+
"name": "kick",
5004+
"doc": "This function will kick the player from the server.",
5005+
"side": "server",
5006+
"category": "Player",
5007+
"params": [
5008+
{
5009+
"name": "player_id",
5010+
"type": "integer",
5011+
"doc": "Target player id."
5012+
},
5013+
{
5014+
"name": "reason",
5015+
"type": "string",
5016+
"doc": "Optional reason why the player was kicked."
5017+
}
5018+
],
5019+
"returns": {
5020+
"type": "nil",
5021+
"doc": ""
5022+
}
5023+
},
5024+
{
5025+
"name": "isPlayerConnected",
5026+
"doc": "The function is used to check whether player is connected to the server.",
5027+
"side": "server",
5028+
"category": "Player",
5029+
"params": [
5030+
{
5031+
"name": "player_id",
5032+
"type": "integer",
5033+
"doc": "Target player id."
5034+
}
5035+
],
5036+
"returns": {
5037+
"type": "boolean",
5038+
"doc": "True when player is connected, otherwise false."
5039+
}
5040+
},
5041+
{
5042+
"name": "isPlayerDead",
5043+
"doc": "The function is used to check whether player is dead.",
5044+
"side": "server",
5045+
"category": "Player",
5046+
"params": [
5047+
{
5048+
"name": "player_id",
5049+
"type": "integer",
5050+
"doc": "Target player id."
5051+
}
5052+
],
5053+
"returns": {
5054+
"type": "boolean",
5055+
"doc": "True when player is dead, otherwise false."
5056+
}
5057+
},
5058+
{
5059+
"name": "isPlayerSpawned",
5060+
"doc": "The function is used to check whether player is spawned.",
5061+
"side": "server",
5062+
"category": "Player",
5063+
"params": [
5064+
{
5065+
"name": "player_id",
5066+
"type": "integer",
5067+
"doc": "Target player id."
5068+
}
5069+
],
5070+
"returns": {
5071+
"type": "boolean",
5072+
"doc": "True when player is spawned, otherwise false."
5073+
}
5074+
},
5075+
{
5076+
"name": "isPlayerUnconscious",
5077+
"doc": "The function is used to check whether player is in unconscious state. The player will be unconscious, when it gets beaten up, but not killed.",
5078+
"side": "server",
5079+
"category": "Player",
5080+
"params": [
5081+
{
5082+
"name": "player_id",
5083+
"type": "integer",
5084+
"doc": "Target player id."
5085+
}
5086+
],
5087+
"returns": {
5088+
"type": "boolean",
5089+
"doc": "True when player is unconscious, otherwise false."
5090+
}
5091+
},
5092+
{
5093+
"name": "respawnPlayer",
5094+
"doc": "This function will immediately respawn the player if it is dead.",
5095+
"side": "server",
5096+
"category": "Player",
5097+
"params": [
5098+
{
5099+
"name": "player_id",
5100+
"type": "integer",
5101+
"doc": "Target player id."
5102+
}
5103+
],
5104+
"returns": {
5105+
"type": "nil",
5106+
"doc": ""
5107+
}
5108+
},
5109+
{
5110+
"name": "setPlayerRespawnTime",
5111+
"doc": "This function will set the player time to respawn after death. If set to 0, respawn is disabled for selected player.",
5112+
"side": "server",
5113+
"category": "Player",
5114+
"params": [
5115+
{
5116+
"name": "player_id",
5117+
"type": "integer",
5118+
"doc": "Target player id."
5119+
},
5120+
{
5121+
"name": "respawn_time",
5122+
"type": "integer",
5123+
"doc": "New respawn time in milliseconds."
5124+
}
5125+
],
5126+
"returns": {
5127+
"type": "nil",
5128+
"doc": ""
5129+
}
5130+
},
5131+
{
5132+
"name": "getPlayerRespawnTime",
5133+
"doc": "This function will get the player time to respawn after death.",
5134+
"side": "server",
5135+
"category": "Player",
5136+
"params": [
5137+
{
5138+
"name": "player_id",
5139+
"type": "integer",
5140+
"doc": "Target player id."
5141+
}
5142+
],
5143+
"returns": {
5144+
"type": "int|nil",
5145+
"doc": "The player respawn time or nil if player isn't created."
5146+
}
5147+
},
49805148
{
49815149
"name": "giveItem",
49825150
"doc": "Give an item to a player or NPC.",
@@ -6443,6 +6611,74 @@
64436611
"doc": "True on success."
64446612
}
64456613
},
6614+
{
6615+
"name": "anx",
6616+
"doc": "This function will convert pixels to virtuals screen X dimension and return it as a result.\nVirtuals are special type of unit used by the game to position UI elements independent from game resolution.",
6617+
"side": "client",
6618+
"category": "Interface",
6619+
"params": [
6620+
{
6621+
"name": "pixels",
6622+
"type": "integer",
6623+
"doc": "The pixels to convert."
6624+
}
6625+
],
6626+
"returns": {
6627+
"type": "integer",
6628+
"doc": "The virtuals after conversion."
6629+
}
6630+
},
6631+
{
6632+
"name": "any",
6633+
"doc": "This function will convert pixels to virtuals on screen Y dimension and return it as a result.\nVirtuals are special type of unit used by the game to position UI elements independent from game resolution.",
6634+
"side": "client",
6635+
"category": "Interface",
6636+
"params": [
6637+
{
6638+
"name": "pixels",
6639+
"type": "integer",
6640+
"doc": "The pixels to convert."
6641+
}
6642+
],
6643+
"returns": {
6644+
"type": "integer",
6645+
"doc": "The virtuals after conversion."
6646+
}
6647+
},
6648+
{
6649+
"name": "nax",
6650+
"doc": "This function will convert virtuals to pixels on screen X dimension and return it as a result.",
6651+
"side": "client",
6652+
"category": "Interface",
6653+
"params": [
6654+
{
6655+
"name": "virtuals",
6656+
"type": "integer",
6657+
"doc": "The virtuals to convert."
6658+
}
6659+
],
6660+
"returns": {
6661+
"type": "integer",
6662+
"doc": "The pixels after conversion."
6663+
}
6664+
},
6665+
{
6666+
"name": "nay",
6667+
"doc": "This function will convert virtuals to pixels on screen Y dimension and return it as a result.",
6668+
"side": "client",
6669+
"category": "Interface",
6670+
"params": [
6671+
{
6672+
"name": "virtuals",
6673+
"type": "integer",
6674+
"doc": "The virtuals to convert."
6675+
}
6676+
],
6677+
"returns": {
6678+
"type": "integer",
6679+
"doc": "The pixels after conversion."
6680+
}
6681+
},
64466682
{
64476683
"name": "setTime",
64486684
"doc": "Set the in-game world time (hour, minute).",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: 'anx'
3+
---
4+
# `function` anx <font size="4">(client-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
!!! note
7+
Use this function only when you want to convert x position or width on the screen.
8+
!!! note
9+
Virtual screen coordinates are similar to percentage values, where 0 is 0% and 8192 is 100%.
10+
11+
This function will convert pixels to virtuals screen X dimension and return it as a result.
12+
Virtuals are special type of unit used by the game to position UI elements independent from game resolution.
13+
14+
## Declaration
15+
```cpp
16+
int anx(int pixels)
17+
```
18+
19+
## Parameters
20+
* `int` **pixels**: The pixels to convert.
21+
22+
## Returns `int`
23+
The virtuals after conversion.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: 'any'
3+
---
4+
# `function` any <font size="4">(client-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
!!! note
7+
Use this function only when you want to convert y position or width on the screen.
8+
!!! note
9+
Virtual screen coordinates are similar to percentage values, where 0 is 0% and 8192 is 100%.
10+
11+
This function will convert pixels to virtuals on screen Y dimension and return it as a result.
12+
Virtuals are special type of unit used by the game to position UI elements independent from game resolution.
13+
14+
## Declaration
15+
```cpp
16+
int any(int pixels)
17+
```
18+
19+
## Parameters
20+
* `int` **pixels**: The pixels to convert.
21+
22+
## Returns `int`
23+
The virtuals after conversion.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: 'nax'
3+
---
4+
# `function` nax <font size="4">(client-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
!!! note
7+
Use this function only when you want to convert x position or width on the screen.
8+
9+
This function will convert virtuals to pixels on screen X dimension and return it as a result.
10+
11+
## Declaration
12+
```cpp
13+
int nax(int virtuals)
14+
```
15+
16+
## Parameters
17+
* `int` **virtuals**: The virtuals to convert.
18+
19+
## Returns `int`
20+
The pixels after conversion.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: 'nay'
3+
---
4+
# `function` nay <font size="4">(client-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
!!! note
7+
Use this function only when you want to convert y position or width on the screen.
8+
9+
This function will convert virtuals to pixels on screen Y dimension and return it as a result.
10+
11+
## Declaration
12+
```cpp
13+
int nay(int virtuals)
14+
```
15+
16+
## Parameters
17+
* `int` **virtuals**: The virtuals to convert.
18+
19+
## Returns `int`
20+
The pixels after conversion.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: 'ban'
3+
---
4+
# `function` ban <font size="4">(server-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
!!! note
7+
The reason string can't be longer than 255 characters.
8+
9+
This function will ban the player on the server.
10+
11+
## Declaration
12+
```cpp
13+
void ban(int player_id, string reason)
14+
```
15+
16+
## Parameters
17+
* `int` **player_id**: Target player id.
18+
* `string` **reason**: Optional reason why the player was banned.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: 'getPlayerRespawnTime'
3+
---
4+
# `function` getPlayerRespawnTime <font size="4">(server-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
7+
This function will get the player time to respawn after death.
8+
9+
## Declaration
10+
```cpp
11+
int|nil getPlayerRespawnTime(int player_id)
12+
```
13+
14+
## Parameters
15+
* `int` **player_id**: Target player id.
16+
17+
## Returns `int|nil`
18+
The player respawn time or nil if player isn't created.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: 'isPlayerConnected'
3+
---
4+
# `function` isPlayerConnected <font size="4">(server-side)</font>
5+
!!! info "Available since version: 0.3.0"
6+
7+
The function is used to check whether player is connected to the server.
8+
9+
## Declaration
10+
```cpp
11+
bool isPlayerConnected(int player_id)
12+
```
13+
14+
## Parameters
15+
* `int` **player_id**: Target player id.
16+
17+
## Returns `bool`
18+
True when player is connected, otherwise false.

0 commit comments

Comments
 (0)