Postado Fevereiro 7, 2024 1 ano Tenho um MOD de vip em meu servidor que está dando erro na distro, como que resolve esse problema? <?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 = 10503 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 onTime() 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="13500" 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="11111" 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, 30) doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.") doRemoveItem(item.uid) end return true end ]]></action> </mod> 73479-eeaaf04e523a6313da1dea30803c25c8.jfif
Postado Fevereiro 9, 2024 1 ano dá uma conferida no banco de dados se na tabela accounts tem a coluna vipdays ALTER TABLE `accounts` ADD `vipdays` INT(11) NOT NULL
Postado Fevereiro 9, 2024 1 ano Autor 20 minutos atrás, Imperius disse: dá uma conferida no banco de dados se na tabela accounts tem a coluna vipdays ALTER TABLE `accounts` ADD `vipdays` INT(11) NOT NULL Existe sim
Postado Fevereiro 14, 2024 1 ano <?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 = 10503 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 onTime() 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) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only VIP Account can go there.") end return true end ]]></movevent> <action actionid="13500" 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="11111" 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, 30) doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.") doRemoveItem(item.uid) end return true end ]]></action> </mod>
Postado Fevereiro 15, 2024 1 ano Autor Em 14/02/2024 em 10:03, GM Vortex disse: <?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 = 10503 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 onTime() 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) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only VIP Account can go there.") end return true end ]]></movevent> <action actionid="13500" 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="11111" 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, 30) doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.") doRemoveItem(item.uid) end return true end ]]></action> </mod> continua com o mesmo erro na distro [12:54:02.261] [Error - Action Interface] [12:54:02.262] domodlib('VipFuctions') [12:54:02.263] --- Script by Kekox. [12:54:02.264] function onUse(cid, item, fromPosition, itemEx, toPosition) [12:54:02.266] if getPlayerVipDays(cid) > 365 then [12:54:02.267] doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.") [12:54:02.268] else [12:54:02.269] doAddVipDays(cid, 30) [12:54:02.269] doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1) [12:54:02.270] doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.") [12:54:02.271] doRemoveItem(item.uid) [12:54:02.272] end [12:54:02.273] return true [12:54:02.274] end [12:54:02.275] :onUse [12:54:02.276] Description: [12:54:02.276] [string "--- Vip functions by Kekox..."]:13: attempt to call field 'executeQuery' (a nil value) [12:54:02.277] stack traceback: [12:54:02.278] [string "--- Vip functions by Kekox..."]:13: in function 'doAddVipDays' [12:54:02.279] [string "LuaInterface::loadBuffer"]:7: in function <[string "LuaInterface::loadBuffer"]:3>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.