EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::LUA (https://www.eqemulator.org/forums/forumdisplay.php?f=680)
-   -   Client:GetAccountName() (https://www.eqemulator.org/forums/showthread.php?t=42244)

phate8908 01-02-2019 09:00 AM

Client:GetAccountName()
 
this adds GetAccountName() to client in lua since for some reason we don't have it there

Append to client_ext.lua
Code:

function Client:AccountName()
        local AccountName = ""
        local MySQLi = require('MySQLi')
        local connection = MySQLi:Connect()
        connection:query("select name from account where id = '" .. self:AccountID() .. "'")
        local result = connection:store_result()
        for i,name in result:rows() do
      AccountName = name
        end
        result:free()
        return AccountName
end

WARNING: requires MySQL Connect to work


All times are GMT -4. The time now is 02:10 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.