function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 30)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 100)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
doPlayerOpenChannel(cid, 6)
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
Pergunta
Xtibianoo01 0
TA DANDO ESSE ERRO
TFS 0.3.6
[08/04/2019 23:10:46] [Error - CreatureScript Interface]
[08/04/2019 23:10:46] data/creaturescripts/scripts/login.lua:onLogin
[08/04/2019 23:10:46] Description:
[08/04/2019 23:10:46] data/creaturescripts/scripts/login.lua:19: attempt to call global 'doPlayerOpenChannel' (a nil value)
[08/04/2019 23:10:46] stack traceback:
[08/04/2019 23:10:46] data/creaturescripts/scripts/login.lua:19: in function <data/creaturescripts/scripts/login.lua:6>
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 30)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, loss * 100)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
doPlayerOpenChannel(cid, 6)
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, "kill")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "deathBroadcast")
registerCreatureEvent(cid, "hmup")
registerCreatureEvent(cid, "DeathBroadcast")
registerCreatureEvent(cid, "TiraBattle")
registerCreatureEvent(cid, "showKD")
registerCreatureEvent(cid, "redSkullAmulet")
registerCreatureEvent(cid, "redSkullAmule")
registerCreatureEvent(cid, "RED")
registerCreatureEvent(cid, "FirstItems")
registerCreatureEvent(cid, "DoubleXP")
registerCreatureEvent(cid, "noAttackParty")
registerCreatureEvent(cid, "attackguild")
registerCreatureEvent(cid, "pop")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
return true
end
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados