-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmissions.inc
206 lines (146 loc) · 4.31 KB
/
missions.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#if defined _missions_included_
#endinput
#endif
#define _missions_included_
/*
Registers a new Mission
@Param1 -> char UniqueKey[64]
@Param2- > char MissionName[256]
@Param3- > char MissionDescription[1024]
@Param4 -> int Max Requirement
@param5 -> int reward Amount
@Param6 -> char preMissionKey[64] (Mission that has to be completed to accept this)
@Param7 -> char category[64] to group | "" for none (not recommended)
@Param8 -> bool broadcast | if false don't broadcast any message regarding mission
@return -
*/
native void Missions_RegisterMission(char uniqueKey[64], char MissionName[256], char MissionDescription[1024], int maxRequirement, int rewardAmount, char preMissionKey[64], char category[64], bool broadcast);
/*
Store the UniqueKey of the Active mission from a client
@Param1 -> client index
@Param2 -> buffer for the key[64]
@return -
*/
native void Missions_GetActiveUniqueKey(int client, char keyBuffer[64]);
/*
Return if the Client has an Active Mission
@Param1 -> client index
@return -> true or false
*/
native bool Missions_HasActiveMission(int client);
/*
Return the Active Mission name
@Param1 -> client index
@Param2 -> buffer for the Name[64]
@return -
*/
native void Missions_GetActiveMissionName(int client, char nameBuffer[64]);
/*
Returns the current Progress on the Active client Mission
@Param1 -> client index
@return -> int progress
*/
native int Missions_GetMissionProgress(int client);
/*
Return the Maximum Requirement for the Currently Active Mission
@Param1 -> client index
@return -> int maxRequirement
*/
native int Missions_GetMissionsMaxRequirement(int client);
/*
Return if the Active mission is completed
@Param1 -> client index
@return -> true or false
*/
native bool Missions_IsMissionCompleted(int client);
/*
Return if the Active mission is awarded
@Param1 -> client index
@return -> true or false
*/
native bool Missions_IsMissionAwarded(int client);
/*
Return store is active
@return -> true or false
*/
native bool Missions_CanUseStore();
/*
Increments a Mission's progress
@Param1 -> int client index
@Param2 -> char key[64]
@return -
*/
native void Mission_IncrementMissionProgress(int client, char key[64]);
/*
Increments a Mission's progress
@Param1 -> int client index
@Param2 -> char key[64]
@Param3 -> int amount
@return -
*/
native void Mission_AddToMissionProgress(int client, char key[64], int amount);
/*
Sets a Mission's progress
@Param1 -> int client index
@Param2 -> char key[64]
@Param3 -> int value to set
@return -
*/
native bool Mission_SetMissionProgress(int client, char key[64], int value);
/*
Checks if a Client has completed a certain Mission
@Param1 -> client index
@Param2 -> char uniqueKey[64]
*/
native bool Mission_HasClientCompletedMission(int client, char key[64]);
/*
Returns if the given key[64] is the Key of the currently active mission
@Param1 -> client index
@Param2 -> char key[64]
@return true or false
*/
native bool Missions_IsActiveMissionKey(int client, char key[64]);
/*
Unloads a Mission from the Core
@no Params
@return -
ALWAYS IMPLEMENT IN OnPluginEnd !
*/
native void Missions_Finalize();
/*
Forward when a Mission is started
@Param1 -> int client
@Param2 -> char uniqueKey[64]
*/
forward void OnMissionAccept(int client, char uniqueKey[64]);
/*
Forward when a Mission is aborted
@Param1 -> int client
@Param2 -> char uniqueKey[64]
*/
forward void OnMissionAbort(int client, char uniqueKey[64]);
/*
Forward when a Mission is completed
@Param1 -> int client
@Param2 -> char uniqueKey[64]
*/
forward void OnMissionCompleted(int client, char uniqueKey[64]);
/*
Foward when a Mission reward is given out
@Param1 -> int client
@Param2 -> char uniqueKey[64]
@Param3 -> int rewardAmount
*/
forward void OnMissionAwarded(int client, char uniqueKey[64], int rewardAmount);
/*
Forward when a client joins the Server and continues his mission or accepts a new one
@Param 1 -> int client
@Param 2 -> char key[64]
*/
forward void OnMissionAssigned(int client, char key[64]);
/*
Forward when a client joins the Server and continues his mission or accepts a new one
@Param 1 -> int client
@Param 2 -> char key[64]
*/
forward void OnMissionSuspended(int client, char key[64]);