Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- **
- */
- #if defined _achievements_included
- #endinput
- #endif
- #define _achievements_included
- #define MAX_CATEGORIES 10 // Maximum categories possible
- #define MAX_ACHIEVEMENTS 60 // Maximum achievements possible
- #define MAX_TIERS 5 // Maximum tiers possible
- /**
- * Get the total achievements count currently exist.
- *
- * @return Number of achievements exist
- */
- native Achievements_Count();
- /**
- * Get the total categories count currently exist.
- *
- * @return Number of categories exist
- */
- native Achievements_CategoriesCount();
- /**
- * Add new achievement. (better be used on OnPluginStart)
- * * if Another achievement already exist with the same name its being linked together.
- *
- * @param name name of the achievement.
- * @param description description of the achievement.
- * @param statname Name of the stat. (can be null)
- * @param category the category of the achievement. (can be null)
- * @return ID of the achievement, must be saved for further use.
- */
- native Achievements_Add(char[] name, char[] description, char[] statname = "", char[] category = "");
- /**
- * Add new tier to an achievement
- *
- * @param achievementId ID of the achievement (return of Achievements_Add).
- * @param requiredStat required stat for the tier to be completed.
- * @param cashreward Cash to be awarded on compelation.
- * @param expreward Exp to be awarded on compelation.
- * @return the tier number (not required to save)
- *
- * @error if there are too many tiers, the tier wont be created and 0 will be returned.
- */
- native Achievements_AddTier(int achievementId, int requiredstat, int cashreward = 0, int expreward = 0);
- /**
- * Add new tier to an achievement with a custom reward
- *
- * @param achievementId ID of the achievement (return of Achievements_Add).
- * @param requiredStat required stat for the tier to be completed.
- * @param customreward the description of the custom reward (must be implenented with OnPlayerCompleteAchievement)
- * @return the tier number (not required to save)
- *
- * @error if there are too many tiers, the tier wont be created and 0 will be returned.
- */
- native Achievements_AddTierEx(int achievementId, int requiredstat, char[] customreward);
- /**
- * Get player current tier on specific achievement
- *
- * @param client Client Index.
- * @param achievementId ID of the achievement (return of Achievements_Add).
- * @return the tier number (not required to save)
- *
- * @error if the client not connected 0 will be returned.
- */
- native Achievements_GetPlayerTier(int client, int achievementId);
- /**
- * Get player current stat on specific achievement
- *
- * @param client Client Index.
- * @param achievementId ID of the achievement (return of Achievements_Add).
- * @return current stat in the achievement
- *
- * @error if the client not connected 0 will be returned.
- */
- native Achievements_GetPlayerStat(int client, int achievementId);
- /**
- * Add player stat to specific achievement
- *
- * @param client Client Index.
- * @param achievementId ID of the achievement (return of Achievements_Add).
- * @param value the amount of value to add to the stat
- * @return 1 on success | 0 on error
- *
- * @error if the client not connected 0 will be returned.
- */
- native Achievements_AddPlayerStat(int client, int achievementId, int value);
- /**
- * Get player total completed achievements
- *
- * @param client Client Index.
- * @return the total achievements the player has already completed
- *
- * @error if the client not connected 0 will be returned.
- */
- native Achievements_GetPlayerCompleted(int client);
- /**
- * Called when player complete a tier in the achievement.
- *
- * @param client Client Index.
- * @param achievementId ID of the achievement that got completed (return of Achievements_Add).
- * @param tier The tier number of the completed tier
- * @noreturn
- */
- forward Action:OnPlayerCompleteAchievement(int client, int achievementId, int tier);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement