Skip to content

Commit 75a830c

Browse files
authored
GAG_API: Add more params for forwards (#201)
* GAG_API: Enhance CA_gag_setted forward * Better desc * fix description
1 parent f9fc8f4 commit 75a830c

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

cstrike/addons/amxmodx/scripting/CA_Gag.sma

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,9 +1514,19 @@ static bool: Gag_Save(const id, const target, const time, const flags, const exp
15141514

15151515
ExecuteForward(g_fwd_gag_setted, g_ret,
15161516
target,
1517+
gag[gd_name],
1518+
gag[gd_authID],
1519+
gag[gd_IP],
1520+
1521+
gag[gd_adminName],
1522+
gag[gd_adminAuthID],
1523+
gag[gd_adminIP],
1524+
15171525
gag[gd_reason][r_name],
15181526
gag[gd_reason][r_time],
1519-
gag[gd_reason][r_flags]
1527+
gag[gd_reason][r_flags],
1528+
1529+
gag[gd_expireAt]
15201530
)
15211531

15221532
if(g_ret == CA_SUPERCEDE) {
@@ -1572,7 +1582,12 @@ static Gag_Expired(const id) {
15721582

15731583

15741584
Register_Forwards() {
1575-
g_fwd_gag_setted = CreateMultiForward("CA_gag_setted", ET_STOP, FP_CELL, FP_STRING, FP_CELL, FP_CELL)
1585+
g_fwd_gag_setted = CreateMultiForward("CA_gag_setted", ET_STOP,
1586+
FP_CELL, FP_STRING, FP_STRING, FP_STRING,
1587+
FP_STRING, FP_STRING, FP_STRING,
1588+
FP_STRING, FP_CELL, FP_CELL,
1589+
FP_CELL
1590+
)
15761591
g_fwd_gag_removed = CreateMultiForward("CA_gag_removed", ET_STOP, FP_CELL, FP_STRING, FP_CELL, FP_CELL)
15771592
}
15781593

cstrike/addons/amxmodx/scripting/include/CA_GAG_API.inc

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,37 @@ native bool: ca_has_user_gag(const index);
187187
*/
188188
native bool: ca_remove_user_gag(const index);
189189

190+
/**
191+
* Called on Gag save.
192+
*
193+
* @param target Targed index
194+
* @param name Targed name
195+
* @param authID Targed AuthID
196+
* @param IP Targed IP
197+
* @param adminName Admin name
198+
* @param adminAuthID Admin authID
199+
* @param adminIP Admin IP
200+
* @param reason Reason
201+
* @param time Time (in seconds)
202+
* @param flags Flags (chat, teamChat, voice)
203+
* @param expireAt Time when gag expire
204+
*
205+
* @return Return CA_SUPERCEDE for prevent Gag.
206+
*/
207+
forward CA_gag_setted(
208+
const target, name[], authID[], IP[],
209+
adminName[], adminAuthID[], adminIP[],
210+
reason[], time, gag_flags_s: flags,
211+
expireAt);
190212

191-
forward CA_gag_setted(const target, reason[], minutes, gag_flags_s: flags);
213+
/**
214+
* Called on gag remove action.
215+
*
216+
* @param target Target index
217+
* @param target Reason
218+
* @param minutes Time (in seconds)
219+
* @param flags Flags (chat, teamChat, voice)
220+
*
221+
* @return Return CA_SUPERCEDE for prevent Gag remove.
222+
*/
192223
forward CA_gag_removed(const target, reason[], minutes, gag_flags_s: flags);

0 commit comments

Comments
 (0)