By: Antharaz
Tested: TFS 0.3.6
Database: mysql
Go to data/creaturescripts/scripts, open login.lua and put the code before the last return true:
Tested: TFS 0.3.6
Database: mysql
Go to data/creaturescripts/scripts, open login.lua and put the code before the last return true:
Code:
local id,nm,qry = getPlayerAccountId(cid),string.find (getCreatureName(cid), "(%[+)%v*(%]+)%s*"),""
if isPremium(cid) and nm == nil then
qry = "UPDATE `theforgottenserver`.`players` SET `name` = '[v] "..getCreatureName(cid).."' WHERE `players`.`account_id`= "..id..";"
elseif (not isPremium(cid)) and nm ~= nil then
local nnome = string.gsub(getCreatureName(cid), "(%[+)%v*(%]+)%s*", "")
qry = "UPDATE `theforgottenserver`.`players` SET `name` = '"..nnome.."' WHERE `players`.`account_id`= "..id..";"
end
if qry ~= "" then
db.executeQuery(qry)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will be disconnected and will be required to put the login and password again.")
addEvent(doRemoveThing,3000,cid)
end
Last edited: