Skip to content

Commit d03122b

Browse files
committed
Translation added
1 parent bc96f0c commit d03122b

File tree

5 files changed

+239
-0
lines changed

5 files changed

+239
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: GetPlayerVehicleSeat
3+
description: Descobre em qual assento um jogador está.
4+
tags: ["player", "vehicle"]
5+
---
6+
7+
## Descrição
8+
9+
Descobre em qual assento um jogador está.
10+
11+
| Nome | Descrição |
12+
| --------- | ----------------------------------------------- |
13+
| playerid | O ID do jogador do qual você quer saber o assento. |
14+
15+
## Retornos
16+
17+
O ID do assento em que o jogador está.
18+
19+
**-1** indica que não está em um veículo, **0** é o motorista, **1** é o passageiro da frente, e **2** e **3** são os passageiros traseiros.
20+
21+
## Exemplos
22+
23+
```c
24+
public OnPlayerCommandText(playerid, cmdtext[])
25+
{
26+
if (strcmp(cmdtext, "/myseat", true) == 0)
27+
{
28+
new
29+
playerSeat = GetPlayerVehicleSeat(playerid);
30+
31+
// Como você pode descartar suas informações.
32+
if (playerSeat == 128)
33+
{
34+
return SendClientMessage(playerid, 0xFFFFFFFF, "Um erro impediu que retornássemos o ID do assento.");
35+
}
36+
37+
new
38+
string[24];
39+
40+
format(string, sizeof(string), "Seu assento: %i", playerSeat);
41+
SendClientMessage(playerid, 0xFFFFFFFF, string);
42+
return 1;
43+
}
44+
return 0;
45+
}
46+
```
47+
48+
| ID | Assento |
49+
| --- | ------------------------------ |
50+
| 0 | Motorista |
51+
| 1 | Passageiro da frente |
52+
| 2 | Passageiro traseiro esquerdo |
53+
| 3 | Passageiro traseiro direito |
54+
| 4+ | Assentos de passageiros (coaches etc.) |
55+
56+
## Funções Relacionadas
57+
58+
- [GetPlayerVehicleID](GetPlayerVehicleID): Obtém o ID do veículo em que o jogador está.
59+
- [PutPlayerInVehicle](PutPlayerInVehicle): Coloca um jogador em um veículo.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: GetVehicleDistanceFromPoint
3+
description: Esta função pode ser usada para calcular a distância (como um float) entre um veículo e outra coordenada do mapa.
4+
tags: ["vehicle"]
5+
---
6+
7+
## Descrição
8+
9+
Esta função pode ser usada para calcular a distância (como um float) entre um veículo e outra coordenada do mapa. Isso pode ser útil para detectar quão longe um veículo está de um local.
10+
11+
| Nome | Descrição |
12+
| --------- | -------------------------------------------------- |
13+
| vehicleid | O ID do veículo para calcular a distância. |
14+
| Float:x | A coordenada X do mapa. |
15+
| Float:y | A coordenada Y do mapa. |
16+
| Float:z | A coordenada Z do mapa. |
17+
18+
## Retornos
19+
20+
Um float contendo a distância do ponto especificado nas coordenadas.
21+
22+
## Exemplos
23+
24+
```c
25+
/* quando o jogador digitar 'vendingmachine' na caixa de chat, ele verá isso.*/
26+
public OnPlayerText(playerid, text[])
27+
{
28+
if (strcmp(text, "vendingmachine", true) == 0)
29+
{
30+
new
31+
string[64],
32+
vehicleid = GetPlayerVehicleID(playerid);
33+
34+
new
35+
Float:distance = GetVehicleDistanceFromPoint(vehicleid, 237.9, 115.6, 1010.2);
36+
37+
format(string, sizeof(string), "Você está a %.2f de nossa máquina de vendas.", distance);
38+
SendClientMessage(playerid, 0xA9C4E4FF, string);
39+
}
40+
return 0;
41+
}
42+
```
43+
44+
## Funções Relacionadas
45+
46+
- [GetPlayerDistanceFromPoint](GetPlayerDistanceFromPoint): Obtém a distância entre um jogador e um ponto.
47+
- [GetVehiclePos](GetVehiclePos): Obtém a posição de um veículo.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: GetVehicleSeats
3+
description: Gets the number of seats in the vehicle.
4+
tags: ["vehicle"]
5+
---
6+
7+
<VersionWarn version='omp v1.1.0.2612' />
8+
9+
## Description
10+
11+
Gets the number of seats in the vehicle.
12+
13+
| Name | Description |
14+
| --------- | ------------------ |
15+
| modelid | ID of the vehicle model. |
16+
17+
## Return Values
18+
19+
Returns the number of seats.
20+
21+
**255** if the model is invalid.
22+
23+
## Examples
24+
25+
```c
26+
new vehicleid = GetPlayerVehicleID(playerid);
27+
new modelid = GetVehicleModel(vehicleid);
28+
new seats = GetVehicleSeats(modelid);
29+
30+
new string[64];
31+
format(string, sizeof(string), "Number of seats in this vehicle: %d", seats);
32+
SendClientMessage(playerid, -1, string);
33+
```
34+
35+
## Related Functions
36+
37+
- [PutPlayerInVehicle](PutPlayerInVehicle): Puts a player in a vehicle.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: IsPlayerInAnyVehicle
3+
description: Verifica se um jogador está dentro de qualquer veículo (como motorista ou passageiro).
4+
tags: ["player", "vehicle"]
5+
---
6+
7+
## Descrição
8+
9+
Verifica se um jogador está dentro de qualquer veículo (como motorista ou passageiro).
10+
11+
| Nome | Descrição |
12+
| --------- | ----------------------------- |
13+
| playerid | O ID do jogador a ser verificado. |
14+
15+
## Retornos
16+
17+
**true** - O jogador está em um veículo.
18+
19+
**false** - O jogador não está em um veículo.
20+
21+
## Exemplos
22+
23+
```c
24+
public OnPlayerCommandText(playerid, cmdtext[])
25+
{
26+
if (strcmp(cmdtext, "/invehicle", true) == 0)
27+
{
28+
if (IsPlayerInAnyVehicle(playerid))
29+
{
30+
SendClientMessage(playerid, 0x00FF00FF, "Você está em um veículo.");
31+
}
32+
else
33+
{
34+
SendClientMessage(playerid, 0xFF0000FF, "Você não está em nenhum veículo.");
35+
}
36+
return 1;
37+
}
38+
return 0;
39+
}
40+
```
41+
42+
## Funções Relacionadas
43+
44+
- [IsPlayerInVehicle](IsPlayerInVehicle): Verifica se um jogador está em um determinado veículo.
45+
- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): Verifica em qual assento o jogador está.
46+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: IsPlayerInVehicle
3+
description: Verifica se um jogador está em um veículo específico.
4+
tags: ["player", "vehicle"]
5+
---
6+
7+
## Descrição
8+
9+
Verifica se um jogador está em um veículo específico.
10+
11+
| Nome | Descrição |
12+
| --------- | --------------------------------------- |
13+
| playerid | ID do jogador. |
14+
| vehicleid | ID do veículo. Nota: NÃO é o modelid! |
15+
16+
## Retornos
17+
18+
**true** - O jogador ESTÁ no veículo.
19+
20+
**false** - O jogador NÃO está no veículo.
21+
22+
## Exemplos
23+
24+
```c
25+
new gSpecialCar;
26+
27+
public OnGameModeInit()
28+
{
29+
gSpecialCar = AddStaticVehicle(411, 0.0, 0.0, 5.0, 0.0, -1, -1);
30+
return 1;
31+
}
32+
33+
public OnPlayerCommandText(playerid, cmdtext[])
34+
{
35+
if (strcmp(cmdtext, "/gSpecialCar", true) == 0)
36+
{
37+
if (IsPlayerInVehicle(playerid, gSpecialCar))
38+
{
39+
SendClientMessage(playerid, -1, "Você está no carro especial!");
40+
}
41+
return 1;
42+
}
43+
return 0;
44+
}
45+
```
46+
47+
## Funções Relacionadas
48+
49+
- [IsPlayerInAnyVehicle](IsPlayerInAnyVehicle): Verifica se um jogador está em qualquer veículo.
50+
- [GetPlayerVehicleSeat](GetPlayerVehicleSeat): Verifica em qual assento o jogador está.

0 commit comments

Comments
 (0)