When someone with an index over 9, 2 numbers that means, it will only read the first number, and it will ban wrong person.
Example: a Player with index 13, gets banned by HLGUARD and kicked. But the ban will be applied to the player with index 1 instead. (in my case its my HLTV, so no harm done, but it needs to be fixed).
My code:
PHP Code:
public hlguardBan() {
new bIds[1],bId[1],bLength[8],bReason[64],bNick[32],bSteamid[32],sqlCache[512]
read_argv(1,bIds,1)
bId[0] = str_to_num(bIds)
read_argv(2, bLength, 7)
read_argv(3, bReason, 63)
get_user_name(bId[0],bNick,31)
get_user_authid(bId[0],bSteamid,31)
replace_all(bNick,31,"'"," ")
if(equal(bLength,"3600"))
formatex(sqlCache,511,"INSERT INTO bans(steamid, steamid_admin, nickname, reason, added, ends, removed) VALUES('%s', '%s', '%s', '%s', NOW(), '2100-01-01 00:00:00', 0)",bSteamid,"HLGUARD",bNick,bReason)
else
formatex(sqlCache,511,"INSERT INTO bans(steamid, steamid_admin, nickname, reason, added, ends, removed) VALUES('%s', '%s', '%s', '%s', NOW(), date_add(NOW(), interval %s day), 0)",bSteamid,"HLGUARD",bNick,bReason,bLength)
SQL_ThreadQuery(g_SqlTuple,"sqlQueryDefault",sqlCache,bId,1)
}