Postado Agosto 18, 2014 10 anos Boa noite. Estou com um erro, quando acaba a VIP o player não consegue logar. data/creaturescript/scripts/fimvip.lua:11: attempt to call field 'executeQuery' <a nil value> Obs: vendo vip pelo gesior e uso esse sistema vip\/ http://www.tibiaking.com/forum/topic/20589-vip-system-by-mock-100/ Fimvip.lua (abaixo): function onLogin(cid) local temple = { x = 160, y = 54, z = 7} if vip.hasVip(cid) == true then if getPlayerStorageValue(cid,55555) ~= 1 then setPlayerStorageValue(cid,55555,1) end else if getPlayerStorageValue(cid,55555) == 1 then doTeleportThing(cid, temple) doPlayerSendTextMessage(cid, 22, "Your VIP Time over!") db.executeQuery("UPDATE `accounts` SET `vip_time` = 0 WHERE `id` = ".. getAccountIdByName(getPlayerName(cid)) ..";") setPlayerPromotionLevel(cid, 1) setPlayerStorageValue(cid, 55555, 0) end end return true end
Postado Agosto 18, 2014 10 anos Solução function onLogin(cid) local temple = { x = 160, y = 54, z = 7} if vip.hasVip(cid) == true then if getPlayerStorageValue(cid,55555) ~= 1 then setPlayerStorageValue(cid,55555,1) end else if getPlayerStorageValue(cid,55555) == 1 then doTeleportThing(cid, temple) doPlayerSendTextMessage(cid, 22, "Your VIP Time over!") db.query("UPDATE `accounts` SET `vip_time` = 0 WHERE `id` = ".. getAccountIdByName(getPlayerName(cid)) ..";") setPlayerPromotionLevel(cid, 1) setPlayerStorageValue(cid, 55555, 0) end end return true end
Postado Agosto 18, 2014 10 anos Ou assim: function onLogin(cid) if vip.hasVip(cid) == true then if getPlayerStorageValue(cid,55555) ~= 1 then setPlayerStorageValue(cid,55555,1) end else if getPlayerStorageValue(cid,55555) == 1 then temple = { x = 160, y = 54, z = 7} doTeleportThing(cid, temple) doPlayerSendTextMessage(cid, 22, "Your VIP Time over!") local q = "UPDATE accounts SET vip_time=0 WHERE id="..getPlayerGUID(cid) db.executeQuery(q) setPlayerPromotionLevel(cid, 1) setPlayerStorageValue(cid, 55555, 0) end end return true end
Postado Agosto 18, 2014 10 anos Autor function onLogin(cid) local temple = { x = 160, y = 54, z = 7} if vip.hasVip(cid) == true then if getPlayerStorageValue(cid,55555) ~= 1 then setPlayerStorageValue(cid,55555,1) end else if getPlayerStorageValue(cid,55555) == 1 then doTeleportThing(cid, temple) doPlayerSendTextMessage(cid, 22, "Your VIP Time over!") db.query("UPDATE `accounts` SET `vip_time` = 0 WHERE `id` = ".. getAccountIdByName(getPlayerName(cid)) ..";") setPlayerPromotionLevel(cid, 1) setPlayerStorageValue(cid, 55555, 0) end end return true end VALEU CARA, DEU CERTINHO! DUVIDA SANADA... REP++++++
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.