Ir para conteúdo

Problema Mas Q Facil


pedroh7

Posts Recomendados

sua resposta n ta certo vodkart n e isso n tem nehum disso nos script

 

 

 

 

 

 

ghp_id = 7591 -- Item a ser vendido

backpackghp_id = 2000 -- Backpack

custoghp_id = 3800 -- Valor

cargasghp_id = 20 -- Cargas

 

local name = getItemNameById(ghp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custoghp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackghp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custoghp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, ghp_id, cargasghp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custoghp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

 

gmp_id = 7590 -- Item a ser vendido

backpackgmp_id = 9774 -- Backpack

custogmp_id = 2400 -- Valor

cargasgmp_id = 20 -- Cargas

 

local name = getItemNameById(gmp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custogmp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackgmp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custogmp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, gmp_id, cargasgmp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custogmp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

hp_id = 7618 -- Item a ser vendido

backpackhp_id = 2000 -- Backpack

custohp_id = 900 -- Valor

cargashp_id = 20 -- Cargas

 

local name = getItemNameById(hp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custohp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackhp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custohp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, hp_id, cargashp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custohp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

mp_id = 7620 -- Item a ser vendido

backpackmp_id = 2001 -- Backpack

customp_id = 1000 -- Valor

cargasmp_id = 20 -- Cargas

 

local name = getItemNameById(mp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, customp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackmp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. customp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, mp_id, cargasmp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. customp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

 

uhp_id = 8473 -- Item a ser vendido

backpackuhp_id = 9774 -- Backpack

custouhp_id = 6200 -- Valor

cargasuhp_id = 20 -- Cargas

 

local name = getItemNameById(uhp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custouhp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackuhp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custouhp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, uhp_id, cargasuhp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custouhp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

smp_id = 7589 -- Item a ser vendido

backpacksmp_id = 7342 -- Backpack

custosmp_id = 1600 -- Valor

cargassmp_id = 20 -- Cargas

 

local name = getItemNameById(smp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custosmp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpacksmp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custosmp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, smp_id, cargassmp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custosmp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

 

shp_id = 7588 -- Item a ser vendido

backpackshp_id = 3940 -- Backpack

custoshp_id = 2000 -- Valor

cargasshp_id = 20 -- Cargas

 

local name = getItemNameById(shp_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custoshp_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackshp_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custoshp_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, shp_id, cargasshp_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custoshp_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

spr_id = 8472 -- Item a ser vendido

backpackspr_id = 7342 -- Backpack

custospr_id = 2000 -- Valor

cargasspr_id = 20 -- Cargas

 

local name = getItemNameById(spr_id)

----- End Config -----

function onUse(cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney(cid, custospr_id) == TRUE then

local bag = doPlayerAddItem(cid, backpackspr_id, 1)

doSendAnimatedText(fromPosition, "", TEXTCOLOR_YELLOW)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have purchased a backpack of ".. name .."s for ".. custospr_id .." gold.")

for i=1,20 do

doAddContainerItem(bag, spr_id, cargasspr_id)

end

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need ".. custospr_id .." gold coins for a backpack of ".. name .."s.")

end

return FALSE

end

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Essse e o script dos potion e esse q eu vo manda e um negocio q ta escrito potion

local config = {

removeOnUse = "no",

usableOnTarget = "yes", -- can be used on target? (fe. healing friend)

splashable = "no",

realAnimation = "yes", -- make text effect visible only for players in range 1x1

healthMultiplier = 1.0,

manaMultiplier = 1.0

}

 

config.removeOnUse = getBooleanFromString(config.removeOnUse)

config.usableOnTarget = getBooleanFromString(config.usableOnTarget)

config.splashable = getBooleanFromString(config.splashable)

config.realAnimation = getBooleanFromString(config.realAnimation)

 

local POTIONS = {

[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion

[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion

[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4}, vocStr = "templar warriors and royal archers"}, -- strong health potion

[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4}, vocStr = "templar warriors"}, -- great health potion

[8473] = {empty = 7635, splash = 2, health = {950, 1300}, level = 130, vocations = {4}, vocStr = "templar warriors"}, -- ultimate health potion

 

[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion

[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3}, vocStr = "magicians, priests and archers"}, -- strong mana potion

[7590] = {empty = 7635, splash = 7, mana = {400, 750}, level = 80, vocations = {1, 2, 9, 10, 11, 12}, vocStr = "chaos magicians, elder priests and alchemists"}, -- great mana potion

 

[8472] = {empty = 7635, splash = 3, health = {400, 650}, mana = {450, 690}, level = 80, vocations = {3}, vocStr = "royal archers"} -- great spirit potion

}

 

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local potion = POTIONS[item.itemid]

if(not potion) then

return false

end

 

if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then

if(not config.splashable) then

return false

end

 

if(toPosition.x == CONTAINER_POSITION) then

toPosition = getThingPos(item.uid)

end

 

doDecayItem(doCreateItem(2016, potion.splash, toPosition))

doTransformItem(item.uid, potion.empty)

return true

end

 

if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

return true

end

 

if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and

not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))

then

doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)

return true

end

 

local health = potion.health

if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then

return false

end

 

local mana = potion.mana

if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then

return false

end

 

doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)

if(not realAnimation) then

doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)

else

for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do

if(isPlayer(tid)) then

doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)

end

end

end

 

doAddCondition(cid, exhaust)

if(not potion.empty or config.removeOnUse) then

doRemoveItem(item.uid, 1)

return true

end

doRemoveItem(item.uid, 1)

return true

end

 

Aew vodkart se tava certo eskeci de olhar nesse script de potion aew outra vez certo hehe

Link para o comentário
Compartilhar em outros sites

local config = {
removeOnUse = "no",
usableOnTarget = "yes", -- can be used on target? (fe. healing friend)
splashable = "no",
realAnimation = "yes", -- make text effect visible only for players in range 1x1
healthMultiplier = 1.0,
manaMultiplier = 1.0
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.usableOnTarget = getBooleanFromString(config.usableOnTarget)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
[8704] = {empty = 7636, splash = 2, health = {50, 100}}, -- small health potion
[7618] = {empty = 7636, splash = 2, health = {100, 200}}, -- health potion
[7588] = {empty = 7634, splash = 2, health = {200, 400}, level = 50, vocations = {3, 4}, vocStr = "templar warriors and royal archers"}, -- strong health potion
[7591] = {empty = 7635, splash = 2, health = {500, 700}, level = 80, vocations = {4}, vocStr = "templar warriors"}, -- great health potion
[8473] = {empty = 7635, splash = 2, health = {950, 1300}, level = 130, vocations = {4}, vocStr = "templar warriors"}, -- ultimate health potion

[7620] = {empty = 7636, splash = 7, mana = {70, 130}}, -- mana potion
[7589] = {empty = 7634, splash = 7, mana = {110, 190}, level = 50, vocations = {1, 2, 3}, vocStr = "magicians, priests and archers"}, -- strong mana potion
[7590] = {empty = 7635, splash = 7, mana = {400, 750}, level = 80, vocations = {1, 2, 9, 10, 11, 12}, vocStr = "chaos magicians, elder priests and alchemists"}, -- great mana potion

[8472] = {empty = 7635, splash = 3, health = {400, 650}, mana = {450, 690}, level = 80, vocations = {3}, vocStr = "royal archers"} -- great spirit potion
}

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
local potion = POTIONS[item.itemid]
if(not potion) then
return false
end

if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid)) then
if(not config.splashable) then
return false
end

if(toPosition.x == CONTAINER_POSITION) then
toPosition = getThingPos(item.uid)
end

doDecayItem(doCreateItem(2016, potion.splash, toPosition))
doTransformItem(item.uid, potion.empty)
return true
end

if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end

if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))
then
doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and (" of level " .. potion.level) or "") .. " or above may drink this fluid.", TALKTYPE_ORANGE_1)
return true
end

local health = potion.health
if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
return false
end

local mana = potion.mana
if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
return false
end

doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
if(not realAnimation) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
else
for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
if(isPlayer(tid)) then
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
end
end
end

doAddCondition(cid, exhaust)
if(not potion.empty or config.removeOnUse) then
return true
end
return true
end

 

ai to falando isso pra ve se tem tipo em strong_mana.lua,ultimate_health.lua,etc...

pra remover essa parte

se nao tiver deixa

doRemoveItem(item.uid, 0) 
ou 
doPlayerAddItem(cid, EMPTY_POTION, 0)

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...