• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Query problem /banip

Mdcrf

New Member
Joined
Mar 2, 2014
Messages
18
Reaction score
1
Hi.
My command /banip only ban ip of player but i want ban account of player too like this picture (final warning)

XAItlQP.png


I make a query to add ban in DB but i found only sintax errror, pls i need help :(

Code:
function onSay(cid, words, param)

if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando Requerido! exemplo: /banip ADM")
doPlayerSendCancel(cid, "Comando Requerido!")
return TRUE
end

local pid = getPlayerByNameWildcard(param)
local tmp = getPlayerIp(pid)
if(doAddIpBanishment(tmp) or pid == 0 or (isPlayerGhost(pid) == TRUE)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O player " .. param .. " esta offline.")
end

if isPlayerGhost(pid) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, getCreatureName(pid) .. " Ha Sido Baneado")
doAddIpBanishment(tmp, 30 * 24 * 60 * 60)
doRemoveCreature(pid)
-
syntax error -> db.executeQuery("INSERT INTO `bans` SET `type` = 3, `value` = ".. getAccountIdByName(pid) ..", `param` = 125, `expires` = -1, `comment` = read the rules, `reason` = 4, `action` = 7")
-
end
return TRUE
end

what's wrong with this query i marked syntax error ? (for easy identify)
 
Last edited:
Solved.
A friend recommend me phpmyadmin button insert
db.executeQuery("INSERT INTO `bans` (`id`, `type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`, `reason`, `action`, `statement`) VALUES (NULL, '3', ".. getAccountIdByName(param) ..", '125', '1', '-1', ".. os.time() ..", '7', 'Read the Rules', '4', '7', '');")
 
Back
Top