This script is actually inspired from here, but i made my own version and using some library like YSI.
Simply install to your project:
sampctl package install LuminouZ307/samp-multicpInclude in your code and begin using the library:
#include <multicp>-
SetPlayerMultiCP(playerid, Float:x, Float:y, Float:z, bool:autodisable = false, color = MULTICP_DEFAULT_COL):-
Sets player checkpoint.
-
playerid = The player ID you wan't sets the checkpoint.
-
x = x position.
-
y = y position.
-
z = z position.
-
autodisable = if autodisable is true, when you entering the checkpoint it will automatically disabled.
-
color = checkpoint colour (default is red).
-
-
DisablePlayerMultiCP(playerid, cpid):- Remove player checkpoint.
-
IsPlayerInMultiCP(playerid, cpid):- Check if player in a checkpoint.
-
DisablePlayerAllMultiCP(playerid):- Remove player all checkpoints.
-
OnPlayerLeaveMultiCP(playerid, cpid):- Detect when player leaving checkpoint.
-
OnPlayerEnterMultiCP(playerid, cpid):- Detect when player entering checkpoint.
To test, simply run the package:
sampctl package run