Ir para conteúdo
  • 0

AJuda aqui


garep

Pergunta

Gente to com esse script e a Opcodes Instaladas no server se alguem poder ajuda como fazer pra funcionar

InventorySlotStyles = {
  [InventorySlotHead] = "HeadSlot",
  [InventorySlotNeck] = "NeckSlot",
  [InventorySlotBack] = "BackSlot",
  [InventorySlotBody] = "BodySlot",
  [InventorySlotRight] = "RightSlot",
  [InventorySlotLeft] = "LeftSlot",
  [InventorySlotLeg] = "LegSlot",
  [InventorySlotFeet] = "FeetSlot",
  [InventorySlotFinger] = "FingerSlot",
  [InventorySlotAmmo] = "AmmoSlot"
}

Backgrounds = 
{
[0] = { path = '/images/inventory/Anbu_INV.png', id = 'background_anbu'},
[1] = { path = '/images/inventory/Uchiha_INV.png', id = 'background_uchiha'},
[2] = { path = '/images/inventory/Hyuuga_INV.png', id = 'background_hyuuga'},
[3] = { path = '/images/inventory/Aburame_INV.png', id = 'background_aburame'},
[4] = { path = '/images/inventory/Nara_INV.png', id = 'background_nara'},
[5] = { path = '/images/inventory/Inuzuka_INV.png', id = 'background_inuzuka'},
[6] = { path = '/images/inventory/Akimichi_INV.png', id = 'background_akimichi'},
[7] = { path = '/images/inventory/Maito_INV.png', id = 'background_maito'},
[8] = { path = '/images/inventory/Uchiha_INV.png', id = 'background_uchiha'},
}

inventoryWindow = nil
inventoryPanel = nil
inventoryButton = nil

function init()
  connect(LocalPlayer, { onInventoryChange = onInventoryChange })
  connect(g_game, { onGameStart = refresh })

  g_keyboard.bindKeyDown('Ctrl+I', toggle)

  inventoryButton = modules.client_topmenu.addRightGameToggleButton('inventoryButton', tr('Inventory') .. ' (Ctrl+I)', '/images/topbuttons/inventory', toggle)
  inventoryButton:setOn(true)

  inventoryWindow = g_ui.loadUI('inventory', modules.game_interface.getRightPanel())
  inventoryWindow:disableResize()
  inventoryPanel = inventoryWindow:getChildById('contentsPanel')

  local itemWidget = inventoryPanel:getChildById('slot9')
  itemWidget:setVisible(false)
  local itemWidget = inventoryPanel:getChildById('slot10')
  itemWidget:setVisible(false)
           
  refresh()
  inventoryWindow:setup()
  inventoryWindow:close()
    inventoryButton:setOn(false)
end

	ProtocolGame.registerExtendedOpcode(26, 
	function (protocol, opcode, buffer) 
	local bg = Backgrounds[tonumber(vocation)] or Backgrounds[0]
	vocation = bg
	print(vocation) 
	end
	)

function terminate()
  disconnect(LocalPlayer, { onInventoryChange = onInventoryChange })
  disconnect(g_game, { onGameStart = refresh })

  g_keyboard.unbindKeyDown('Ctrl+I')

  inventoryWindow:destroy()
  inventoryButton:destroy()
end

function refresh()
  local player = g_game.getLocalPlayer()
  for i=InventorySlotFirst,InventorySlotLast do
    if g_game.isOnline() then
      onInventoryChange(player, i, player:getInventoryItem(i))
    else
      onInventoryChange(player, i, nil)
    end
  end
end

function toggle()
refresh()
  if inventoryButton:isOn() then
    inventoryWindow:close()
    inventoryButton:setOn(false)
  else
    inventoryWindow:open()
    inventoryButton:setOn(true)
  end
end

function onMiniWindowClose()
  inventoryButton:setOn(false)
end

-- hooked events
function onInventoryChange(player, slot, item, oldItem)
      local player = g_game.getLocalPlayer()
      if(player) then 
      local vocation = player:getVocation()
      if(vocation ~= 0) then
      inventoryWindow:setImageSource(Backgrounds[vocation].path)
      end
      end
      
  if slot >= InventorySlotPurse then return end
  local itemWidget = inventoryPanel:getChildById('slot' .. slot)
  if item then
    itemWidget:setStyle('Item')
    itemWidget:setItem(item)
  else
    itemWidget:setStyle(InventorySlotStyles[slot])
    itemWidget:setItem(nil)
  end
end

tentei usar esse e ñ foi

function onExtendedOpcode(cid, opcode, buffer)
if opcode == 25 then
    doSendPlayerExtendedOpcode(cid, 26, getPlayerVocation(cid))
end
    return true
end

quero so a oque precisar no servidor, pois ja tentei varios cods e n vai ;x

Editado por garep
Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...