What's new

Inne B??d plik login.lua

Status
Not open for further replies.

kiler012

User
Joined
Jul 15, 2009
Messages
41
Reaction score
1
Witajcie,

ot?? chcia?bym was prosi? o pomoc przy b??dzie kt?ry pojawia si? przy wej?ciu gracza na serwerze w konsoli. Oto on:

Code:
[22:43:18.201] [Error - CreatureScript Interface]
[22:43:18.201] In a timer event called from:
[22:43:18.201] data/creaturescripts/scripts/login.lua:onLogin
[22:43:18.201] Description:
[22:43:18.201] data/creaturescripts/scripts/login.lua:73: attempt to call global 'doPlayerOpenChannel' (a nil value)
[22:43:18.201] stack traceback:
[22:43:18.201]  data/creaturescripts/scripts/login.lua:73: in function <data/creaturescripts/scripts/login.lua:72>

Nie wiem w jaki spos?b go zniwelowa?, pomo?ecie? :)

Oto tre?? pliku login.lua :

local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local function kickacc(cid)
if getCreatureName(cid) == "Account Manager" then
doRemoveCreature(cid)
end
return TRUE
end
addEvent(kickacc, 1000, cid)

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
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, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end

registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "Reward")
registerCreatureEvent(cid, "points")
registerCreatureEvent(cid, "direction")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "TopFrags")
registerCreatureEvent(cid, "monsterkill")
registerCreatureEvent(cid, "globalstorage")
registerCreatureEvent(cid, "arenaend")
registerCreatureEvent(cid, "Infinite")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "CompetitionDeath")
registerCreatureEvent(cid, "ob_arena")
registerCreatureEvent(cid, "RefSystem")
registerCreatureEvent(cid, "ranking")
registerCreatureEvent(cid, "PowerGamers")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "WrathOfTheEmperor")


setPlayerStorageValue(cid, 2000, 0)
setPlayerStorageValue(cid, 2001, 0)
setPlayerStorageValue(cid, 2002, 0)


--Otwieranie guild chatu, funkcja z delay bo mam exhausted na otwieranie chata
local function openchan()
doPlayerOpenChannel(cid, 10)
end
if (getPlayerGuildId(cid) > 0) and (getPlayerGuildLevel(cid) >= 3) and (getPlayerLevel(cid) >= 50) then
addEvent(openchan, 1300)
end
--koniec

if (InitArenaScript ~= 0) then
InitArenaScript = 1
-- make arena rooms free
for i = 42300, 42309 do
setGlobalStorageValue(i, 0)
setGlobalStorageValue(i+100, 0)
end
end
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena
setPlayerPromotionLevel(cid, 1)
--setPlayerStorageValue(cid, 1993,0) -- arena pvp
--setPlayerStorageValue(cid, 1991, 0) -- arena pvp
--setPlayerStorageValue(cid, 1992, 0) -- arena pvp
return true
end
 

Skajowski

Senior User
Joined
Jun 11, 2010
Messages
1,160
Reaction score
90
Odp: B??d plik login.lua

Wyjeb to z skryptu :D
--Otwieranie guild chatu, funkcja z delay bo mam exhausted na otwieranie chata
local function openchan()
doPlayerOpenChannel(cid, 10)
end
if (getPlayerGuildId(cid) > 0) and (getPlayerGuildLevel(cid) >= 3) and (getPlayerLevel(cid) >= 50) then
addEvent(openchan, 1300)
end
--koniec
 

kiler012

User
Joined
Jul 15, 2009
Messages
41
Reaction score
1
Odp: B??d plik login.lua

Jeszcze jeden malutki problem, czasami w konsoli wyskakuje b??d MySQL'a:

[23/8/2015 10:0:25] mysql_real_query(): SELECT `ref_account_id` FROM `z_referers` WHERE `account_id` = 2; - MYSQL ERROR: Table 'evo.z_referers' doesn't exist (1146), kt?ry przy okazji mi serwer ?cina na kilka sekund, mo?na poprosi? o pomoc? :)
 

Skajowski

Senior User
Joined
Jun 11, 2010
Messages
1,160
Reaction score
90
Odp: B??d plik login.lua

brakuje ci tabel - dodaje je
 

kiler012

User
Joined
Jul 15, 2009
Messages
41
Reaction score
1
Odp: B??d plik login.lua

Tylko wynika z tego ?e to ma by? tabela z_referers i tam parametr ref_account_id w bazie danych doda??
 

new sell

Active User
Joined
Mar 25, 2015
Messages
112
Reaction score
4
Odp: B??d plik login.lua

Radze poduczy? si? angielskiego ;c. Wyraznie pisze ze nie ma kolumny ref_account_id bo nie ma tabeli z_referers. Wi?c to chyba logiczne ze je musisz doda?, nie?
 

kiler012

User
Joined
Jul 15, 2009
Messages
41
Reaction score
1
Odp: B??d plik login.lua

Czyli takie co? starczy znaj?c ?ycie:

CREATE TABLE IF NOT EXISTS `z_referers` (
`account_id` int(30) NOT NULL,
`ref_account_id` int(30) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
Status
Not open for further replies.
Top