Reward by Comand
Funcionamento: Esse script ele é bem simples, ele é apenas um comando que te possibilita editar qualquer item e adicionar diretamente ao outro player. Para fazer isso basta você falar o comando e por as coisas que você quer que ele tenha. Lembre-se que não tem uma ordem para adicionar os atributos assim você pode adicionar apenas o que precisa !! Nome*: Aqui você coloca o nome do jogar que vai receber o item .Id*: O id do item ou nome do item que o player vai receber. Quantidade: Aqui é a quantidade do item que o player vai receber. Atributos: O que o item vai ter de especial. * OBRIGATÓRIO Por exemplo: Tags: Script: Vá em data/talkaction/scripts e crie um arquivo chamado: additem.lua Após feito isso adicione o seguinte codigo nele:
function onSay(cid, words, param, channel)
local compater = {
['aid'] = 'aid',
['arm'] = 'armor',
['name'] = 'name',
['atk'] = 'attack',
['def'] = 'defense',
['eatk'] = 'extraattack',
['edef'] = 'extradefense',
['defense'] = 'defense',
['extradefense'] = 'extradefense',
['attack'] = 'attack',
['armor'] = 'armor',
['desc'] = 'description'
}
local sep = "="
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local t = string.explode(param, ",")
local k = {}
local sta
local o
local target = getPlayerByNameWildcard(t[1])
if(not target) then
target = getCreatureByName(t[1])
if(not target) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
return true
end
end
if(isPlayerGhost(target) and getPlayerGhostAccess(target) > getPlayerGhostAccess(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
return true
end
local id = tonumber(t[2])
if(not id) then
id = getItemIdByName(t[2], false)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
return true
end
end
local amount = 100
if (type(t[3]) == "number") then
amount = t[3]
sta = 3
else
sta = 2
end
for s = 1, #t-sta do
o = string.explode(t[sta+s], sep)
table.insert(k, o[1])
table.insert(k, o[2])
end
local item = doPlayerAddItem(target, id, amount)
for i = 1, #k do
if compater[k[i]] then
doItemSetAttribute(item,compater[k[i]],k[i+1])
end
end
return true
end