Knight God
Member
- Joined
- Oct 19, 2008
- Messages
- 1,180
- Reaction score
- 21
Hello
good start I ask for help with this
Creaturescripts problem, not to be deve.
Problem: to enter the server
[04/01/2011 01:40:37] > Saving server...
[04/01/2011 01:40:47] > SAVE: Complete in 9.758 seconds using relational house storage.
[04/01/2011 01:40:48] [Error - CreatureScript Interface]
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua
nThink
[04/01/2011 01:40:48] Description:
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[04/01/2011 01:40:48] stack traceback:
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua:14: in function <data/creaturescripts/scripts/idle.lua:6>
Scripts:...
Idle.lua:
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
creaturescript.xml:
<event type="think" name="Idle" event="script" value="idle.lua"/>
On login:
registerCreatureEvent(cid, "Idle")
this problem will not let me open the server I get quiet and do not let the server run normally but it does lag and it appears all the time
good start I ask for help with this
Creaturescripts problem, not to be deve.
Problem: to enter the server
[04/01/2011 01:40:37] > Saving server...
[04/01/2011 01:40:47] > SAVE: Complete in 9.758 seconds using relational house storage.
[04/01/2011 01:40:48] [Error - CreatureScript Interface]
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua
[04/01/2011 01:40:48] Description:
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua:14: attempt to compare number with nil
[04/01/2011 01:40:48] stack traceback:
[04/01/2011 01:40:48] data/creaturescripts/scripts/idle.lua:14: in function <data/creaturescripts/scripts/idle.lua:6>
Scripts:...
Idle.lua:
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
creaturescript.xml:
<event type="think" name="Idle" event="script" value="idle.lua"/>
On login:
registerCreatureEvent(cid, "Idle")
this problem will not let me open the server I get quiet and do not let the server run normally but it does lag and it appears all the time