Informação
Bom pessoal,me baseando no servidor heroserv,que tem comandos parecidos,resolvi fazer um comando no qual você poderá comprar items donates e vende-los por comando,isso pode ser muito útil para otservers que vendam items VIPS.
!sellitem
este comando você poderá vender seus items VIPS por moedas VIP (vip coin).
!buyitem
este comando você poderá comprar items VIPS por moedas VIP (vip coin).
segue abaixo os scripts,já tendo os items VIPS do heroserv,para venda e compra,mude as IDS conforme os items VIPS do seu server.
COMANDO !buyitem
function onSay(cid, words, param)
if param == "wand" or param == "special wand" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,7424,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "axe" or param == "special axe" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,8925,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "club" or param == "special club" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,8929,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "sword" or param == "special sword" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,8932,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "arrow" or param == "special arrow" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,2352,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "bow" or param == "special bow" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,8853,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "hat" or param == "special hat" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,6096,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "armor" or param == "special armor" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,6095,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "legs" or param == "special legs" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,5918,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "boots" or param == "special boots" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,5462,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "shield" or param == "special shield" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,2527,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "life" or param == "life scroll" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,11539,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "mana" or param == "mana scroll" then
if doPlayerRemoveItem(cid,11192,5) then
doPlayerAddItem(cid,11523,1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
end
tag:
<talkaction words="!buyitem" script="buyitems.lua"/>
COMANDO !sellitem
function onSay(cid, words, param)
if param == "wand" or param == "special wand" then
if doPlayerRemoveItem(cid,7424,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "axe" or param == "special axe" then
if doPlayerRemoveItem(cid,8925,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "club" or param == "special club" then
if doPlayerRemoveItem(cid,8932,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "arrow" or param == "special arrow" then
if doPlayerRemoveItem(cid,2352,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "bow" or param == "special bow" then
if doPlayerRemoveItem(cid,8853,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "boots" or param == "special boots" then
if doPlayerRemoveItem(cid,5462,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "legs" or param == "special legs" then
if doPlayerRemoveItem(cid,5918,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "armor" or param == "special armor" then
if doPlayerRemoveItem(cid,6095,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "hat" or param == "special hat" then
if doPlayerRemoveItem(cid,6096,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
if param == "shield" or param == "special shield" then
if doPlayerRemoveItem(cid,2527,1) then
doPlayerAddItem(cid,11192,5)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MORTAREA)
else
doPlayerSendCancel(cid, 'voce nao tem este item.')
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FLAMEAREA)
end
end
end
TAG:
<talkaction words="!sellitem" script="sellitems.lua"/>
Créditos:
Subwat (Gean Riot)
gostou da um REP+,se não puder tudo bem vou entender.
valeu.
Esqueci de falar do vip coin.
vai em items.xml procura pela ID 11192
e poe isso.
<item id="11192" name="vip coin">
<attribute key="description" value="item de credito para sellitem e buyitem." />
<attribute key="weight" value="10" />
</item>