Advertisement
Guest User

Checkpoint-Include by 'Pawno.

a guest
Aug 31st, 2012
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.43 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define                 INVALID_CHECKPOINT_ID                   -255
  4. #define                 INVALID_CHECKPOINT_TYPE                 -255  
  5.  
  6. new PlayerCheckpointID[MAX_PLAYERS];
  7. new PlayerCheckpointType[MAX_PLAYERS];
  8.  
  9. stock SetPlayerCheckpointEx(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType = -255){
  10.     DisablePlayerCheckpoint(playerid);
  11.     SetTimerEx("apCheckpoint", 100, 0, "dffffdd", playerid, posX, posY, posZ, cpSize, CheckPointID, CheckPointType);
  12.     return;
  13. }
  14.  
  15. forward apCheckpoint(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType);
  16. public apCheckpoint(playerid, Float:posX, Float:posY, Float:posZ, Float:cpSize, CheckPointID, CheckPointType){
  17.     if(IsPlayerConnected(playerid)){
  18.         PlayerCheckpointID[playerid] = CheckPointID;
  19.         PlayerCheckpointType[playerid] = CheckPointType;
  20.         SetPlayerCheckpoint(playerid, posX, posY, posZ, cpSize);
  21.     }
  22.     return;
  23. }
  24.  
  25. public OnPlayerConnect(playerid){
  26.     DisablePlayerCheckpointEx(playerid);
  27.     return 1;
  28. }
  29.  
  30. stock DisablePlayerCheckpointEx(playerid){
  31.     PlayerCheckpointID[playerid] = INVALID_CHECKPOINT_ID;
  32.     PlayerCheckpointType[playerid] = INVALID_CHECKPOINT_TYPE;
  33.     DisablePlayerCheckpoint(playerid);
  34.     return;
  35. }
  36.  
  37. stock GetPlayerCheckpointID(playerid){
  38.     return PlayerCheckpointID[playerid];
  39. }
  40.  
  41. stock GetPlayerCheckpointType(playerid){
  42.     return PlayerCheckpointType[playerid];
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement