-
Notifications
You must be signed in to change notification settings - Fork 2
/
AchievementsGO.inc
144 lines (125 loc) · 4.92 KB
/
AchievementsGO.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#if defined _AchievementsGO_included_
#endinput
#endif
#define _AchievementsGO_included_
/**
* Adds new achievement. This operation must be processed within AGO_OnRegisterAchievements()
* function to make sure everything will load properly
*
* @param Name Name of the achievement (up to 64 characters)
* @param Description Short description (up to 128 characters)
* @param Category Category of a certain Achievement. If you want it to be in the main section, leave blank ("")
* @param Value Sets the goal that achievement must meet to be accomplished
* @return ID of the achievement, -1 on failure or contains restricted characters.
*/
native int AGO_AddAchievement(char[] Name, char[] Description, char[] Category, int Value);
/**
* Adds one point to the player's achievement
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @return Current achievement progress or -1 if failure.
*/
native int AGO_AddPoint(int client, int IdOfAchievement);
/**
* Adds points to the player's achievement
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @param amount Amount of points to be given
* @return Current achievement progress or -1 if failure.
*/
native int AGO_AddPoints(int client, int IdOfAchievement, int amount);
/**
* Removes one point of the player's achievement
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @return Current achievement progress or -1 if failure.
*/
native int AGO_RemovePoint(int client, int IdOfAchievement);
/**
* Removes points of the player's achievement
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @param amount Amount of points to be taken away from
* @return Current achievement progress or -1 if failure.
*/
native int AGO_RemovePoints(int client, int IdOfAchievement, int amount);
/**
* Sets the current progress of the achievement to 0
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @return Current achievement progress or -1 if failure.
*/
native int AGO_ResetPoints(int client, int IdOfAchievement);
/**
* Retrieves Achievement's name by its index
*
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @param tab Char[] array for Achievement's name
* @param size Size of the given array
* @return 0 if success. On failure: -1 and array contains "NOT FOUND" string
*/
native void AGO_GetNameByIndex(int IdOfAchievement, char[] tab, int size);
/**
* Retrieves Achievement's index, based on its name
*
* @param name Array containing Achievement's name
* @return Achievement index if success. Otherwise, returns -1.
*/
native int AGO_GetIndexByName(char[] name);
/**
* Retrieves Achievement's description by its index
*
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @param tab Char[] array for Achievement's description
* @param size Size of the given array
* @return 0 if success. On failure: -1 and array contains "NOT FOUND" string
*/
native void AGO_GetDescriptionByIndex(int IdOfAchievement, char[] tab, int size);
/**
* Retrieves current player Achievement's progress
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @return Achievement's progress on success. Otherwise, returns -1.
*/
native int AGO_GetAchievementProgress(int client, int IdOfAchievement);
/**
* Checks if a certain achievement has been completed
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
* @return 1: completed, 0: not completed, -1: failure
*/
native int AGO_IsAchievementCompleted(int client, int IdOfAchievement);
/**
* Returns the current amount of active Achievements
*
* @return Amount of active achievements
*/
native int AGO_GetAmountOfAchievements();
/**
* Checks whether or not the SQL tables has been succesfully created.
*
* @return 1: Tables created, 0: tables not created
*/
native int AGO_AreTablesCreated();
/**
* Called when all the achievements from all the plugins has been succesfully loaded
*/
forward void AGO_OnAllAchievementsLoaded();
/**
* Called when a Achievement has been accomplished by a player
*
* @param client ID of the client
* @param IdOfAchievement ID of achievement (retrieved from AGO_AddAchievement() function)
*/
forward void AGO_OnAchievementAccomplished(int client, int IdOfAchievement);
/**
* Called when an engine is ready for registering new Achivements.That's the only place where it can be done
*/
forward void AGO_OnRegisterAchievements();