Skip to content

Commit

Permalink
fix: amx_gag arguments check (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
wopox1337 authored Apr 25, 2024
1 parent c5c0255 commit efdf22b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cstrike/addons/amxmodx/scripting/ChatAdditions/CA_Gag.sma
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,15 @@ public ConCmd_amx_gag(const id, const level, const cid) {

new argc = read_argc()

if (argc == 1) {
console_print(id, "^t Usage: amx_gag [nickname | STEAM_ID | userID | IP] <reason> <time> <flags>^n")
if (argc == 1 || argc >= amx_gag_s) {
console_print(id, "^t Wrong arguments count: `%i`", argc)
console_print(id, "^t Usage: amx_gag ^"[nickname | STEAM_ID | userID | IP]^" ^"<reason>^" <time> <flags>^n")

return PLUGIN_HANDLED
}

new args[amx_gag_s][255]
for(new i; i < argc; i++) {
for (new i; i < argc; i++) {
read_argv(i, args[amx_gag_s: i], charsmax(args[]))
}

Expand Down

0 comments on commit efdf22b

Please sign in to comment.