From 8e953108756fbf346da175902ea43f6f0ebd510e Mon Sep 17 00:00:00 2001 From: Mido <124526040+midosvt@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:02:12 +0100 Subject: [PATCH 1/2] Add IsPlayerUsingOmp to the docs --- docs/scripting/functions/IsPlayerUsingOmp.md | 46 ++++++++++++++++++++ docs/scripting/functions/SendClientCheck.md | 1 + docs/server/omp-functions.md | 1 + 3 files changed, 48 insertions(+) create mode 100644 docs/scripting/functions/IsPlayerUsingOmp.md diff --git a/docs/scripting/functions/IsPlayerUsingOmp.md b/docs/scripting/functions/IsPlayerUsingOmp.md new file mode 100644 index 00000000000..b197e0493a6 --- /dev/null +++ b/docs/scripting/functions/IsPlayerUsingOmp.md @@ -0,0 +1,46 @@ +--- +title: IsPlayerUsingOmp +description: Check if the player is using the open.mp launcher. +tags: ["player"] +--- + + + +## Description + +Check if the player is using the open.mp launcher. + +| Name | Description | +| -------- | ----------------------------------------------------------- | +| playerid | The ID of the player to check. | + +## Returns + +Returns 1 if the player is using the open.mp launcher, otherwise 0. + +## Examples + +```c +public OnPlayerConnect(playerid) +{ + // Player is using the open.mp launcher + if(IsPlayerUsingOmp(playerid)) + { + SendClientMessage(playerid, -1, "You are using the open.mp launcher."); + } + + // Player is not using the open.mp launcher + else + { + SendClientMessage(playerid, 0xFF0000FF, "[KICK]: You don't seem to be using the open.mp launcher"); + Kick(playerid); + } + + return 1; +} +``` + +## Related Functions + +- [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): Check if the player is using the official SA-MP client. +- [SendClientCheck](SendClientCheck): Perform a memory check on the client. diff --git a/docs/scripting/functions/SendClientCheck.md b/docs/scripting/functions/SendClientCheck.md index 2cb3f47c6bd..926a93cbb25 100644 --- a/docs/scripting/functions/SendClientCheck.md +++ b/docs/scripting/functions/SendClientCheck.md @@ -64,6 +64,7 @@ public OnClientCheckResponse(playerid, actionid, memaddr, retndata) ## Related Functions - [IsPlayerUsingOfficialClient](IsPlayerUsingOfficialClient): Check if the player is using the official SA-MP client. +- [IsPlayerUsingOmp](IsPlayerUsingOmp): Check if the player is using the open.mp launcher. ## Related Callbacks diff --git a/docs/server/omp-functions.md b/docs/server/omp-functions.md index bd1f1810868..2a780be0b30 100644 --- a/docs/server/omp-functions.md +++ b/docs/server/omp-functions.md @@ -46,6 +46,7 @@ This page contains all the functions and callbacks that were added in open.mp | [GetDefaultPlayerColour](../scripting/functions/GetDefaultPlayerColour) | | [PlayerHasClockEnabled](../scripting/functions/PlayerHasClockEnabled) | | [IsPlayerUsingOfficialClient](../scripting/functions/IsPlayerUsingOfficialClient) | +| [IsPlayerUsingOmp](../scripting/functions/IsPlayerUsingOmp) | | [IsPlayerInDriveByMode](../scripting/functions/IsPlayerInDriveByMode) | | [IsPlayerCuffed](../scripting/functions/IsPlayerCuffed) | | [SetPlayerAdmin](../scripting/functions/SetPlayerAdmin) | From 90db922cce7c0637c3e825a2f35df3a2d1a54feb Mon Sep 17 00:00:00 2001 From: Mido <124526040+midosvt@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:04:45 +0100 Subject: [PATCH 2/2] Refer to IsPlayerUsingOmp in IsPlayerUsingOfficialClient --- docs/scripting/functions/IsPlayerUsingOfficialClient.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/scripting/functions/IsPlayerUsingOfficialClient.md b/docs/scripting/functions/IsPlayerUsingOfficialClient.md index 2ffc97f78c1..4d652ceaaed 100644 --- a/docs/scripting/functions/IsPlayerUsingOfficialClient.md +++ b/docs/scripting/functions/IsPlayerUsingOfficialClient.md @@ -35,4 +35,5 @@ public OnPlayerConnect(playerid) ## Related Functions +- [IsPlayerUsingOmp](IsPlayerUsingOmp): Check if the player is using the open.mp launcher. - [SendClientCheck](SendClientCheck): Perform a memory check on the client.