22.04.2018, 00:41
(
Last edited by Graber; 23/12/2018 at 01:17 AM.
Reason: Deprecation message
)
Please use samp-compat from now on, thanks!
Old post:
samp-compat libraries
Allow connections from clients with clients that differ from the server's version, allowing them to play alongside other clients without any additional software.
Installation
Simply install to your project depending on the version you wish to allow (0.3.7 servers should grab samp-dl-compat, and 0.3.DL servers should use samp-037-compat):
Include in your code:
Usage
Just include it to your script, nothing else to do. If you want to detect clients that use another version, you can use the original SA-MP function GetPlayerVersion, or use IsClient03DL(playerid) or IsClient037(playerid) (depending on the version you choose). This is not required for the include to work though.
Testing
A testing gamemode is included, this test showcases the capabilities of the include, by using functions that would rather be incompatible with clients if the RPCs contents weren't patched.
To test, simply run the package:
Disclaimer
samp-037-compat lacks the inability to change virtual worlds for old clients, leaving them unsynced for the rest of their session. I wouldn't recommend it for actually playing, but rather sending a nice message telling the client to update their cliente version.
Custom objects and skins are not going to work with old clients. Custom skins will fallback to their base IDs, while objects are going to spawn as a `?` object that SA-MP falls back to when it tries to create an invalid object.
Please check the include if you're going to modify RPC contents, since some RPCs are modified, you must know what kind of changes or reads are you going do, otherwise you will recieve inconsistent data. You can use the functions provided by the include to know what to expect.
Credits
Old post:
samp-compat libraries
Allow connections from clients with clients that differ from the server's version, allowing them to play alongside other clients without any additional software.
Installation
Simply install to your project depending on the version you wish to allow (0.3.7 servers should grab samp-dl-compat, and 0.3.DL servers should use samp-037-compat):
Code:
sampctl package install AGraber/samp-dl-compat OR sampctl package install AGraber/samp-037-compat
Code:
#include <dl-compat> OR #include <037-compat>
Just include it to your script, nothing else to do. If you want to detect clients that use another version, you can use the original SA-MP function GetPlayerVersion, or use IsClient03DL(playerid) or IsClient037(playerid) (depending on the version you choose). This is not required for the include to work though.
Testing
A testing gamemode is included, this test showcases the capabilities of the include, by using functions that would rather be incompatible with clients if the RPCs contents weren't patched.
To test, simply run the package:
Code:
sampctl package run
samp-037-compat lacks the inability to change virtual worlds for old clients, leaving them unsynced for the rest of their session. I wouldn't recommend it for actually playing, but rather sending a nice message telling the client to update their cliente version.
Custom objects and skins are not going to work with old clients. Custom skins will fallback to their base IDs, while objects are going to spawn as a `?` object that SA-MP falls back to when it tries to create an invalid object.
Please check the include if you're going to modify RPC contents, since some RPCs are modified, you must know what kind of changes or reads are you going do, otherwise you will recieve inconsistent data. You can use the functions provided by the include to know what to expect.
Credits
- All of the contributors of RPC-List
- urShadow
- Southclaws
- iKarim
- Borrowed some structures for the forum post and GitHub readme from his inline-timers post/repo
- SA-MP Discord
- Lots of help and advice