Pawelwroclaw
New Member
- Joined
- Aug 22, 2014
- Messages
- 34
- Reaction score
- 0
Hello Guys,
I have problem with Script vip.xml "by kekox", and causes crash. Engine TFS 0.4 rev 3884
First error in reload server
Two error in LOG players (crash)
And This is all Script
Plx Help and Thank
I have problem with Script vip.xml "by kekox", and causes crash. Engine TFS 0.4 rev 3884
First error in reload server
Code:
> Loading vip.xml...[Warning - Event::loadScript] Event onTime not found ( --- Script by Kekox.
function onTimer()
db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
return true
end
)
Code:
[Error - CreatureScript Interface]
domodlib('VipFuctions')
--- Script by Kekox.
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 then
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.")
end
return true
end
:eek:nLogin
Description:
data/lib/004-database.lua:60: [Result:getDataInt] Result not set!
stack traceback:
[C]: in function 'error'
data/lib/004-database.lua:60: in function 'getDataInt'
[string "--- Vip functions by Kekox..."]:5: in function 'getPlayerVipDays'
[string "LuaInterface::loadBuffer"]:4: in function <[string "LuaInterface::loadBuffer"]:3>
And This is all Script
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="vipdays" version="1.0"
author="Aco" contact="http://otland.net/members/acordion" enabled="yes">
<config name="VipFuctions"><![CDATA[
--- Vip functions by Kekox
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
function doAddvipdays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
function doRemovevipdays(cid, days)
db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
]]></config>
<globalevent name="vipdaysRemover" time="00:01" event="script"><![CDATA[
--- Script by Kekox.
function onTimer()
db.query("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
return true
end
]]></globalevent>
<globalevent name="vipEffect" interval="100" event="script"><![CDATA[
domodlib('VipFuctions')
--- Script By Kekox.
function onThink(interval, lastExecution)
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
if getPlayervipdays(cid) >= 1 then
doSendMagicEffect(getPlayerPosition(cid), 27)
doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED)
end
end
return true
end]]></globalevent>
<event type="login" name="Vip" event="script"><![CDATA[
--- Script by Kekox.
function onLogin(cid)
registerCreatureEvent(cid, "VipCheck")
return true
end]]></event>
<event type="login" name="VipCheck" event="script"><![CDATA[
domodlib('VipFuctions')
--- Script by Kekox.
function onLogin(cid)
if getPlayervipdays(cid) >= 1 then
doPlayerSendTextMessage(cid, 19, "You have ".. getPlayervipdays(cid) .." vip days left.")
end
return true
end
]]></event>
<movevent type="StepIn" actionid="11223" event="script"><![CDATA[
domodlib('VipFuctions')
--- Script by Kekox.
function onStepIn(cid, item, position, fromPosition)
if getPlayervipdays(cid) == 0 then
doTeleportThing(cid, fromPosition, FALSE)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only VIP Account can go there.")
end
return true
end
]]></movevent>
<action actionid="2112" event="script"><![CDATA[
domodlib('VipFuctions')
--- Script by Kekox.
function onUse(cid, item, frompos, item2, topos)
if getPlayervipdays(cid) >= 1 then
pos = getPlayerPosition(cid)
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,"Stand in front of the door.")
return true
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'Only VIP Account can go there.')
end
return true
end
]]></action>
<action itemid="5952" event="script"><![CDATA[
domodlib('VipFuctions')
--- Script by Kekox.
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayervipdays(cid) > 365 then
doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.")
else
doAddvipdays(cid, 20)
doCreatureSay(cid, "Golden Player", TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Otrzymujesz Vipa na 20 dni.")
doRemoveItem(item.uid)
end
return true
end
]]></action>
</mod>
Plx Help and Thank