I am learning scripting Lua and i created one code which change player's name and check in database if the player's name typed exists.
Here is the code:
ps: i have used the sendCancelMessage to test the dbquery.
ps 2: if possible, send me a link or tutorial with all commands of database of TFS.
Please help me i am bad with database + lua (in tfs xD)
Information: TFS 1.0
Here is the code:
Code:
local resultId = ("SELECT name FROM players")
if resultId then
repeat
table.insert(t, result.getDataString(resultId, "name"))
until not result.next(resultId)
result.free(resultId)
end
if (param == "nomes") then
for i,v in ipairs(t) do
player:sendCancelMessage(i.. " Nome> " ..v)
end
end
ps: i have used the sendCancelMessage to test the dbquery.
ps 2: if possible, send me a link or tutorial with all commands of database of TFS.
Please help me i am bad with database + lua (in tfs xD)
Information: TFS 1.0