Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ocalasans/verificacao-plataforma

Include VerificacaoPlataforma para SA:MP (San Andreas Multiplayer)
https://github.com/ocalasans/verificacao-plataforma

gta include pawn pawno sa-mp samp

Last synced: 4 days ago
JSON representation

Include VerificacaoPlataforma para SA:MP (San Andreas Multiplayer)

Awesome Lists containing this project

README

        

## Include VerificacaoPlataforma SA:MP

This is a code snippet designed to check whether the player is using a `mobile` or a `computer`. Read the categories below to stay informed.

-----------------------

### How to install?

You should download the include. After doing so, you need to place the include in the folder (pawno > include). Once you have done that, open the pwn file of your Gamemode and insert the following code below your other includes:
```pawn
#include
```

-----------------------

### Required include

* [Pawn.RakNet](https://github.com/katursis/Pawn.RakNet).

> [!WARNING]
> If the user has not activated the [Pawn.RakNet](https://github.com/katursis/Pawn.RakNet) library, they will receive an error number `111`.

-----------------------

### How does it work?

Once the player connects to the server, the include automatically checks which platform they are using, whether it's `mobile` or `computer`, with the assistance of [Pawn.RakNet](https://github.com/katursis/Pawn.RakNet). To verify the player's platform, simply use the boolean function `IsPlayerAndroid`. Below are some examples:

With the `if`:
```pawn
CMD:platform(playerid)
{
if(IsPlayerAndroid(playerid))
SendClientMessage(playerid, 0xFFFFFFFF, "You are connected via the Mobile platform.");
//
else if(!IsPlayerAndroid(playerid)) // Could be just else.
SendClientMessage(playerid, 0xFFFFFFFF, "You are connected via the Computer platform.");
//
return true;
}
```

Without the `if`:
```pawn
CMD:platform(playerid)
{
new string[128];
//
format(string, sizeof(string), "You are connected via the %s platform.", IsPlayerAndroid(playerid) ? ("Mobile") : ("Computer"));
SendClientMessage(playerid, 0xFFFFFFFF, string);
//
return true;
}
```

-----------------------

This include also has a function called `PlayerHasAutoAim`. This function is designed to check whether the player has automatic aiming enabled or if it is without automatic aiming, commonly known as `LockOn`. Below are some examples:

With the `if`:
```pawn
CMD:aim(playerid)
{
if(PlayerHasAutoAim(playerid))
SendClientMessage(playerid, 0xFFFFFFFF, "Your auto-aim is Enabled.");
//
else if(!PlayerHasAutoAim(playerid)) // Could be just else.
SendClientMessage(playerid, 0xFFFFFFFF, "Your auto-aim is Disabled.");
//
return true;
}
```

Without the `if`:
```pawn
CMD:aim(playerid)
{
new string[128];
//
format(string, sizeof(string), "Your auto-aim is %s.", PlayerHasAutoAim(playerid) ? ("Enabled") : ("Disabled"));
SendClientMessage(playerid, 0xFFFFFFFF, string);
//
return true;
}
```

-----------------------

### Contact Information

Instagram: [ocalasans](https://instagram.com/ocalasans)
YouTube: [Calasans](https://www.youtube.com/@ocalasans)
Discord: ocalasans
Community: [SA:MP Programming Community©](https://abre.ai/samp-spc)