Postado Julho 14, 2015 9 anos CONST_SLOT_HEAD = 1 --Cabeça CONST_SLOT_NECKLACE = 2 --Pescoço CONST_SLOT_BACKPACK = 3 --Mochila CONST_SLOT_ARMOR = 4 --Tronco/armadura CONST_SLOT_RIGHT = 5 --Braço direito CONST_SLOT_LEFT = 6 --Braço Esquerdo CONST_SLOT_LEGS = 7 --Pernas CONST_SLOT_FEET = 8 --Pés CONST_SLOT_RING = 9 --Anel CONST_SLOT_AMMO = 10 --Munições/ exemplo: flecha Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais... ________________________________________________________________________________ Minhas Sprites: Mega Metagross Mega Abomasnow Pack de Shinys [Posso atualizá-lo com novos shinys a qualquer momento] Tutoriais: [Completo] Criando e adicionando um novo Pokémon [Actions] Criando quest no RME Editores Lua/Xml/Sync Entre outros: Editores Win/Mac/Linux
Postado Julho 18, 2015 9 anos Autor CONST_SLOT_HEAD = 1 --Cabeça CONST_SLOT_NECKLACE = 2 --Pescoço CONST_SLOT_BACKPACK = 3 --Mochila CONST_SLOT_ARMOR = 4 --Tronco/armadura CONST_SLOT_RIGHT = 5 --Braço direito CONST_SLOT_LEFT = 6 --Braço Esquerdo CONST_SLOT_LEGS = 7 --Pernas CONST_SLOT_FEET = 8 --Pés CONST_SLOT_RING = 9 --Anel CONST_SLOT_AMMO = 10 --Munições/ exemplo: flecha Ok, mas onde eu coloco isso? tem como você colocar isso nesse script: local config = { check = {"check", "viwer", "verificar", "ver"}, delete = {"del", "delete", "deletar"}, search = {"search", "procurar"} } function getItemsInContainer(cont, sep) local text, tsep, count = "", "", "" for i = 1, sep do tsep = tsep .. "-" end tsep = tsep .. ">" for i = 0, getContainerSize(cont.uid) - 1 do local item = getContainerItem(cont.uid, i) if not isContainer(item.uid) then if item.type > 0 then count = "(" .. item.type .. "x)" end text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " " .. count .. " (" .. item.itemid .. ")" else if getContainerSize(item.uid) > 0 then text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" text = text .. getItemsInContainer(item, sep + 2) .. " (" .. item.itemid .. ")" else text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" end end end return text end function onSay(cid, words, param, channel) local slotName = {CONST_SLOT_BACKPACK, CONST_SLOT_RIGHT, CONST_SLOT_FEET} local t = string.explode(param, ",") if(table.isStrIn(param, config.check)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[2]) if isPlayer(player) then local text = getPlayerName(player) .. "'s Equipment: " for i = 1, #slotName do text = text .. "\n\n" local item = getPlayerSlotItem(player, slotName[i]) if item.itemid > 0 then if isContainer(item.uid) then text = text .. slotName[i] .. ": " .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ") " .. getItemsInContainer(item, 1) else text = text .. slotName[i] .. ": " .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" end else text = text .. slotName[i] .. ": Empty" end end doShowTextDialog(cid, 6579, text) else doPlayerSendCancel(cid, "This player is not online.") end end elseif(table.isStrIn(param, config.delete)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[3]) if isPlayer(player) then count = t[4] if(not t[4]) then count = 1 end if getPlayerItemCount(player, t[2]) > 0 then if doPlayerRemoveItem(player, t[2], count) then doPlayerSendCancel(cid, "Item Deletado.") else doPlayerSendCancel(cid, "Este player não esta quantidade.") end else doPlayerSendCancel(cid, "Este player não tem o item.") end end end elseif(table.isStrIn(param, config.search)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[3]) local result = db.getResult("SELECT name, online FROM players WHERE id IN (SELECT player_id FROM player_items WHERE itemtype = " .. t[2] .. ");") local msg = "Resultados da busca pelo item " .. t[2] .. " em seu banco de dados:\n\n" if result:getID() ~= -1 then while true do local name = result:getDataString("name") local online = result:getDataInt("online") msg = msg .. name .. " [" .. (online == 1 and "Online" or "Offline") .. "]\n" if not result:next() then break end end else msg = msg .. "O item não foi encontrado em nenhum jogador." end doShowTextDialog(cid, t[2], msg) end end return true end Ok, mas onde eu coloco isso? tem como você colocar isso nesse script: local config = { check = {"check", "viwer", "verificar", "ver"}, delete = {"del", "delete", "deletar"}, search = {"search", "procurar"} } function getItemsInContainer(cont, sep) local text, tsep, count = "", "", "" for i = 1, sep do tsep = tsep .. "-" end tsep = tsep .. ">" for i = 0, getContainerSize(cont.uid) - 1 do local item = getContainerItem(cont.uid, i) if not isContainer(item.uid) then if item.type > 0 then count = "(" .. item.type .. "x)" end text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " " .. count .. " (" .. item.itemid .. ")" else if getContainerSize(item.uid) > 0 then text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" text = text .. getItemsInContainer(item, sep + 2) .. " (" .. item.itemid .. ")" else text = text .. "\n" .. tsep .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" end end end return text end function onSay(cid, words, param, channel) local slotName = {CONST_SLOT_BACKPACK, CONST_SLOT_RIGHT, CONST_SLOT_FEET} local t = string.explode(param, ",") if(table.isStrIn(param, config.check)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[2]) if isPlayer(player) then local text = getPlayerName(player) .. "'s Equipment: " for i = 1, #slotName do text = text .. "\n\n" local item = getPlayerSlotItem(player, slotName[i]) if item.itemid > 0 then if isContainer(item.uid) then text = text .. slotName[i] .. ": " .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ") " .. getItemsInContainer(item, 1) else text = text .. slotName[i] .. ": " .. getItemNameById(item.itemid) .. " (" .. item.itemid .. ")" end else text = text .. slotName[i] .. ": Empty" end end doShowTextDialog(cid, 6579, text) else doPlayerSendCancel(cid, "This player is not online.") end end elseif(table.isStrIn(param, config.delete)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[3]) if isPlayer(player) then count = t[4] if(not t[4]) then count = 1 end if getPlayerItemCount(player, t[2]) > 0 then if doPlayerRemoveItem(player, t[2], count) then doPlayerSendCancel(cid, "Item Deletado.") else doPlayerSendCancel(cid, "Este player não esta quantidade.") end else doPlayerSendCancel(cid, "Este player não tem o item.") end end end elseif(table.isStrIn(param, config.search)) then if getPlayerGroupId(cid) >= 5 then local player = getPlayerByNameWildcard(t[3]) local result = db.getResult("SELECT name, online FROM players WHERE id IN (SELECT player_id FROM player_items WHERE itemtype = " .. t[2] .. ");") local msg = "Resultados da busca pelo item " .. t[2] .. " em seu banco de dados:\n\n" if result:getID() ~= -1 then while true do local name = result:getDataString("name") local online = result:getDataInt("online") msg = msg .. name .. " [" .. (online == 1 and "Online" or "Offline") .. "]\n" if not result:next() then break end end else msg = msg .. "O item não foi encontrado em nenhum jogador." end doShowTextDialog(cid, t[2], msg) end end return true end Ajuda nisso aqui alguem!! plz Editado Julho 18, 2015 9 anos por TsplayerT (veja o histórico de edições) Meus Contatos! Minhas Funções: Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.