Este script foi uma sugestão do usuário Guilhermee56. Você pode dar suas idéias aqui.
O que faz: Adiciona um item para um usuário, retirando este item do jogador que mandou.
Vá até data/talkactions/scripts e crie um arquivo chamado giveitem.lua, contendo:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, 25, "Name, item name and quantity are required.\nE.g.: !giveitem ".. getCreatureName(cid) ..",Crown armor,1")
return TRUE
end
local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(t[1])
local item = getItemIdByName(t[2])
local quant = tonumber(t[3])
if(not player) then
doPlayerSendCancel(cid, "You must fill with player name.")
return TRUE
end
if(not item) then
doPlayerSendCancel(cid, "You must fill with a item name.")
return TRUE
end
if(not quant) then
doPlayerSendCancel(cid, "You must fill with a quantity.")
return TRUE
end
if(quant <= 0) then
doPlayerSendCancel(cid, "You must add the quantity.")
return TRUE
end
if getPlayerGroupId(cid) >= 4 then
doPlayerAddItem(player,item, quant)
doPlayerSendTextMessage(cid, 25, "You gave ".. t[2] .." to " .. getCreatureName(player) .. ".")
doPlayerSendTextMessage(player, 25, "You got ".. t[2] .." from " .. getCreatureName(cid) .. ".")
elseif getPlayerGroupId(cid) < 4 then
if getPlayerItemCount(cid, item) >= quant then
doPlayerAddItem(player,item, quant)
doPlayerSendTextMessage(cid, 25, "You gave ".. t[2] .." to " .. getCreatureName(player) .. ".")
doPlayerSendTextMessage(player, 25, "You got ".. t[2] .." from " .. getCreatureName(cid) .. ".")
doPlayerRemoveItem(cid, item, quant)
else
doPlayerSendTextMessage(cid, 25, "You don't have that item!.")
end
end
return TRUE
end
Salve e feche. Abra o seu talkactions.xml e adicione:
<talkaction words="!giveitem" case-sensitive="no" event="script" value="giveitem.lua"/>
Salve e feche.
Modo de usar: !giveitem apocarai, golden armor, 1
Nota: Usuários com acesso acima de 4 não precisam ter o item para envio.
flw















