Hi, I want to do that if the player is offline it also banned. Someone can help me?
Thanks for help
LAron
PS: I have a query to the database
PHP:
function onSay(cid, words, param)
local t = string.explode(string.lower(param), ",")
if not t[1] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true
end
local player = getPlayerByNameWildcard(t[1])
if(not player)then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true
end
local hours,comment = not tonumber(t[2]) and 24 or tonumber(t[2]),not t[3] and "No Reason" or t[3]
doBroadcastMessage(getCreatureName(player).." was banned by "..getCreatureName(cid).." for "..comment)
doAddAccountBanishment(getPlayerAccountId(player), target, os.time() + hours*3600*24, 5, 2,comment, 0)
doRemoveCreature(player)
return true
end
Thanks for help
LAron
PS: I have a query to the database
PHP:
db.getResult('SELECT `accounts`.`id` FROM `accounts`, `players` WHERE `accounts`.`id` = `players`.`account_id` AND `players`.`name` = ' .. db.escapeString(player) .. ';')