Fala ai galera, eu estava pensnado em criar um sistema que é igual ao Parcel. , voce usa o comando
!send PlayerName, ItemName, Quantidade
E ele envia os items em sua respectiva quantidade.
Exemplo :
!send Orochi, demon armor, 2
Eu enviaria 2 demon armor para o Orochi.
Bom, para começar a instalaçao voce vai em data/talkactions/talkactions.xml
e lá adiciona
<talkaction words="!send" hide="yes" event="script" value="send.lua"/>
Agora contunue na pasta dos talkactions, e vá em scripts. crie um arquivo chamado "send.lua" e dentro adicione
function onSay(cid, words, param, channel)
q = string.explode(param, ",")
pid = getPlayerByName(q[1])
if not pid then
doPlayerSendTextMessage(cid, 27, "Player Not Found or Player Offline")
return true
end
if pid == cid then
doPlayerSendTextMessage(cid, 27, "You cant send to you")
return true
end
i = string.lower(q[2])
x = getItemIdByName(i)
n = tonumber(q[3])
if not n then
doPlayerSendTextMessage(cid, 27, "You only use numbers")
return true
end
if not x then
doPlayerSendTextMessage(cid, 27, "Item not exist")
return true
end
if isInArray({"gold coin", "platinum coin", "crystal coin"}, q[2]) then
doPlayerSendTextMessage(cid, 27, "You cant send money")
return true
end
if getPlayerStorageValue(cid, 87123) <= 0 then
doPlayerSendTextMessage(cid, 27, "The "..q[1].." dont wanna receive your send")
return true
end
if param == "accept" then
setPlayerStorageValue(cid, 87123, 1)
doPlayerSendTextMessage(cid, 27, "You accept for receive items")
return true
end
if(doPlayerRemoveItem(cid, x, n) == true) then
for h = 1,n do
doPlayerAddItem(pid, x, h)
end
doPlayerSendTextMessage(pid, 27, "You received "..n.."x "..i.." of "..getCreatureName(cid))
doPlayerSendTextMessage(cid, 27, "You send "..n.."x "..i.." to "..q[1])
setPlayerStorageValue(pid, 87123, -1)
return true
else
doPlayerSendTextMessage(cid, 27, "You dont have "..n.."x of "..i)
return true
end
return true
end
OBS : O Site tirou a identaçao do script.
Bom, feito isso basta usar o seu sistema.
Créditos :
OrochiElf 100%
@EDIT : Feito uma alteraçao em :
Para o player aceitar o item, antes que o player2 envia
o player precisa executar o comando
!send accept
para que depois o player2 possa enviar o item.
caso contrario o player2 nao poderá envialo.