SKY is a high-performance SA:MP (San Andreas Multiplayer) plugin that provides enhanced networking capabilities, anti-abuse features, and improved synchronization for SA:MP servers. Originally created by Slice and evolved from the YSF (Y_Less's Server Functions) plugin, SKY offers advanced packet handling, rate limiting, and player synchronization controls.
- Enhanced Packet Handling: Advanced packet validation and processing
- Rate Limiting: Configurable packet rate limits to prevent spam attacks
- Anti-Abuse: Invalid packet detection and automatic timeout mechanisms
- Sync Control: Granular control over player synchronization packets
- Performance Optimized: Built with modern C++17 standards for optimal performance
- Cross-Platform: Supports both Linux and Windows SA:MP servers
- SA:MP Server 0.3.7 or later
- Compatible with 0.3DL branch
- Linux: GCC with 32-bit support, CMake 3.10+
- Windows: Visual Studio 2017+ or Visual Studio Build Tools, CMake 3.10+
SKY supports multiple build methods to accommodate different development environments and deployment scenarios.
Install gcc and g++, make and cmake. On Ubuntu you would do that like so:
sudo apt-get install gcc g++ make cmakeIf you're on a 64-bit system you'll need additional packages for compiling for 32-bit:
sudo apt-get install gcc-multilib g++-multilibFor CentOS:
yum install gcc gcc-c++ cmake28 makeBuild the plugin:
cd SKY
mkdir build && cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
makeYou'll need to install CMake and Visual Studio, once you have that then you can run the command below to build:
cd SKY
mkdir build && cd build
cmake ../ -A Win32
cmake --build . --config Releaseor you can open the source in Visual Studio, where it will autodetect that it uses CMake, and will build a cache ready to be built.
For containerized builds and to ensure consistent build environments:
- Docker installed on your system
- Make sure Docker daemon is running
-
Build the Docker image:
docker build -t sky-builder . -
Run the container and build:
# Mount your source code and build docker run --rm -v $(pwd):/workspace sky-builder bash -c "mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make"
-
Or run interactively:
docker run -it --rm -v $(pwd):/workspace sky-builder # Inside container: mkdir -p build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make
The built SKY.so file will be available in the build/ directory on your host system.
Earthly provides reproducible builds across different environments and is excellent for CI/CD pipelines.
-
Build for Linux:
earthly +build-linux
-
Build all targets:
earthly +all
-
Export artifacts to host:
earthly +export-artifacts
This will create the
artifacts/linux/SKY.sofile. -
Create distribution packages:
earthly +package
This creates a
dist/release-linux.tar.gzwith the plugin and include file.
+build-linux- Build the Linux version of the plugin+all- Build all supported platforms (currently Linux only)+export-artifacts- Export built files to theartifacts/directory+package- Create distribution packages+check-glibc- Check the glibc version in the build environment
If you have Task installed, you can use the predefined tasks:
# Build for Linux
task build:linux
# Export artifacts
task export
# Create packages
task package
# Clean build artifacts
task cleanIf you're using sampctl for package management:
-
Install the plugin directly:
sampctl install oscar-broman/SKY
-
Or add it to your
pawn.jsondependencies:{ "dependencies": ["oscar-broman/SKY"] }Then run:
sampctl ensure
-
Include the plugin in your gamemode/filterscript:
#include <SKY>
sampctl will automatically download the appropriate binary for your platform and manage the include files.
- Copy the built
SKY.so(Linux) orSKY.dll(Windows) to your SA:MP server'splugins/directory - Copy
SKY.incto your SA:MP server'spawno/include/directory - Add
SKYto your server.cfg plugins line:plugins SKY - Include the plugin in your gamemode/filterscript:
#include <SKY>
#include <a_samp>
#include <SKY>
public OnGameModeInit()
{
// Set maximum invalid packets before timeout
SetMaxInvalidPacketsThreshold(5);
// Set timeout duration (in milliseconds)
SetInvalidPacketTimeout(30000); // 30 seconds
// Set packet rate limit (max 100 packets per 1000ms)
SetPacketRateLimit(100, 1000);
// Disable sync bugs and exploits
SetDisableSyncBugs(true);
// Disable stealth knife sync exploit
SetKnifeSync(false);
return 1;
}public OnPlayerConnect(playerid)
{
// Spawn player for all others but not for himself (useful for spectating)
SpawnPlayerForWorld(playerid);
// Block key synchronization (useful for preventing key spamming)
SetKeySyncBlocked(playerid, false);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
// Force send death packet (useful for custom death handling)
SendDeath(playerid);
return 1;
}// Freeze a player's position sync (useful for admin commands)
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/freeze", true))
{
if(IsPlayerAdmin(playerid))
{
new targetid = 0; // Example target
// Freeze player sync packets
FreezeSyncPacket(targetid, E_PLAYER_SYNC, true);
SendClientMessage(playerid, -1, "Player frozen!");
return 1;
}
}
if(!strcmp(cmdtext, "/unfreeze", true))
{
if(IsPlayerAdmin(playerid))
{
new targetid = 0; // Example target
// Unfreeze player sync packets
FreezeSyncPacket(targetid, E_PLAYER_SYNC, false);
SendClientMessage(playerid, -1, "Player unfrozen!");
return 1;
}
}
return 0;
}// Set fake health/armour values (visual only)
public OnPlayerSpawn(playerid)
{
// Make player appear to have full health to others
SetFakeHealth(playerid, 100.0);
// Make player appear to have full armour to others
SetFakeArmour(playerid, 100.0);
// Set a fake facing angle
SetFakeFacingAngle(playerid, 90.0);
return 1;
}new Text:gMyTextDraw;
public OnGameModeInit()
{
// Create a textdraw
gMyTextDraw = TextDrawCreate(320.0, 240.0, "Hello World!");
// Move textdraw position (enhanced function)
TextDrawSetPosition(gMyTextDraw, 400.0, 300.0);
return 1;
}
// Per-player textdraw content
public OnPlayerConnect(playerid)
{
new string[128];
format(string, sizeof(string), "Welcome %s!", GetPlayerNameEx(playerid));
// Set different text for each player
TextDrawSetStrForPlayer(gMyTextDraw, playerid, string);
TextDrawShowForPlayer(playerid, gMyTextDraw);
return 1;
}// Send custom sync packets
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
// Send last sync packet to all players
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
SendLastSyncPacket(playerid, i, E_PLAYER_SYNC, 1);
}
}
}
return 1;
}
// Clear animations for specific players
stock ClearPlayerAnimationForAll(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
ClearAnimationsForPlayer(playerid, i);
}
}
}// Enhanced anti-abuse with SKY features
public OnGameModeInit()
{
// Configure anti-abuse settings
SetMaxInvalidPacketsThreshold(3); // Stricter threshold
SetInvalidPacketTimeout(60000); // 1 minute timeout
SetPacketRateLimit(50, 1000); // Conservative rate limit
SetDisableSyncBugs(true); // Block known exploits
return 1;
}- Slice (SKY Creator)
- Kurta999 (Previous YSF Maintainer)
- Y_Less (The original YSF Creator)
- Illidan (Current YSF Maintainer)
- Whitetigerswt (0.3DL Work and Patches)
- BrunoBM16 (Packet/Network Patches)
- Alanskz/J0sh (Packet/Network/Sync Patches)
- NickDodd25 (Code Cleanup)
- NexiusTailer (Patches/Knowledge)
- najuaircrack (Patches)
- JustMichael/ADRFranklin (Maintainer)