Coca Cola
New Member
- Joined
- Apr 10, 2010
- Messages
- 164
- Reaction score
- 0
Hello I durst this system in version 8.5 update I give in my server and this script stopped working the error is that the 'doSetItemSpecialDescription' (a nil value)
[28/11/2010 07:17:38] [Error - TalkAction Interface]
[28/11/2010 07:17:38] data/talkactions/scripts/vip.luanSay
[28/11/2010 07:17:38] Description:
[28/11/2010 07:17:38] data/talkactions/scripts/vip.lua:125: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[28/11/2010 07:17:38] stack traceback:
[28/11/2010 07:17:38] data/talkactions/scripts/vip.lua:125: in function <data/talkactions/scripts/vip.lua:4>
[28/11/2010 07:17:38] [Error - TalkAction Interface]
[28/11/2010 07:17:38] data/talkactions/scripts/vip.luanSay
[28/11/2010 07:17:38] Description:
[28/11/2010 07:17:38] data/talkactions/scripts/vip.lua:125: attempt to call global 'doSetItemSpecialDescription' (a nil value)
[28/11/2010 07:17:38] stack traceback:
[28/11/2010 07:17:38] data/talkactions/scripts/vip.lua:125: in function <data/talkactions/scripts/vip.lua:4>
Code:
requiredGroup = 3
local text = "[Ressurect Rune]\nCreditos: 1000\nAbreviação: ressurect\n\n[Refinadora]\nCreditos: 100\nAbreviação: refiner\n\n[Lunar Staff]\nCreditos: 3000\n\n[Golden Bow]\nCreditos: 2000\n\n[Amulet of loss]\nAbreviação: aol\nCreditos: 400\n\n[Ring of Experience]\nAbreviação: roe\nCreditos: 500\n\n[Sudden death]\nAbreviação: sd\nCharges: 100\nCreditos: 200\n\n[Heavy magic missile]\nAbreviação: hmm\nCharges: 100\nCreditos: 30\n\n[Ultimate healing]\nAbreviação: uh\nCharges: 100\nCreditos: 150\n\n[Explosion]\nCharges: 100\nCreditos: 110\n\n[Great Fireball]\nAbreviação: gfb\nCharges: 100\nCreditos: 100\n\n[teleport scroll]\nCreditos: 40 creditos\n\n[power bolt]\nCharges: 100\nCreditos: 10\n\n[Mana potion]\nAbreviação: mp\nCharges: 50\nCreditos: 50\n\n[Strong Mana potion]\nAbreviação: smp\nCharges: 50\nCreditos: 100\n\n[Great Mana potion]\nAbreviação: gmp\nCharges: 50\nCreditos: 150\n\n[Health potion]\nAbreviação: hp\nCharges: 50\nCreditos: 40\n\n[Strong Health potion]\nAbreviação: shp\nCharges: 50\nCreditos: 90\n\n[Great Health potion]\nAbreviação: ghp\nCharges: 50\nCreditos: 150\n\n[Ultimate Health potion]\nAbreviação: uhp\nCharges: 50\nCreditos: 180\n\n[Great Spirit potion]\nAbreviação: gsp\nCharges: 50\nCreditos: 150\n\n[Time Ring]\nAbreviação: tr\nCreditos: 30\n\n[Stealth Ring]\nAbreviação: sr\nCreditos: 30\n\n[Ring of Healing]\nAbreviação: rh\nCreditos: 30\n"
function onSay(cid, words, param)
if(param == "") then
if(getPlayerVipPoints(cid) >= 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce possui " .. getPlayerVipPoints(cid) .. " creditos.")
doShowTextDialog(cid, 1964, text)
elseif (getPlayerVipPoints(cid) == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao possui creditos.")
end
return TRUE
end
local t = string.explode(param, ",")
local target = getPlayerByNameWildcard(t[1])
local points = tonumber(t[2])
if(words == "/addvip") then
if(getPlayerGroupId(cid) < requiredGroup) then
return FALSE
end
if(target == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
return TRUE
end
if(not points) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No point specified.")
return TRUE
end
points = math.abs(points)
doPlayerAddVipPoints(target, points)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have added " .. points .. " points to " .. t[1] .. ".")
return TRUE
end
if(words == "/removevip") then
if(getPlayerGroupId(cid) < requiredGroup) then
return FALSE
end
if(target == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.")
return TRUE
end
if(not points) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "No point specified.")
return TRUE
end
points = math.abs(points)
doPlayerRemoveVipPoints(cid, points)
doSendMagicEffect(getCreaturePosition(target), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have removed " .. points .. " points from " .. t[1] .. ".")
return TRUE
end
if(words == "/getvip") then
if(getPlayerGroupId(cid) < requiredGroup) then
return FALSE
end
target = getPlayerByNameWildcard(param)
if(target == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " have " .. getPlayerVipPoints(target) .. " points.")
return TRUE
end
if(words == "!vip") then
local buyableItems =
{
["lunar staff"] = {id = 7424, count = 1, points = 3000, charges = 1},
["ressurect"] = {id = 2300, count = 1, points = 1000, charges = 1},
["golden bow"] = {id = 7438, count = 1, points = 2000, charges = 1},
["teleport scroll"] = {id = 8189, count = 1, points = 30, charges = 1},
["aol"] = {id = 2173, count = 1, points = 300, charges = 1},
["tr"] = {id = 2169, count = 1, points = 30, charges = 100},
["sr"] = {id = 2165, count = 1, points = 30, charges = 100},
["rh"] = {id = 2214, count = 1, points = 30, charges = 100},
["roe"] = {id = 6300, count = 1, points = 1200, charges = 1},
["hmm"] = {id = 2311, count = 1, points = 30, charges = 100},
["uh"] = {id = 2273, count = 1, points = 150, charges = 100},
["gfb"] = {id = 2304, count = 1, points = 100, charges = 100},
["explosion"] = {id = 2313, count = 1, points = 110, charges = 100},
["power bolt"] = {id = 2547, count = 1, points = 10, charges = 100},
["mp"] = {id = 7620, count = 1, points = 50, charges = 50},
["smp"] = {id = 7589, count = 1, points = 100, charges = 50},
["gmp"] = {id = 7590, count = 1, points = 150, charges = 50},
["hp"] = {id = 7618, count = 1, points = 40, charges = 50},
["shp"] = {id = 7588, count = 1, points = 90, charges = 50},
["ghp"] = {id = 7591, count = 1, points = 150, charges = 50},
["uhp"] = {id = 8473, count = 1, points = 180, charges = 50},
["gsp"] = {id = 8472, count = 1, points = 150, charges = 50},
["refiner"] = {id = 7281, count = 1, points = 100, charges = 1},
["sd"] = {id = 2268, count = 1, points = 200, charges = 100}
}
local buyableItem = buyableItems[t[1]]
local text = "Voce tem " .. getPlayerVipPoints(cid) .. " creditos restantes.\n\n[Ressurect Rune]\nCreditos: 1000\nAbreviação: ressurect\n\n[Refinadora]\nCreditos: 100\nAbreviação: refiner\n\n[Lunar Staff]\nCreditos: 3000\n\n[Golden Bow]\nCreditos: 2000\n\n[Amulet of loss]\nAbreviação: aol\nCreditos: 400\n\n[Ring of Experience]\nAbreviação: roe\nCreditos: 500\n\n[Sudden death]\nAbreviação: sd\nCharges: 100\nCreditos: 200\n\n[Heavy magic missile]\nAbreviação: hmm\nCharges: 100\nCreditos: 30\n\n[Ultimate healing]\nAbreviação: uh\nCharges: 100\nCreditos: 150\n\n[Explosion]\nCharges: 100\nCreditos: 110\n\n[Great Fireball]\nAbreviação: gfb\nCharges: 100\nCreditos: 100\n\n[teleport scroll]\nCreditos: 40 creditos\n\n[power bolt]\nCharges: 100\nCreditos: 10\n\n[Mana potion]\nAbreviação: mp\nCharges: 50\nCreditos: 50\n\n[Strong Mana potion]\nAbreviação: smp\nCharges: 50\nCreditos: 100\n\n[Great Mana potion]\nAbreviação: gmp\nCharges: 50\nCreditos: 150\n\n[Health potion]\nAbreviação: hp\nCharges: 50\nCreditos: 40\n\n[Strong Health potion]\nAbreviação: shp\nCharges: 50\nCreditos: 90\n\n[Great Health potion]\nAbreviação: ghp\nCharges: 50\nCreditos: 150\n\n[Ultimate Health potion]\nAbreviação: uhp\nCharges: 50\nCreditos: 180\n\n[Great Spirit potion]\nAbreviação: gsp\nCharges: 50\nCreditos: 150\n\n[Time Ring]\nAbreviação: tr\nCreditos: 30\n\n[Stealth Ring]\nAbreviação: sr\nCreditos: 30\n\n[Ring of Healing]\nAbreviação: rh\nCreditos: 30\n"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce possui " .. getPlayerVipPoints(cid) .. " creditos.")
if(getPlayerVipPoints(cid) >= 1) then
if buyableItem then
if(not t[2]) then
if getPlayerVipPoints(cid) >= buyableItem.points then
doSendMagicEffect(getCreaturePosition(cid), 30)
local vipitem = doPlayerAddItem(cid,buyableItem.id,buyableItem.charges)
doCreatureSay(cid, "!vip " .. getItemNameById(buyableItem.id) .. "", TALKTYPE_SAY)
doSetItemSpecialDescription(vipitem, "Este item pertence a " .. getCreatureName(cid) .. ".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda possui " .. getPlayerVipPoints(cid) .. " de creditos restante.")
doPlayerRemoveVipPoints(cid, buyableItem.points)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Aqui esta seu " .. getItemNameById(buyableItem.id) .. ".")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem creditos restantes.")
return TRUE
end
else
if(getPlayerVipPoints(cid) >= buyableItem.points * t[2]) then
local vipitem2 = doPlayerAddItem(cid,buyableItem.id,buyableItem.charges)
doSendMagicEffect(getCreaturePosition(cid), 30)
doSetItemSpecialDescription(vipitem2, "Este item pertence a " .. getCreatureName(cid) .. ".")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce ainda possui " .. getPlayerVipPoints(cid) .. " de creditos restante.")
doPlayerRemoveVipPoints(cid, buyableItem.points * t[2])
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Aqui esta seu " .. getItemNameById(buyableItem.id) .. ".")
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem creditos restantes.")
return TRUE
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao possui creditos.")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem creditos restantes.")
return TRUE
end
end
if(words == "!sellitemasd") then
local sellableItems =
{
["boots of haste"] = {id = 2195, count = 1, points = 3, charges = 1},
["amulet of loss"] = {id = 2173, count = 1, points = 5, charges = 1},
["soft boots"] = {id = 6132, count = 1, points = 20, charges = 1}
}
local sellableItem = sellableItems[t[1]]
if sellableItem then
if(not t[2]) then
if(getPlayerVipPoints(cid) > 0) then
if(doPlayerTakeItem(cid, sellableItem.id, sellableItem.count, sellableItem.charges) == LUA_ERROR) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have that item.")
return TRUE
else
doPlayerAddVipPoints(cid, sellableItem.points)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sold x" .. sellableItem.count .. " " .. getItemNameById(sellableItem.id) .. " for " .. sellableItem.points .. " vip points. " .. getPlayerVipPoints(cid) .. " vip points left.")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be vip to sell items.")
return TRUE
end
else
if(getPlayerVipPoints(cid) > 0) then
if(doPlayerTakeItem(cid, sellableItem.id, sellableItem.count * t[2], sellableItem.charges) == LUA_ERROR) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have these items.")
return TRUE
else
doPlayerAddVipPoints(cid, sellableItem.points * t[2])
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sold x" .. sellableItem.count * t[2] .. " " .. getItemNameById(sellableItem.id) .. " for " .. sellableItem.points * t[2] .. " vip points. " .. getPlayerVipPoints(cid) .. " vip points left.")
return TRUE
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need to be vip to sell items.")
return TRUE
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not sell that item.")
return TRUE
end
end
if(words == "!lista") then
if(param == "vip") then
local text = "Voce tem " .. getPlayerVipPoints(cid) .. " creditos restantes.\n\n[Ressurect Rune]\nCreditos: 1000\nAbreviação: ressurect\n\n[Refinadora]\nCreditos: 100\nAbreviação: refiner\n\n[Lunar Staff]\nCreditos: 3000\n\n[Golden Bow]\nCreditos: 2000\n\n[Amulet of loss]\nAbreviação: aol\nCreditos: 400\n\n[Ring of Experience]\nAbreviação: roe\nCreditos: 500\n\n[Sudden death]\nAbreviação: sd\nCharges: 100\nCreditos: 200\n\n[Heavy magic missile]\nAbreviação: hmm\nCharges: 100\nCreditos: 30\n\n[Ultimate healing]\nAbreviação: uh\nCharges: 100\nCreditos: 150\n\n[Explosion]\nCharges: 100\nCreditos: 110\n\n[Great Fireball]\nAbreviação: gfb\nCharges: 100\nCreditos: 100\n\n[teleport scroll]\nCreditos: 40 creditos\n\n[power bolt]\nCharges: 100\nCreditos: 10\n\n[Mana potion]\nAbreviação: mp\nCharges: 50\nCreditos: 50\n\n[Strong Mana potion]\nAbreviação: smp\nCharges: 50\nCreditos: 100\n\n[Great Mana potion]\nAbreviação: gmp\nCharges: 50\nCreditos: 150\n\n[Health potion]\nAbreviação: hp\nCharges: 50\nCreditos: 40\n\n[Strong Health potion]\nAbreviação: shp\nCharges: 50\nCreditos: 90\n\n[Great Health potion]\nAbreviação: ghp\nCharges: 50\nCreditos: 150\n\n[Ultimate Health potion]\nAbreviação: uhp\nCharges: 50\nCreditos: 180\n\n[Great Spirit potion]\nAbreviação: gsp\nCharges: 50\nCreditos: 150\n\n[Time Ring]\nAbreviação: tr\nCreditos: 30\n\n[Stealth Ring]\nAbreviação: sr\nCreditos: 30\n\n[Ring of Healing]\nAbreviação: rh\nCreditos: 30\n"
doShowTextDialog(cid, 1964, text)
return TRUE
elseif(param == "sellas") then
local txt = "Items that you can sell:\n\nName: Boots of haste, Price: 3 points.\nName: Amulet of loss, Price: 5 points.\nName: Soft boots, Price: 20 points.\n\nYou have " .. getPlayerVipPoints(cid) .. " vip points."
doPlayerPopupFYI(cid, txt)
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Say (!itemlist buy) to see the items that you can buy.")
return TRUE
end
end
end