Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define INVALID_CHECKPOINT_ID -255
- #define INVALID_CHECKPOINT_TYPE -255
- new PlayerCheckpointID[MAX_PLAYERS];
- new PlayerCheckpointType[MAX_PLAYERS];
- stock SetPlayerCheckpointEx(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType = -255){
- DisablePlayerCheckpoint(playerid);
- SetTimerEx("apCheckpoint", 100, 0, "dffffdd", playerid, posX, posY, posZ, cpSize, CheckPointID, CheckPointType);
- return;
- }
- forward apCheckpoint(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType);
- public apCheckpoint(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType){
- if(IsPlayerConnected(playerid)){
- PlayerCheckpointID[playerid] = CheckPointID;
- PlayerCheckpointType[playerid] = CheckPointType;
- SetPlayerCheckpoint(playerid, posX, posY, posZ, cpSize);
- }
- return;
- }
- public OnPlayerConnect(playerid){
- DisablePlayerCheckpointEx(playerid);
- return 1;
- }
- stock DisablePlayerCheckpointEx(playerid){
- PlayerCheckpointID[playerid] = INVALID_CHECKPOINT_ID;
- PlayerCheckpointType[playerid] = INVALID_CHECKPOINT_TYPE;
- DisablePlayerCheckpoint(playerid);
- return;
- }
- stock GetPlayerCheckpointID(playerid){
- return PlayerCheckpointID[playerid];
- }
- stock GetPlayerCheckpointType(playerid){
- return PlayerCheckpointType[playerid];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement