This plugin was initially made by Kalcor and extended by Mauzen. It allows you to load different height maps and check the min height for x,y coordinates. You can us it as example for an anti cheat to detect airbreaks easier or to prevent falling through the ground.
Features:
- Load height map
- You can also implement it in your sampgdk plugins.
Topics:
- MapAndreas v1.2.1 Updated @ sa-mp.com
- MapAndreas v1.2.1 Updated @ sa-mp.com
- MapAndreas v1.0 beta @ sa-mp.com
Simply install to your project:
sampctl package install Southclaws/samp-plugin-mapandreasInclude in your code and begin using the library:
#include <mapandreas>| native | params | return |
|---|---|---|
| MapAndreas_Init | mode, const name[] | Error code or 0 on success |
| MapAndreas_Unload | const name[], const message[] | int (0 failed/1 success) |
| MapAndreas_SaveCurrentHMap | const name[] | int (0 failed/1 success) |
| MapAndreas_FindZ_For2DCoord | Float:X, Float:Y, &Float:Z | int (0 failed/1 success) |
| MapAndreas_FindAverageZ | Float:X, Float:Y, &Float:Z | int (0 failed/1 success) |
| MapAndreas_SetZ_For2DCoord | Float:X, Float:Y, Float:Z | int (0 failed/1 success) |
Initialize MapAndreas and get a position.
public OnGameModeInit(playerid, cmdtext[])
{
MapAndreas_Init(MAP_ANDREAS_MODE_FULL, "scriptfiles/SAFull.hmap");
new Float:pos;
if (MapAndreas_FindAverageZ(20.001, 25.006, pos)) {
// Found position - position saved in 'pos'
}
return 0;
}Test with make:
make test-windowsIf you want to build/test the Linux version, use Docker:
make build-linux
make test-linuxThis will spin up a Debian container to build and then run sampctl with
--container to run the test package in a Linux environment.