@@ -149,36 +149,36 @@ Trie:LimitType_ReadParams(const T_LimitType:type, const JSON:paramsJson) {
149149
150150LimitType_SetEventListener (
151151 const T_LimitType:type,
152- const E_LimitEvent:iEvent ,
153- const PluginId ,
154- const sFuncName []
152+ const E_LimitEvent:event ,
153+ const pluginIndex ,
154+ const func []
155155) {
156156 new typeObject[S_LimitType];
157157 LimitType__Get (type, typeObject);
158158
159- if (typeObject[LimitType_Events][iEvent ] >= 0 ) {
160- DestroyForward (typeObject[LimitType_Events][iEvent ]);
159+ if (typeObject[LimitType_Events][event ] >= 0 ) {
160+ DestroyForward (typeObject[LimitType_Events][event ]);
161161 }
162162
163- typeObject[LimitType_Events][iEvent ] = LimitType__MakeEventForward (iEvent, PluginId, sFuncName );
163+ typeObject[LimitType_Events][event ] = LimitType__MakeEventForward (event, pluginIndex, func );
164164
165- if (typeObject[LimitType_Events][iEvent ] < 0 ) {
166- abort (AMX_ERR_PARAMS, " [ERROR] Can't create forward for func '%s' in plugin #%d." , sFuncName , PluginId );
165+ if (typeObject[LimitType_Events][event ] < 0 ) {
166+ abort (AMX_ERR_PARAMS, " [ERROR] Can't create forward for func '%s' in plugin #%d." , func, pluginIndex );
167167 }
168168
169169 LimitType__Set (typeObject);
170170}
171171
172- static LimitType__MakeEventForward (const E_LimitEvent:iEvent , const PluginId , const sFuncName []) {
173- switch (iEvent ) {
174- case Limit_OnRead: // (const JSON:jCfg, Trie:tParams )
175- return CreateOneForward (PluginId, sFuncName , FP_CELL, FP_CELL);
172+ static LimitType__MakeEventForward (const E_LimitEvent:event , const pluginIndex , const func []) {
173+ switch (event ) {
174+ case Limit_OnRead: // (const JSON:jCfg, Trie:p )
175+ return CreateOneForward (pluginIndex, func , FP_CELL, FP_CELL);
176176
177- case Limit_OnCheck: // (const Trie:tParams , const UserId )
178- return CreateOneForward (PluginId, sFuncName , FP_CELL, FP_CELL);
177+ case Limit_OnCheck: // (const Trie:p , const playerIndex )
178+ return CreateOneForward (pluginIndex, func , FP_CELL, FP_CELL);
179179 }
180180
181- abort (AMX_ERR_GENERAL, " [ERROR] Invalid event index (%d)." , iEvent );
181+ abort (AMX_ERR_GENERAL, " [ERROR] Invalid event index (%d)." , event );
182182 return -1 ;
183183}
184184
@@ -189,7 +189,7 @@ bool:LimitType_IsStatic(const T_LimitType:type) {
189189 return typeObject[LimitType_Static];
190190}
191191
192- LimitType_SetStaticValue (const T_LimitType:type, const bool :bValue , const UserId = 0 ) {
192+ LimitType_SetStaticValue (const T_LimitType:type, const bool :value , const playerIndex = 0 ) {
193193 new typeObject[S_LimitType];
194194 LimitType__Get (type, typeObject);
195195
@@ -198,36 +198,36 @@ LimitType_SetStaticValue(const T_LimitType:type, const bool:bValue, const UserId
198198 return ;
199199 }
200200
201- if (UserId > 0 ) {
202- BitSetIf (typeObject[LimitType_StaticValue], UserId - 1 , bValue );
201+ if (playerIndex > 0 ) {
202+ BitSetIf (typeObject[LimitType_StaticValue], playerIndex - 1 , value );
203203 } else {
204- typeObject[LimitType_StaticValue] = bValue ;
204+ typeObject[LimitType_StaticValue] = value ;
205205 }
206206
207207 LimitType__Set (typeObject);
208208}
209209
210- bool :LimitType_Execute(const T_LimitType:type, const Trie:tParams , const UserId = 0 ) {
210+ bool :LimitType_Execute(const T_LimitType:type, const Trie:p , const playerIndex = 0 ) {
211211 new typeObject[S_LimitType];
212212 LimitType__Get (type, typeObject);
213213
214- new bool :bRes = false ;
214+ new bool :res = false ;
215215 if (typeObject[LimitType_Static]) {
216216 if (typeObject[LimitType_ForPlayer]) {
217- bRes = BitIs (typeObject[LimitType_StaticValue], UserId - 1 );
217+ res = BitIs (typeObject[LimitType_StaticValue], playerIndex - 1 );
218218 } else {
219- bRes = !!typeObject[LimitType_StaticValue];
219+ res = !!typeObject[LimitType_StaticValue];
220220 }
221221 } else {
222222 if (typeObject[LimitType_Events][Limit_OnCheck] < 0 ) {
223223 abort (AMX_ERR_GENERAL, " 'Limit_OnCheck' event listener for non-static limit type '%s' must be implemented." , typeObject[LimitType_Name]);
224- bRes = false ;
224+ res = false ;
225225 } else {
226- ExecuteForward (typeObject[LimitType_Events][Limit_OnCheck], bRes, tParams, UserId );
226+ ExecuteForward (typeObject[LimitType_Events][Limit_OnCheck], res, p, playerIndex );
227227 }
228228 }
229229
230- return bRes ;
230+ return res ;
231231}
232232
233233T_LimitType:PCSingle_ObjVipmLimitType(const JSON:objectJson, const key[], const T_LimitType:def = Invalid_LimitType, const bool :dotNot = false , const bool :orFail = false ) {
0 commit comments