nicoelperro
New Member
- Joined
- May 3, 2024
- Messages
- 14
- Reaction score
- 3
Okay, first of all thank you for your time.
This server is 8.6 and it works with The Real Server 3.1 wich i understand uses TFS 0.X
I have this script that's made to automaticaly sell all items that are on the shoplist, but it also sells your equiped items and it can get to be annoying for the player.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local shopItems = {
[2182] = {name = "Snakebite Rod", price = 500},
[2190] = {name = "Wand of Vortex", price = 500},
[8922] = {name = "Wand of Voodoo", price = 2000},
[2191] = {name = "Wand of Dragonbreath", price = 1000},
[2188] = {name = "Wand of Decay", price = 1000},
[8920] = {name = "Wand of Sandstorm", price = 3000},
[8911] = {name = "Northwind Rod", price = 1000},
[8912] = {name = "Springsprout Rod", price = 1000},
[2187] = {name = "Wand of Inferno", price = 3500},
[2183] = {name = "Hailstorm Rod", price = 3500},
[2186] = {name = "Moonlight Rod", price = 1000},
[2185] = {name = "Volcanic Rod", price = 1000},
[2181] = {name = "Terra Rod", price = 2000},
[2189] = {name = "Wand of Cosmic Energy", price = 2000},
}
local totalGold = 0
-- Calcular el total de oro ganado
for itemId, itemData in pairs(shopItems) do
local itemCount = getPlayerItemCount(cid, itemId)
if itemCount > 0 then
doPlayerRemoveItem(cid, itemId, itemCount)
totalGold = totalGold + (itemCount * itemData.price)
end
end
if totalGold > 0 then
doPlayerAddMoney(cid, totalGold)
doSendMagicEffect(getCreaturePosition(cid), 30)
addEvent(function()
doSendMagicEffect(getCreaturePosition(cid), 29)
end, 350)
-- Mostrar solo el total de oro ganado
doSendAnimatedText(fromPosition, "Total: " .. totalGold .. " gps", TEXTCOLOR_YELLOW)
else
doSendAnimatedText(fromPosition, "Nada para vender", TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), 3)
end
return true
end
It could be awesome if someone can help me get this script fixed so people can sell all faster without loosing their items
This server is 8.6 and it works with The Real Server 3.1 wich i understand uses TFS 0.X
I have this script that's made to automaticaly sell all items that are on the shoplist, but it also sells your equiped items and it can get to be annoying for the player.
function onUse(cid, item, fromPosition, itemEx, toPosition)
local shopItems = {
[2182] = {name = "Snakebite Rod", price = 500},
[2190] = {name = "Wand of Vortex", price = 500},
[8922] = {name = "Wand of Voodoo", price = 2000},
[2191] = {name = "Wand of Dragonbreath", price = 1000},
[2188] = {name = "Wand of Decay", price = 1000},
[8920] = {name = "Wand of Sandstorm", price = 3000},
[8911] = {name = "Northwind Rod", price = 1000},
[8912] = {name = "Springsprout Rod", price = 1000},
[2187] = {name = "Wand of Inferno", price = 3500},
[2183] = {name = "Hailstorm Rod", price = 3500},
[2186] = {name = "Moonlight Rod", price = 1000},
[2185] = {name = "Volcanic Rod", price = 1000},
[2181] = {name = "Terra Rod", price = 2000},
[2189] = {name = "Wand of Cosmic Energy", price = 2000},
}
local totalGold = 0
-- Calcular el total de oro ganado
for itemId, itemData in pairs(shopItems) do
local itemCount = getPlayerItemCount(cid, itemId)
if itemCount > 0 then
doPlayerRemoveItem(cid, itemId, itemCount)
totalGold = totalGold + (itemCount * itemData.price)
end
end
if totalGold > 0 then
doPlayerAddMoney(cid, totalGold)
doSendMagicEffect(getCreaturePosition(cid), 30)
addEvent(function()
doSendMagicEffect(getCreaturePosition(cid), 29)
end, 350)
-- Mostrar solo el total de oro ganado
doSendAnimatedText(fromPosition, "Total: " .. totalGold .. " gps", TEXTCOLOR_YELLOW)
else
doSendAnimatedText(fromPosition, "Nada para vender", TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), 3)
end
return true
end
It could be awesome if someone can help me get this script fixed so people can sell all faster without loosing their items
