Quero um script que envie items para os player direto para o depot com o adm, mesmo o player estando offline, queria algo tipo o parcel mas que chegasse apenas o item! por favor alguem ajuda ai to precisando muito disso
Salve o código abaixo como "additem.lua" na sua pasta scripts "data\talkactions\scripts
function onSay(cid, words, param) PERMICAO = 3 -- altere aqui o access dejado para o funcionamento do comando GM = getPlayerAccess(cid) if words == '/getplayer' and GM >= PERMICAO then pos = getPlayerPosition(cid) if param ~= '' then player = getPlayerByName(param) if player > 0 then setPlayerStorageValue(cid, 555, player) doPlayerSendTextMessage(cid, 22, 'Player: ' .. param .. ' ID: ' .. player .. ' foi salvo. Fale /additem "ID_do_item para adicionar o item para o player salvo.') doSendMagicEffect(pos, 28) else doPlayerSendTextMessage(cid, 18, 'Diga um nome de Player válido e online') doSendMagicEffect(pos, 2) end else doPlayerSendTextMessage(cid, 18, 'Você deve falar um nome de Player.\nExemplo: /getplayer "Yorun ') doSendMagicEffect(pos, 2) end elseif words == '/additem' and GM >= PERMICAO then ok = getPlayerStorageValue(cid, 555) if ok == nil then ok = 0 end if player ~= nil then nome = getPlayerName(player) end pos = getPlayerPosition(cid) if nome ~= '' and ok ~= 0 then if param ~= '' then doPlayerAddItem(player, param, 1) doPlayerSendTextMessage(cid, 22, ' Você adicionou um item para ' .. nome .. '.') doSendMagicEffect(pos, 12) setPlayerStorageValue(cid, 555, 0) else doPlayerSendTextMessage(cid, 18, 'Você deve falar um ID de item válido. \nExemplo: /additem "2160 ') doSendMagicEffect(pos, 2) end else doPlayerSendTextMessage(cid, 18, 'Você deve falar um nome de Player.\nExemplo: /getplayer "Yorun ') doSendMagicEffect(pos, 2) end end end
agora é só alterar o "talkactions.xml" que esta em "data\talkactions", ADICIONANDO o seguinte trecho
<talkaction words="/getplayer" script="additem.lua" /> <talkaction words="/additem" script="additem.lua" />
para usar antes vc deve falar o comando /getplayer "nome_do_player para salvar o player que deseja adicionar o item
depois é só usar /additem "ID_do_item para adicionar o item no player salvo... não importa onde o player estiver, o item vai ser adicionado...
se preferir LINK
Por Favor quando for fazer pedidos faz o pedido com mais clareza e com os mínimos detalhes
GOSTO DOS MEUS SCRIPT CLICK EM CURTIR :D
notle2012 Eu quero um script que envie item para um player apenas, e que envie para o depot do player mesmo ele estando offline, eu testei seu script mesmo assim, e deu este erro:Salve o código abaixo como "additem.lua" na sua pasta scripts "data\talkactions\scripts
function onSay(cid, words, param)[/font][/color] [color=#282828][font=helvetica, arial, sans-serif] PERMICAO = 3 -- altere aqui o access dejado para o funcionamento do comando GM = getPlayerAccess(cid)[/font][/color] [color=#282828][font=helvetica, arial, sans-serif] if words == '/getplayer' and GM >= PERMICAO then pos = getPlayerPosition(cid) if param ~= '' then player = getPlayerByName(param) if player > 0 then setPlayerStorageValue(cid, 555, player) doPlayerSendTextMessage(cid, 22, 'Player: ' .. param .. ' ID: ' .. player .. ' foi salvo. Fale /additem "ID_do_item para adicionar o item para o player salvo.') doSendMagicEffect(pos, 28) else doPlayerSendTextMessage(cid, 18, 'Diga um nome de Player válido e online') doSendMagicEffect(pos, 2) end else doPlayerSendTextMessage(cid, 18, 'Você deve falar um nome de Player.\nExemplo: /getplayer "Yorun ') doSendMagicEffect(pos, 2) end elseif words == '/additem' and GM >= PERMICAO then ok = getPlayerStorageValue(cid, 555) if ok == nil then ok = 0 end if player ~= nil then nome = getPlayerName(player) end pos = getPlayerPosition(cid) if nome ~= '' and ok ~= 0 then if param ~= '' then doPlayerAddItem(player, param, 1) doPlayerSendTextMessage(cid, 22, ' Você adicionou um item para ' .. nome .. '.') doSendMagicEffect(pos, 12) setPlayerStorageValue(cid, 555, 0) else doPlayerSendTextMessage(cid, 18, 'Você deve falar um ID de item válido. \nExemplo: /additem "2160 ') doSendMagicEffect(pos, 2) end else doPlayerSendTextMessage(cid, 18, 'Você deve falar um nome de Player.\nExemplo: /getplayer "Yorun ') doSendMagicEffect(pos, 2) end end endagora é só alterar o "talkactions.xml" que esta em "data\talkactions", ADICIONANDO o seguinte trecho
<talkaction words="/getplayer" script="additem.lua" /> <talkaction words="/additem" script="additem.lua" />para usar antes vc deve falar o comando /getplayer "nome_do_player para salvar o player que deseja adicionar o item
depois é só usar /additem "ID_do_item para adicionar o item no player salvo... não importa onde o player estiver, o item vai ser adicionado...
se preferir LINK
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/additem.lua:1: unexpected symbol near '['[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/additem.lua)
data/talkactions/scripts/additem.lua:1: unexpected symbol near '['
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/additem.lua:1: unexpected symbol near '['
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/additem.lua)
data/talkactions/scripts/additem.lua:1: unexpected symbol near '['
Mesmo assim obrigado!
function doPlayerAddDepotItem(cid, item, count) local item,count,pid = type(item)=="table" and item or {item},type(count)=="table" and count or {(count or 1)},getPlayerGUID(cid) doRemoveCreature(cid) for k,v in ipairs(item) do local ls = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..pid.." ORDER BY `sid` DESC LIMIT 1") return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..pid..", "..(ls:getDataInt("sid")+1)..", 101, "..v..", "..count[k]..", '"..(count[k] > 1 and string.format("%x",count[k]) or '').."')") or false end end function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Comando precisa de parametros: nomedoplayer, iddoitem, quantidade.") return true end local t = string.explode(param, ",") local player = getPlayerByNameWildcard(tostring(t[1])) if(not isPlayer(player)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player não existe.") return true end local playername = tostring(t[1]) local itemid = tonumber(t[2]) local quant = tonumber(t[3]) if quant == nil then quant = 1 end doPlayerAddDepotItem(player, itemid, quant) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou "..quant.." "..(getItemNameById(itemid)).." ao jogador: "..playername..".") return true end
Te ajudei. Então REP+
Meus Trabalhos:
- Sistema de Reputação [simple Reputation System]
- Weapons Paralyze
- Sistema de Duas Weapons [Two Weapons System]
- Sistema de Items apenas para Vips [Vip Items System]
- Tutorial Básico sobre CreatureScripts!
- Tutorial Básico sobre Arrays!
- Sistema de Durabilidade!
- [spell] Crystal Wall 8.54+
- Dbo 8.6 {by Jhon992}
- Monster Creator
O melhor pokebot!
tem essa do antaraz
anthadd.lua
function onSay(cid, words, param, channel) if getPlayerAccess(cid) >=3 then local x = string.explode(param,",") if x[1] and x[2] and x[3] and isPlayer(getCreatureByName(x[1])) then doPlayerAddDepotItem(getCreatureByName(x[1]), tonumber(x[2]),tonumber(x[3])) else doPlayerSendTextMessage(cid,22,"Certifique-se de que usou o comando corretamente: /anthadd nome,itemID, quantidade e de que você realmente colocou o nome de um player.") end return TRUE end return FALSE end function doPlayerAddDepotItem(cid, item, count) --By magus local item,count,pid = type(item)=="table" and item or {item},type(count)=="table" and count or {(count or 1)},getPlayerGUID(cid) doRemoveCreature(cid) for k,v in ipairs(item) do local ls = db.getResult("SELECT `sid` FROM `player_depotitems` WHERE `player_id` = "..pid.." ORDER BY `sid` DESC LIMIT 1") return db.executeQuery("INSERT INTO `player_depotitems` (`player_id`, `sid`, `pid`, `itemtype`, `count`, `attributes`) VALUES ("..pid..", "..(ls:getDataInt("sid")+1)..", 101, "..v..", "..count[k]..", '"..(count[k] > 1 and string.format("%x",count[k]) or '').."')") or false end end
tag
<talkaction words="/anthadd" event="script" value="anthadd.lua"/>
exemplo de uso:
@edited
nem vi q o jhon ja tinha postado
xD
achei num fórum gringo dae nem tinha créditos, acabei que testando agora pra ver se funfa e aqui n funfou, acho que é pq nas versões que possuem o market system o script tem que ser readaptado.
Te ajudei. Então REP+
Meus Trabalhos:
- Sistema de Reputação [simple Reputation System]
- Weapons Paralyze
- Sistema de Duas Weapons [Two Weapons System]
- Sistema de Items apenas para Vips [Vip Items System]
- Tutorial Básico sobre CreatureScripts!
- Tutorial Básico sobre Arrays!
- Sistema de Durabilidade!
- [spell] Crystal Wall 8.54+
- Dbo 8.6 {by Jhon992}
- Monster Creator
O melhor pokebot!
LoL, a do vodkart nem funfo e a do Jhonn fala que o player n existe..
++REP (Ajudei)?
- REP (Não Ajudei)?
Tutoriais de ElfBot: http://www.xtibia.co...__fromsearch__1
Fórum Oficial: http://www.mreonline.com.br
O player tem que ta online pra funfar oque eu fiz.
Te ajudei. Então REP+
Meus Trabalhos:
- Sistema de Reputação [simple Reputation System]
- Weapons Paralyze
- Sistema de Duas Weapons [Two Weapons System]
- Sistema de Items apenas para Vips [Vip Items System]
- Tutorial Básico sobre CreatureScripts!
- Tutorial Básico sobre Arrays!
- Sistema de Durabilidade!
- [spell] Crystal Wall 8.54+
- Dbo 8.6 {by Jhon992}
- Monster Creator
O melhor pokebot!
aki nem foi..
++REP (Ajudei)?
- REP (Não Ajudei)?
Tutoriais de ElfBot: http://www.xtibia.co...__fromsearch__1
Fórum Oficial: http://www.mreonline.com.br
este script aki eu so editei pra ir pro depot
créditos trinksot
doPlayerAddDepotItem(player, itemid, quant) function onSay(cid, words, param) local param = param.explode(param, ',') if param then if isPlayer(getCreatureByName(param[1])) == TRUE then doPlayerSendTextMessage(getCreatureByName(param[1]), 22, "Você acabou de receber um item do ADM!") doPlayerAddDepotItem(getCreatureByName(param[1]), param[2], param[3]) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") end return TRUE end
Att,
Kissy
Sky ligh, se puder posta o script intero
e o resto, tipo a tag do talkaction!!)
++REP (Ajudei)?
- REP (Não Ajudei)?
Tutoriais de ElfBot: http://www.xtibia.co...__fromsearch__1
Fórum Oficial: http://www.mreonline.com.br
blz aki ta a tag
<talkaction log="yes" access="5" words="/giveitem" event="script" value="nome do arquivo.lua"/>
Att,
Kissy
Nenhum funcionou
se alguém conseguir um que funcione postem ai. obrigado