Advertisement
Hirsw0w

Untitled

May 30th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. /*
  2. **
  3. */
  4. #if defined _achievements_included
  5. #endinput
  6. #endif
  7. #define _achievements_included
  8.  
  9.  
  10. #define MAX_CATEGORIES 10 // Maximum categories possible
  11. #define MAX_ACHIEVEMENTS 60 // Maximum achievements possible
  12. #define MAX_TIERS 5 // Maximum tiers possible
  13.  
  14. /**
  15. * Get the total achievements count currently exist.
  16. *
  17. * @return Number of achievements exist
  18. */
  19. native Achievements_Count();
  20.  
  21. /**
  22. * Get the total categories count currently exist.
  23. *
  24. * @return Number of categories exist
  25. */
  26. native Achievements_CategoriesCount();
  27.  
  28. /**
  29. * Add new achievement. (better be used on OnPluginStart)
  30. * * if Another achievement already exist with the same name its being linked together.
  31. *
  32. * @param name name of the achievement.
  33. * @param description description of the achievement.
  34. * @param statname Name of the stat. (can be null)
  35. * @param category the category of the achievement. (can be null)
  36. * @return ID of the achievement, must be saved for further use.
  37. */
  38. native Achievements_Add(char[] name, char[] description, char[] statname = "", char[] category = "");
  39.  
  40. /**
  41. * Add new tier to an achievement
  42. *
  43. * @param achievementId ID of the achievement (return of Achievements_Add).
  44. * @param requiredStat required stat for the tier to be completed.
  45. * @param cashreward Cash to be awarded on compelation.
  46. * @param expreward Exp to be awarded on compelation.
  47. * @return the tier number (not required to save)
  48. *
  49. * @error if there are too many tiers, the tier wont be created and 0 will be returned.
  50. */
  51. native Achievements_AddTier(int achievementId, int requiredstat, int cashreward = 0, int expreward = 0);
  52.  
  53. /**
  54. * Add new tier to an achievement with a custom reward
  55. *
  56. * @param achievementId ID of the achievement (return of Achievements_Add).
  57. * @param requiredStat required stat for the tier to be completed.
  58. * @param customreward the description of the custom reward (must be implenented with OnPlayerCompleteAchievement)
  59. * @return the tier number (not required to save)
  60. *
  61. * @error if there are too many tiers, the tier wont be created and 0 will be returned.
  62. */
  63. native Achievements_AddTierEx(int achievementId, int requiredstat, char[] customreward);
  64.  
  65. /**
  66. * Get player current tier on specific achievement
  67. *
  68. * @param client Client Index.
  69. * @param achievementId ID of the achievement (return of Achievements_Add).
  70. * @return the tier number (not required to save)
  71. *
  72. * @error if the client not connected 0 will be returned.
  73. */
  74. native Achievements_GetPlayerTier(int client, int achievementId);
  75.  
  76. /**
  77. * Get player current stat on specific achievement
  78. *
  79. * @param client Client Index.
  80. * @param achievementId ID of the achievement (return of Achievements_Add).
  81. * @return current stat in the achievement
  82. *
  83. * @error if the client not connected 0 will be returned.
  84. */
  85. native Achievements_GetPlayerStat(int client, int achievementId);
  86.  
  87. /**
  88. * Add player stat to specific achievement
  89. *
  90. * @param client Client Index.
  91. * @param achievementId ID of the achievement (return of Achievements_Add).
  92. * @param value the amount of value to add to the stat
  93. * @return 1 on success | 0 on error
  94. *
  95. * @error if the client not connected 0 will be returned.
  96. */
  97. native Achievements_AddPlayerStat(int client, int achievementId, int value);
  98.  
  99. /**
  100. * Get player total completed achievements
  101. *
  102. * @param client Client Index.
  103. * @return the total achievements the player has already completed
  104. *
  105. * @error if the client not connected 0 will be returned.
  106. */
  107. native Achievements_GetPlayerCompleted(int client);
  108.  
  109.  
  110. /**
  111. * Called when player complete a tier in the achievement.
  112. *
  113. * @param client Client Index.
  114. * @param achievementId ID of the achievement that got completed (return of Achievements_Add).
  115. * @param tier The tier number of the completed tier
  116. * @noreturn
  117. */
  118. forward Action:OnPlayerCompleteAchievement(int client, int achievementId, int tier);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement