Dziwny problem

okup93

Advanced User
Zarejestrowany
Dołączył
Sierpień 15, 2010
Posty
215
Liczba reakcji
9
oto moj problem
Lua Script Error: [CreatureScript Interface]
[18/08/2010 19:20:30] data/creaturescripts/scripts/idle.lua:onThink

[18/08/2010 19:20:30] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[18/08/2010 19:20:30] stack traceback:
[18/08/2010 19:20:30] data/creaturescripts/scripts/idle.lua:14: in function <data/creaturescripts/scripts/idle.lua:6>
to wyskakuje mi w konsoli silnika tfs
OCB mo?e mi kto? wyt?umaczy?
i ewentualnie pom?c:)

oto ten wadliwy skrypt
PHP:
local config = {
	idleWarning = getConfigValue('idleWarningTime'),
	idleKick = getConfigValue('idleKickTime')
}

function onThink(cid, interval)
	if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
		getPlayerCustomFlagValue(cid, PlayerCustomFlag_AllowIdle)) then
		return true
	end

	local idleTime = getPlayerIdleTime(cid) + interval
	doPlayerSetIdleTime(cid, idleTime)
	if(config.idleKick > 0 and idleTime > config.idleKick) then
		doRemoveCreature(cid)
	elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
		local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
		if(config.idleKick > 0) then
			message = message .. ", you will be disconnected in "
			local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
			if(diff > 1) then
				message = message .. diff .. " minutes"
			else
				message = message .. "one minute"
			end

			message = message .. " if you are still idle"
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
	end

	return true
end

PROSZ? PILNE:)
 
Odp: Dziwny problem

Od?wie?am Temat Prosz? o pomoc
 
Odp: Dziwny problem

!!!@@@!!!@@!!!! Refresch:P
 
Odp: Dziwny problem

Witam cie.

Zamie? sw?j skrypt, na ten i powinno dzia?a?.


PHP:
local config = {
        idleWarning = 14*60000,
        idleKick = 15*60000
}
function onThink(cid, interval)
    if(getTileInfo(getCreaturePosition(cid)).nologout or getCreatureNoMove(cid) or
        getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_ALLOWIDLE)) then
        return true
    end
    local idleTime = getPlayerIdleTime(cid) + interval
    doPlayerSetIdleTime(cid, idleTime)
    if(config.idleKick > 0 and idleTime > config.idleKick) then
        doRemoveCreature(cid)
    elseif(config.idleWarning > 0 and idleTime == config.idleWarning) then
        local message = "You have been idle for " .. math.ceil(config.idleWarning / 60000) .. " minutes"
        if(config.idleKick > 0) then
            message = message .. ", you will be disconnected in "
            local diff = math.ceil((config.idleWarning - config.idleKick) / 60000)
            if(diff > 1) then
                message = message .. diff .. " minutes"
            else
                message = message .. "one minute"
            end
            message = message .. " if you are still idle"
        end
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, message .. ".")
    end
    return true
end

Pozdrawiam.
 
Back
Do góry