Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem ze skryptem vip do OTS


Rekomendowane odpowiedzi

Opublikowano

Witam, mam pewien problem ze skryptem vip. Mianowicie problem leży w tym, że gdy odpalam serwer i chcę wybrać postać to wywala mnie, a w konsoli wyskakuje :

 

 

> 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
)
done.

 

Cały skrypt wygląda tak :

 

 

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Vipsystem" version="1.0"

author="Aco" contact="http://otland.net/members/acordion" enabled="yes">

<!--- Information
Vip Item = 8978
set action id 11223 to the tile you want to be vip tile
set action id 2112 to the door you want to be vip door


            MYSQL TABLE
........................................................
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;
........................................................

-->

<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.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;")
return true
    end
    ]]></globalevent>
    
<globalevent name="vipEffect" interval="2" 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>
 

 

Będę wdzięczny za pomoc 

922631407524767580852.png

50/100/150/200/250/300/350/400

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...