I'm fighting with my account manager for several days allready.
Now when I started the server and read the log, it tells me there is an end expected in the lua code (line 6)
Can any1 tell me where an end is missing since I can't manage to find it
I don't know how you guys get the colours in the script so it could be a bit unclear now :S I'm new with this forum
The missing end is about "function" but in my opinion it's ended in the very end of the script
Now when I started the server and read the log, it tells me there is an end expected in the lua code (line 6)
Can any1 tell me where an end is missing since I can't manage to find it
Code:
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
if (getConfigValue("accountManager") == FALSE and getCreatureName(cid) == "Account Manager") then
return false
end
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid,'SpellUp')
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
local mposx = getConfigInfo('newPlayerSpawnPosX')
local mposy = getConfigInfo('newPlayerSpawnPosY')
local mposz = getConfigInfo('newPlayerSpawnPosZ')
local mtid = getConfigInfo('newPlayerTownId')
function onLogin(cid, pos)
db.executeQuery("SELECT `id` , `posx` , `posy` , `posz` `town_id` FROM `players` WHERE id >0 AND posx =0 AND posy =0 AND posz =0 AND town_id=0;")
db.executeQuery("UPDATE players SET posx="..mposx..", posy="..mposy..", posz="..mposz..", town_id="..mtid.." WHERE id>0 AND posx =0 AND posy =0 AND posz =0 AND town_id=0;")
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
end
I don't know how you guys get the colours in the script so it could be a bit unclear now :S I'm new with this forum
The missing end is about "function" but in my opinion it's ended in the very end of the script