Skip to content

Commit 26d0167

Browse files
authored
Merge branch 'openmultiplayer:master' into master
2 parents 81b1b08 + f74d038 commit 26d0167

File tree

19 files changed

+2253
-90
lines changed

19 files changed

+2253
-90
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
55

66
# Node
77
ENV NVM_DIR /usr/local/nvm
8-
ENV NODE_VERSION 16.13.2
8+
ENV NODE_VERSION 18.20.5
99

1010
RUN mkdir -p $NVM_DIR && \
1111
curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \

app/transports/api/launcher/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ func Build() fx.Option {
3838

3939
launcherInfo := map[string]string{
4040
"version": cfg.LauncherVersion,
41-
"download": "https://github.com/openmultiplayer/launcher/releases",
42-
"ompPluginChecksum": "b81c9553157075942c9522678f4baadf",
41+
"download": "https://github.com/openmultiplayer/launcher/releases/latest",
42+
"ompPluginChecksum": "ca45d1dfc7d0a5cdcea680da6be5390a",
4343
"ompPluginDownload": "https://assets.open.mp/omp-client.dll",
4444
"changelog": `|- Build 1 - 2023/10/08
4545
Release beta version`,

docs/client/ClientOnLinux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
To get the client to run you need to download the launcher, and [omp-client.dll](https://assets.open.mp/omp-client.dll). \
8-
Then you need to put omp-client.dll in the AppData\Local\com.open.mp\omp\ folder of your prefix.\
8+
Then you need to put omp-client.dll in the AppData\Local\mp.open.launcher\omp\ folder of your prefix.\
99
After that, you can execute the open mp launcher through the cli, or make a batch file like the one below, so that you can add it to your launcher of choice.
1010

1111
### Here is a sample .bat file for editing

docs/scripting/functions/IsPlayerUsingOfficialClient.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ public OnPlayerConnect(playerid)
3535
3636
## Related Functions
3737
38+
- [IsPlayerUsingOmp](IsPlayerUsingOmp): Check if the player is using the open.mp launcher.
3839
- [SendClientCheck](SendClientCheck): Perform a memory check on the client.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: IsPlayerUsingOmp
3+
description: Check if the player is using the open.mp launcher.
4+
tags: ["player"]
5+
---
6+
7+
<VersionWarn version='omp 1.4.0.2779' />
8+
9+
## Description
10+
11+
Check if the player is using the open.mp launcher.
12+
13+
| Name | Description |
14+
| -------- | ----------------------------------------------------------- |
15+
| playerid | The ID of the player to check. |
16+
17+
## Returns
18+
19+
Returns 1 if the player is using the open.mp launcher, otherwise 0.
20+
21+
## Examples
22+
23+
```c
24+
public OnPlayerConnect(playerid)
25+
{
26+
// Player is using the open.mp launcher
27+
if(IsPlayerUsingOmp(playerid))
28+
{
29+
SendClientMessage(playerid, -1, "You are using the open.mp launcher.");
30+
}
31+
32+
// Player is not using the open.mp launcher
33+
else
34+
{
35+
SendClientMessage(playerid, 0xFF0000FF, "[KICK]: You don't seem to be using the open.mp launcher");
36+
Kick(playerid);
37+
}
38+
39+
return 1;
40+
}
41+
```
42+
43+
## Related Functions
44+
45+
- [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): Check if the player is using the official SA-MP client.
46+
- [SendClientCheck](SendClientCheck): Perform a memory check on the client.

docs/scripting/functions/PutPlayerInVehicle.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,48 @@ Puts a player in a vehicle.
1818

1919
**true** - The function was executed successfully.
2020

21-
**false** - The function failed to execute. The player or vehicle don't exist.
21+
**false** - The function failed to execute. The player or vehicle doesn't exist.
2222

2323
## Examples
2424

2525
```c
26-
public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger)
26+
// Global array to track which vehicle belongs to each player.
27+
// INVALID_VEHICLE_ID is used as a placeholder for players without a vehicle.
28+
static s_PlayerVehicle[MAX_PLAYERS] = { INVALID_VEHICLE_ID, ... };
29+
30+
public OnPlayerSpawn(playerid)
2731
{
28-
PutPlayerInVehicle(playerid, vehicleid, 0);
32+
// Check if the player already has a valid vehicle.
33+
if (!IsValidVehicle(s_PlayerVehicle[playerid]))
34+
{
35+
// If not, create a new vehicle for the player and store its ID.
36+
s_PlayerVehicle[playerid] = CreateVehicle(411, 0.0, 0.0, 3.5, 0.0, -1, -1, -1);
37+
}
38+
39+
// Mark that the player should be placed in their vehicle once it is fully loaded.
40+
// This avoids issues where the vehicle might not yet be loaded on the client's side.
41+
SetPVarInt(playerid, "PutPlayerInVehicle", 1);
42+
2943
return 1;
3044
}
45+
46+
public OnVehicleStreamIn(vehicleid, forplayerid)
47+
{
48+
// This callback is triggered when a vehicle streams in for the player (i.e. when it is loaded into memory).
49+
// Check if the streamed-in vehicle is the player's and if they need to be placed in it.
50+
if (vehicleid == s_PlayerVehicle[forplayerid] && GetPVarInt(forplayerid, "PutPlayerInVehicle"))
51+
{
52+
// Put the player into the vehicle.
53+
PutPlayerInVehicle(forplayerid, vehicleid, 0);
54+
55+
// Clear the marker to prevent repeatedly putting the player into the vehicle
56+
// (e.g., if the player leaves the vehicle and it streams in again later).
57+
DeletePVar(forplayerid, "PutPlayerInVehicle");
58+
}
59+
60+
return 1;
61+
}
62+
3163
```
3264
3365
| ID | Seat |
@@ -48,7 +80,9 @@ You can use [GetPlayerVehicleSeat](GetPlayerVehicleSeat) in a loop to check if a
4880
4981
:::warning
5082
51-
If the seat is invalid or is taken, will cause a crash when they EXIT the vehicle.
83+
* If the seat is invalid or already taken, the client will crash when they EXIT the vehicle.
84+
* Putting a player into a vehicle that is not streamed in can be unreliable. This is due to a potential client-side issue where the vehicle may not have fully loaded into memory yet.
85+
* This also applies when attempting to put a player into a vehicle that was just created.
5286
5387
:::
5488

docs/scripting/functions/SendClientCheck.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public OnClientCheckResponse(playerid, actionid, memaddr, retndata)
6464
## Related Functions
6565
6666
- [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): Check if the player is using the official SA-MP client.
67+
- [IsPlayerUsingOmp](IsPlayerUsingOmp): Check if the player is using the open.mp launcher.
6768
6869
## Related Callbacks
6970

docs/scripting/functions/SetPlayerAttachedObject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ This function is separate from the CreateObject / CreatePlayerObject pools.
5454
5555
:::warning
5656
57-
Atleast 10 objects can be attached to a single player (index 0-9)
57+
Up to 10 objects can be attached to a single player (index 0-9)
5858
5959
:::
6060

0 commit comments

Comments
 (0)