Advertisement
Guest User

Checkpoint ID

a guest
Feb 11th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.95 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new checkpoint[MAX_PLAYERS];
  4. new checkpointr[MAX_PLAYERS];
  5.  
  6. forward OnPlayerEnterCheckpointEx(playerid, checkid);
  7. forward OnPlayerLeaveCheckpointEx(playerid, checkid);
  8. forward OnPlayerEnterRaceCheckpointEx(playerid, checkid);
  9. forward OnPlayerLeaveRaceCheckpointEx(playerid, checkid);
  10.  
  11.  
  12. public OnPlayerEnterCheckpoint(playerid)
  13. {
  14.     CallLocalFunction("OnPlayerEnterCheckpointEx", "ii", playerid, checkpoint[playerid]);
  15.     return 1;
  16. }
  17.  
  18. public OnPlayerLeaveCheckpoint(playerid)
  19. {
  20.     CallLocalFunction("OnPlayerLeaveCheckpointEx", "ii", playerid, checkpoint[playerid]);
  21.     return 1;
  22. }
  23.  
  24. public OnPlayerEnterRaceCheckpoint(playerid)
  25. {
  26.     CallLocalFunction("OnPlayerEnterRaceCheckpointEx", "ii", playerid, checkpointr[playerid]);
  27.     return 1;
  28. }
  29.  
  30. public OnPlayerLeaveRaceCheckpoint(playerid)
  31. {
  32.     CallLocalFunction("OnPlayerLeaveRaceCheckpointEx", "ii", playerid, checkpointr[playerid]);
  33.     return 1;
  34. }
  35. //Ezek alatt az eljárások alatt dolgozol a CP-vel:
  36.     public OnPlayerEnterCheckpointEx(playerid, checkid)
  37.     {
  38.         return 1;
  39.     }
  40.  
  41.     public OnPlayerLeaveCheckpointEx(playerid, checkid)
  42.     {
  43.         return 1;
  44.     }
  45.  
  46.     public OnPlayerEnterRaceCheckpointEx(playerid, checkid)
  47.     {
  48.         return 1;
  49.     }
  50.  
  51.     public OnPlayerLeaveRaceCheckpointEx(playerid, checkid)
  52.     {
  53.         return 1;
  54.     }
  55. //És Ezekkel a funkciókkal állítod be azokat és kapcsolod ki:
  56. stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size, id)
  57. {
  58.     checkpoint[playerid] = id;
  59.     SetPlayerCheckpoint(playerid, x, y, z, size);
  60. }
  61.  
  62. stock SetPlayerRaceCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:size, Float:nx, Float:ny, Float:nz, id)
  63. {
  64.     checkpointr[playerid] = id;
  65.     SetPlayerRaceCheckpoint(playerid, x, y, z, nx, ny, nz, size);
  66. }
  67.  
  68. stock DiasblePlayerCheckpointEx(playerid)
  69. {
  70.     checkpoint[playerid] = 0;
  71.     DisablePlayerCheckpoint(playerid);
  72. }
  73.  
  74. stock DiasblePlayerRaceCheckpointEx(playerid)
  75. {
  76.     checkpoint[playerid] = 0;
  77.     DisablePlayerRaceCheckpoint(playerid);
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement