• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureScript - On first login (Request)

przemek1991

New Member
Joined
Feb 17, 2008
Messages
25
Reaction score
0
Hi, I get this problem when first player login on server
Code:
[13/06/2009 21:10:22] Lua Script Error: [CreatureScript Interface] 
[13/06/2009 21:10:22] data/creaturescripts/scripts/login.lua:onLogin

[13/06/2009 21:10:22] luaAddEvent(). Callback parameter should be a function.

after first player logs in, the rest of players login normal and the error don't show any more, only on first login after server restart.
login.lua >
Code:
function onLogin(cid)
	
	registerCreatureEvent(cid, "inquisitionPortals")
	registerCreatureEvent(cid, "PlayerKill")
	registerCreatureEvent(cid, "PlayerDeath")
	
    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
	setPlayerStorageValue(cid,29061,1)

    if(InitHistory == 0) then
        local historyPage = addEvent(historyPage, 60000, {})
        InitHistory = historyPage
    end
    return TRUE
	end
return true
I don't know how to do it, I searched in all forums and i didn't find it, so plase help me :)
 
why you have addEvent historyPage if you doesn't have function for it :O

Lua:
local function historyPage(p)
doPlayerSendTextMessage(p.cid, MESSAGE_EVENT_DEFAULT, "Blebleble.")
return TRUE
end
 
Back
Top