• 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 Unexpected symbol

SugKukLubo

New Member
Joined
Oct 25, 2015
Messages
2
Reaction score
1
Hello OTLand, i am using TFS 0.4 rev 3884 and i encounterd this problem
B9xOlej29.png

My script
Code:
function onSay(cid, words, param)
    getBanList(type[, value])
    getBanReason(id)
    doShowTextDialog(cid, itemid, text)
end
    return TRUE
end
 
Hello OTLand, i am using TFS 0.4 rev 3884 and i encounterd this problem
B9xOlej29.png

My script
Code:
function onSay(cid, words, param)
    getBanList(type[, value])
    getBanReason(id)
    doShowTextDialog(cid, itemid, text)
end
    return TRUE
end
Code:
function onSay(cid, words, p)
    if(p == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return false
    end
    local account = getAccountIdByName(p) == 0 and getAccountIdByAccount(p) or getAccountIdByName(p)
    if(account == 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. p .. "' does not exists.")
        return false
    end
    local list = getBanList(BANTYPE_NOTATION, account)
    if not next(list) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such account or player does not have any notation.")
        return false
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Notations for account " .. account .. "\n")
    for i, ban in ipairs(list) do
        local name = ban.adminId ~= 0 and getPlayerNameByGUID(ban.adminId) or "unknown"
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,  " Added at " .. os.date("%c", ban.added) .. " by " .. name .. " with reason: " .. getBanReason(ban.reason) .. " and comment: " .. ban.comment .. ".\n")
    end
    return true
end
 
Last edited:
Code:
function onSay(cid, words, p)
    if(p == "") then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
        return false
    end
    local account = getAccountIdByName(p) == 0 and getAccountIdByAccount(p) or getAccountIdByName(p)
    if(account == 0) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. p .. "' does not exists.")
        return false
    end
    local list = getBanList(BANTYPE_NOTATION, account)
    if not next(list) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Such account or player does not have any notation.")
        return false
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Notations for account " .. account .. "\n")
    for i, ban in ipairs(list) do
        local name = ban.adminId ~= 0 and getPlayerNameByGUID(ban.adminId) or "unknown"
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,  " Added at " .. os.date("%c", ban.added) .. " by " .. name .. " with reason: " .. getBanReason(ban.reason) .. " and comment: " .. ban.comment .. ".\n")
    end
    return true
end
Thank you sir! Works perfect.
 
Back
Top