• 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!

Function to check account number

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Which function to use in TFS 1.0 to check the player online account number, I tryed getAccountNumberByPlayerName(getCreatureName(cid)) and get the ID in accounts table.

Ex:

Code:
function onSay(cid, words, param)
   print("" .. getAccountNumberByPlayerName(getCreatureName(cid)) .. "")
end

Thanks.
 
Code:
function onSay(player, words, param)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "ACCid: "..player:getAccountId())
    return false
end
 
But for what I need, the script will check the mysql and need the account number, because the table is selected by account number, and not by ID.
 
Code:
function onSay(player, words, param)
    local id = player:getAccountId()
    local resultId = db.storeQuery("SELECT * FROM `accounts` WHERE `id` = " .. id)
    if resultId ~= false then
        local name = result.getDataString(resultId, "name")
        result.free(resultId)
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Your account name is " .. name .. ".")
    end
    return false
end

Somethin' like this?
 
Back
Top