Lukkas2201

Members
  • Content Count

    46
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Lukkas2201

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Lukkas2201

    Ajuda com Script

    em resources separados, esse que mandei é o inventario normal, o modificado é o dayz:new_inv, o new_inv está exportando funcao pra este inventario poder usar para poder abrir ele.
  2. Lukkas2201

    Ajuda com Script

    não, tem 2 inventarios, os dois funcionam normalmente, vc abre o padrao, e com ele aberto vc consegue alternar pro modificado e vice versa, porem queria deixar somente o modificado, pra quando abrir o inventario, ao invez de abrir o padrao , so abrir o modificado.
  3. Lukkas2201

    Ajuda com Script

    Não sei porquê tanta ignorância com a minha pessoa, entendo que nos meus tópicos antigos, eu era sim meio doido da cabeça, postava umas coisas nada a ver, postava tópico atras do outro, mas eu parei com isso, e o pior é que quando eu posto, eu pergunto oque tenho que fazer, e não peço o script pronto, ao contrário de vários tópicos que vejo, de gente que pede e vão lá e fazem o script prontinho pro cara, mas quando é comigo, o povo "ignora" meu tópico, difícil pedir ajuda assim, está até parecendo que vcs só ajudam quem vocês querem ajudar, eu apenas peço para me ajudar a identificar o erro, ou a possível solução, mas nem isso fazem, complicado desse jeito.
  4. Lukkas2201

    [AJUDA] SISTEMA DE ID |

    Poderia comentar lá ? para eu tentar explicar melhor, assim podemos sair deste tópico também, para não poluir com mensagens desnecessárias.
  5. Lukkas2201

    [AJUDA] SISTEMA DE ID |

    desculpe, mas ignorou por qual motivo?
  6. Lukkas2201

    [AJUDA] SISTEMA DE ID |

    Lord, desculpa vir neste tópico invadir assim, pode me ajudar com meu tópico? agradeço ..
  7. Lukkas2201

    Ajuda com Script

    Sim eu faço isso, até então funciona de boa, mas quando eu reconecto n oservidor, ai aperto J pra abrir o inventário, não aparece nada. e tipo, eu inicio normal o servidor, ai eu marco a checkbox do inventario modificado, ai eu removo todas as checkbox, e reinicio o servidor, ai funciona, mas só funciona porque a checkbox que está selecionada era ad o inventário modiificado, se eu tivesse deixado selecionada a check box padrão, não iria funcionar, que é o caso quando eu reconecto, quando eu reconecto no servidor, a checkbox volta pra padrão ai quando aperto J não abre o inventário.
  8. Lukkas2201

    Ajuda com Script

    Boa noite, estou tentando fazer o seguinte, no servidor tem dois tipos de inventário (padrão e o modificado), vc aperta a Tecla 'J' e ele abre o inventário padrão, porém na hora que ele abre o inventário padrão, se vc apertar um botão ele troca para o inventário modificado, a porém eu queria deixar fixo, para quando apertar J, abrir somente o modificado, e não ter como mudar para o padrão, ou seja, quero que o inventário modificado seja o novo inventário padrão, (o inventário modificado vem de outro script, mas creio que nao preciso postar ele, porque a configuração de abrir está neste script abaixo), se alguém puder me ajudar e me dizer oque fazer, ou onde tenho que alterar algo, eu ficarei grato. o (new_inv) é o inventário modificado. ele vem de outro script que seria uma resource. a função no qual abre o inventário é a "function showInventory(key,keyState)" -----------S1L3NC3 inventoryItems = { ["Primary Weapon"] = {}, ["Secondary Weapon"] = {}, ["Specially Weapon"] = {}, ["Pistols"] = {}, ["Ammo"] = {}, ["Food"] = { {"Canned Spaghetti (Fechado)",1,"","Espaguete enlatado fechado, necessário o item *Opener* para abrir. \nClique 2x para abrir."}, {"Canned Spaghetti (Aberto)",1,"","Espaguete enlatado aberto.\nPara comer clique 2x"}, {"Canned Baked Beans (Fechado)",1,"","Feijão enlatado fechado, necessário o item *Opener* para abrir. \nClique 2x para abrir."}, {"Canned Baked Beans (Aberto)",1,"","Feijão enlatado aberto.\nPara comer clique 2x"}, {"Canned Sardines (Fechado)",1,"","Sardinha enlatada fechada, necessário o item *Opener* para abrir. \nClique 2x para abrir."}, {"Canned Sardines (Aberto)",1,"","Sardinha enlatada aberta.\nPara comer clique 2x"}, {"Can of Tactical Bacon (Fechado)",1,"","Bacon enlatado fechado, necessário o item *Opener* para abrir. \nClique 2x para abrir."}, {"Can of Tactical Bacon (Aberto)",1,"","Bacon enlatado aberto.\nPara comer clique 2x"}, {"Water Bottle",1,"","Garrafa de água.\nPara beber clique 2x"}, {"Burger",1,"","Burguer.\nPara comer clique 2x"}, {"Pizza",1,"","Pizza\nPara comer clique 2x"}, {"Soda Bottle",1,"","Soda Bottle.\nPara beber clique 2x"}, {"Milk",1,"","Milk.\nPara beber clique 2x"}, {"Cooked Meat",1,"","Carne Assada.\nPara comer clique 2x"}, {"Raw Meat",1,"","Carne Crua.\nPara assar é necessário o acender um Wood Pile\nPara Assar clique com o scroll do mouse no Wood Pile"}, }, ["Medic"] = { {"Antibiotics",1,"Usar","Antibiotcs"}, {"Bandage",1,"Usar","Bandage, usado para estancar curativos.\nPara usar clique 2x"}, {"Medic Kit",2,"Usar","Medic Kit, usado para aumentar o blood.\nPara usar clique 2x"}, {"Heat Pack",1,"Usar","Heat Pack.\nPara usar clique 2x"}, {"Painkiller",1,"Usar","Painkiller, usado para aliviar dores de cabeça.\nPara usar clique 2x"}, {"Blood Bag",1,"Usar","Blood Bag, bolsa de sangue, usado para aumentar o blood de outro player.\nPara usar se aproxime do player, e clique com o scrol do mouse em *Administer Blood Bag*"}, {"Morphine",1,"Usar","Morphine, usado para curar ossos quebrados.\nPara usar clique 2x"}, }, ["VehicleParts"] = { {"Engine",5,"","Motor, usado em veículos, necessário o item *Toolbox* para colocar no veículo.\nPara colocar no veículo aperta o Scrol do mouse em *Colocar Engine*"}, {"Tire",2,"","Pneu, usado em veículos, necessário o item *Toolbox* para colocar no veículo.\nPara colocar no veículo aperta o Scrol do mouse em *Colocar Tire*"}, {"Tank Parts",3,"","Tanque de Gasolina, usado em veículos, necessário o item *Toolbox* para colocar no veículo.\nPara colocar no veículo aperta o Scrol do mouse em *Colocar Tank Parts*"}, {"Scrap Metal",1,"","Ferramenta utilizada para reparar veículos, necessário o item *Toolbox* junto para poder reparar.\nPara colocar no veículo aperta o Scrol do mouse em *Reparar Veículo*"}, {"Steel Sheet",1,"","Armadura para veículos.\nPara colocar no veículo aperta o Scrol do mouse em *Colocar Steel Sheet*"}, {"Empty Gas Canister",2,"","Galão de Gasolina Vazio, para encher, vá até um posto de gasolina\nPara encher, aproxime-se da bomba de gasolina, e clique com o scroll do mouse."}, {"Full Gas Canister",2,"","Galão de Gasolina cheio\nPara abastecer o veículo, clique com o Scrol do mouse em *Colocar Gasolina*."}, }, ["Items"] = { {"Stinger",3,"Place Stinger","Tapete de pregos, usado para furar pneu de veículos.\nPara usar clique 2x."}, {"Wood Pile",2,"","Fogueira, necessários o item *Box Of Matches* para acender."}, {"Roadflare",1,"Place","Quando colocado, acende uma luz bem forte, para chamar atenção de outros players\nClique 2x para colocar."}, {"Wire Fence",1,"Colocar Wire Fence","Cerca de Arame (Para remover ela, necessário item *Toolbox*\nClique 2x para colocar."}, {"Tent",3,"Pitch a Tent","Tenda, usado para guardar itens.\nPara montar, clique 2x."}, {"Empty Water Bottle",1,"","Garrafa de água vazia\nPara encher, vá até o mar, e clique 2x."}, {"Empty Soda Cans",1,"","Lata de soda vazia."}, }, ["Roupas"] = { }, ["Mochilas"] = { }, ["Toolbelt"] = { {"Night Vision Goggles",0,"","Visão noturna, usado para enxergar melhor a noite.\nPara ativar aperte a tecla N"}, {"Infrared Goggles",0,"","Visão infra vermelho, usado para enxergar melhor os objetos e inimigos\nPara ativar aperte a tecla I"}, {"Map",0,"","Mapa\nPara usar aperte F11"}, {"Box of Matches",0,"Make a Fire","Esqueiro, usado para acender fogueira (necessário item *Wood Pile*\nPara acender se aproxime da fogueira e clique com o scrol do mouse.",}, {"Watch",0,"","Relógio"}, {"GPS",0,"Set Rate","Radar, usado para setar frequência e encontrar outros players"}, -- se for ativar frequencia do gps "Set Rate" {"Toolbox",0,"","Caixa de Ferramentas, usado para colocar peças em veículos, remover wire fences e stingers"}, {"Radio Device",0,"","Usado em veículos para poder ouvir rádio"}, {"Syringe",0,"","Siringa"}, {"Opener",0,"","Usado para abrir comidas fechadas"}, {"Hose",0,"","Mangueira, usada para retirar gasolina de um veículo.\nPara retirar gasolina, ela precisa estar acima de 20 no veículo, clique com o scrol do mouse em *Retirar Gasolina*."}, {"Tire Repair Kit",0,"","Kit de Reparos de pneu"}, {"Compass",0,"","Kit de Reparos de pneu"}, }} local sacks = { {"Smersh Backpack",10}, {"Courier Bag",11}, {"Child Briefcase",12}, {"Improvised Backpack",14}, {"Assault Pack (ACU)",16}, {"Alice Pack",18}, {"British Assault Pack",20}, {"Taloon Backpack",22}, {"Omega Backpack",24}, {"Alfa Backpack",26}, {"Hunting Backpack",28}, {"Camping Backpack",30}, {"Drybag Backpack",32}, {"Mountain Backpack",36}, {"Czech Backpack",40}, {"Camping Tactical Backpack",42}, {"Coyote Backpack",44}, {"Coyote Backpack (Desert)",45}, {"Coyote Backpack (Mossy)",46}, {"Tactical Backpack",48}, {"Eskimo Backpack",50}, {"Tiger Backpack",55}, {"Noel Backpack",68}, } addEventHandler("onClientResourceStart",resourceRoot,function() for i,weaponData in pairs(weaponTable)do if weaponData[5] == 1 then table.insert(inventoryItems["Primary Weapon"],{weaponData[1],3,weaponData[2],weaponData[11]}) elseif weaponData[5] == 2 then if weaponData[2] == "others" then table.insert(inventoryItems["Secondary Weapon"],{weaponData[1],2,weaponData[1],weaponData[11]}) else table.insert(inventoryItems["Secondary Weapon"],{weaponData[1],2,weaponData[2],weaponData[11]}) end elseif weaponData[5] == 3 then table.insert(inventoryItems["Specially Weapon"],{weaponData[1],1,weaponData[1],weaponData[11]}) elseif weaponData[5] == 4 then table.insert(inventoryItems["Pistols"],{weaponData[1],2,weaponData[2],weaponData[11]}) end if weaponData[2] ~= "others" then add = true for i,weaponData2 in pairs(inventoryItems["Ammo"])do if weaponData[2] == weaponData2[1] then add = false inventoryItems["Ammo"][i][4] = inventoryItems["Ammo"][i][4]..";\n"..weaponData[1] end end if add then table.insert(inventoryItems["Ammo"],{weaponData[2],weaponData[8],"","Ammo for:\n"..weaponData[1]}) end end end end) for i,vestData in pairs(VestsTable)do table.insert(inventoryItems["Items"],{vestData[1],1,"Use Vest",vestData[7]}) end for i,helmetData in pairs(HelmetsTable)do table.insert(inventoryItems["Items"],{helmetData[1],1,"Use Helmet",helmetData[7]}) end for i,bpData in pairs(BackpacksTable)do table.insert(inventoryItems["Items"],{bpData[1],1,"Wear Backpack","Backpack with "..bpData[2].." Slots"}) end -- убрать ------------------------------------------------------------------------------ --INVENTORY local headline = {} pname = getPlayerName(getLocalPlayer()):gsub('#%x%x%x%x%x%x',''):gsub('#%x%x%x%x%x%x','') inv_window = guiCreateWindow(0.15, 0.28, 0.72, 0.63,pname.."' Inventory", true) guiWindowSetSizable(inv_window, false) guiSetVisible(inv_window,false) InvImage = guiCreateStaticImage(0.01,0.03,1.99,100,"images/inventory.png",true,inv_window) guiSetAlpha(InvImage,1) guiSetProperty(InvImage,"Disabled","true") InventoryLabel = guiCreateLabel(0.58, 0.05, 0.39, 0.03, "Inventory", true, inv_window) guiSetFont(InventoryLabel, "default-bold-small") guiLabelSetHorizontalAlign(InventoryLabel, "center", false) LootLabel = guiCreateLabel(0.03, 0.05, 0.39, 0.03, "Gear", true, inv_window) guiSetFont(LootLabel, "default-bold-small") guiLabelSetHorizontalAlign(LootLabel, "center", false) loot_grid = guiCreateGridList(0.03, 0.10, 0.39, 0.83, true, inv_window) guiGridListSetSortingEnabled(loot_grid,false) loot_lootcolumn = guiGridListAddColumn(loot_grid,"Loot",0.7) loot_amountcolumn = guiGridListAddColumn(loot_grid,"Amount",0.2) inv_itemsgrid = guiCreateGridList(0.58, 0.11, 0.39, 0.83, true, inv_window) guiGridListSetSortingEnabled(inv_itemsgrid,false) inv_itemscolumn = guiGridListAddColumn(inv_itemsgrid,"Inventory",0.7) inv_amountcolumn = guiGridListAddColumn(inv_itemsgrid,"Amount",0.2) loot_takebutton = guiCreateButton(0.42, 0.17, 0.04, 0.69, "->", true, inv_window) guiSetFont(loot_takebutton, "default-bold-small") inv_dropbutton = guiCreateButton(0.53, 0.17, 0.04, 0.69, "<-", true, inv_window) guiSetFont(inv_dropbutton, "default-bold-small") inv_slotslabel = guiCreateLabel(0.62, 0.94, 0.29, 0.04, "Slots:", true, inv_window) guiSetFont(inv_slotslabel, "default-bold-small") guiLabelSetHorizontalAlign(inv_slotslabel, "center", false) guiLabelSetVerticalAlign(inv_slotslabel, "center") loot_amountlabel = guiCreateLabel(0.07, 0.94, 0.29, 0.04, "Empty", true, inv_window) guiSetFont(loot_amountlabel, "default-bold-small") guiLabelSetHorizontalAlign(loot_amountlabel, "center", false) guiLabelSetVerticalAlign(loot_amountlabel, "center") HideGear = guiCreateCheckBox(0.03,0.05,0.11,0.04,"Hide Gear",true,true,inv_window) guiSetFont(HideGear,"default-bold-small") SetGPSRateWindow = guiCreateWindow(0.42,0.45,0.08,0.13,"Set GPS Rate",true) guiWindowSetSizable(SetGPSRateWindow,false) guiSetVisible(SetGPSRateWindow,false) GPSRate = guiCreateEdit(0.10,0.25,0.81,0.25,"",true,SetGPSRateWindow) SetGPSRate = guiCreateButton(0.10,0.61,0.81,0.29,"Set",true,SetGPSRateWindow) guiSetFont(SetGPSRate,"default-bold-small") guiSetProperty(SetGPSRateWindow,"AlwaysOnTop","True") x,y = guiGetScreenSize() x2,y2 = guiGetSize(inv_window,false) x3,y3 = guiGetSize(SetGPSRateWindow,false) guiSetPosition(inv_window,x/2-x2/2,y/2-y2/2,false) guiSetPosition(SetGPSRateWindow,x/2-x3/2,y/2-y3/2,false) addEventHandler("onClientGUIClick",getResourceRootElement(getThisResource()),function() if source == SetGPSRate then rate = guiGetText(GPSRate) if rate ~= "" and tonumber(rate) then guiSetVisible(SetGPSRateWindow,false) setElementData(getLocalPlayer(),"GPSChannel",rate) else outputChatBox("Type a number!") end end end) local sW, sH = guiGetScreenSize() local topChangeButtonsParent = guiCreateLabel(100,100,100,30,"",false) local middleOnButton = guiCreateRadioButton ( 0,0,100, 15, "",false, topChangeButtonsParent) guiCreateRadioButton ( 0,15,100, 15, "",false, topChangeButtonsParent) guiRadioButtonSetSelected ( middleOnButton, true ) local bottomChangeButtonsParent = guiCreateLabel(100,100,100,30,"",false) local inventoryOnButton = guiCreateRadioButton ( 0,0,100, 15, "",false, bottomChangeButtonsParent) local inventoryOffButton = guiCreateRadioButton ( 0,15,100, 15, "",false, bottomChangeButtonsParent) guiRadioButtonSetSelected ( inventoryOnButton, true ) function changeMiddleVisible() exports.new_inv:setMiddleVisible(guiRadioButtonGetSelected(middleOnButton)) local x, top, bottom = exports.new_inv:getRadioButtonsCoords() guiSetPosition(topChangeButtonsParent,x,top,false) guiSetPosition(bottomChangeButtonsParent,x,bottom,false) end addEventHandler("onClientGUIClick",topChangeButtonsParent, changeMiddleVisible ) guiSetVisible(topChangeButtonsParent,false) function changeInventoryVisible() setElementData(localPlayer,"dayz:new_inv",guiRadioButtonGetSelected(inventoryOnButton)) if not guiRadioButtonGetSelected(inventoryOnButton) then exports.new_inv:hideNewInventory() else guiSetVisible(inv_window,false) hideRightClickInventoryMenu () end showInventory(nil,"down") guiSetVisible(bottomChangeButtonsParent,true) end addEventHandler("onClientGUIClick",bottomChangeButtonsParent, changeInventoryVisible ) guiSetVisible(bottomChangeButtonsParent,false) function showInventory(key,keyState) if getElementData(getLocalPlayer(),"cantOpenInv") then return end hideRightClickInventoryMenu() guiSetVisible(InfoWindow,false) local col = getElementData(getLocalPlayer(),"currentCol") local gearName = getElementData(getLocalPlayer(),"lootname") refreshLoot(col,gearName) if getElementData(getLocalPlayer(),"logedin") and keyState == "down" then local x, top, bottom = exports.new_inv:getRadioButtonsCoords() if getElementData ( localPlayer, "dayz:new_inv") then -- ESSE NEW_INV É O INVENTÁRIO MODIFICADO, O QUAL QUERO DEIXAR COMO PADRÃO guiRadioButtonSetSelected ( inventoryOnButton, true ) guiSetVisible(topChangeButtonsParent,not guiGetVisible(topChangeButtonsParent)) guiSetPosition(topChangeButtonsParent,x,top,false) guiSetPosition(bottomChangeButtonsParent,x,bottom,false) guiSetVisible(bottomChangeButtonsParent,not guiGetVisible(bottomChangeButtonsParent)) local show = exports.new_inv:showNewInventory() if show then onClientOpenInventoryStopMenu () end showCursor(show) return else guiRadioButtonSetSelected ( inventoryOffButton, true ) guiSetVisible(topChangeButtonsParent,false) end if guiGetVisible(inv_window) then --- AQUI É O INVENTÁRIO PADRÃO guiSetVisible(inv_window,false) guiSetVisible(SetGPSRateWindow,false) --guiSetVisible(SetGPSRateWindow,false) showCursor(false) guiSetVisible(bottomChangeButtonsParent,false) else guiSetVisible(inv_window,true) showCursor(true) guiSetPosition(bottomChangeButtonsParent,0.14*sW+0.72*sW,0.18*sH+0.63*sH-30,false) guiSetVisible(bottomChangeButtonsParent,true) end guiSetVisible(HideGear,false) if isPlayerInLoot() then if getElementData(col,"tent") then guiSetVisible(HideGear,true) if getElementData(col,"visible") then guiCheckBoxSetSelected(HideGear,false) else guiCheckBoxSetSelected(HideGear,true) end end end refreshInventory() if guiGetVisible(inv_window)== true then onClientOpenInventoryStopMenu() end end end bindKey("j","down",showInventory) addEventHandler("onClientGUIClick",HideGear,function() col = isPlayerInLoot() if col then if guiCheckBoxGetSelected(HideGear) then setElementData(col,"visible",false) else setElementData(col,"visible",true) end end end) function Debugg() setElementData(getLocalPlayer(),"loot",false) end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),Debugg) function showInventoryManual() if getElementData(localPlayer,"dayz:new_inv") then exports.new_inv:showNewInventory() return end guiSetVisible(inv_window,not guiGetVisible(inv_window)) showCursor(not isCursorShowing()) refreshInventory() if guiGetVisible(inventoryWindows)== true then onClientOpenInventoryStopMenu() end end function hideInventoryManual() guiSetVisible(inv_window,false) guiSetVisible(topChangeButtonsParent,false) guiSetVisible(bottomChangeButtonsParent,false) showCursor(false) if getElementData ( localPlayer, "dayz:new_inv") then return end hideRightClickInventoryMenu() end addEvent("hideInventoryManual",true) addEventHandler("hideInventoryManual",getLocalPlayer(),hideInventoryManual) function refreshInventoryManual() if getElementData ( localPlayer, "dayz:new_inv") then return end refreshInventory() end addEvent("refreshInventoryManual",true) addEventHandler("refreshInventoryManual",getLocalPlayer(),refreshInventoryManual) function refreshLootManual(loot) refreshLoot(loot) end addEvent("refreshLootManual",true) addEventHandler("refreshLootManual",getLocalPlayer(),refreshLootManual) function getMyInventory() local myInventory = {} for id, item in ipairs(inventoryItems["Primary Weapon"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Secondary Weapon"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Pistols"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Specially Weapon"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Ammo"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Food"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Medic"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["VehicleParts"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Items"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Toolbelt"]) do local quant = getElementData(getLocalPlayer(),item[1]) if quant and quant >= 1 then table.insert(myInventory,{item[1],quant}) end end return myInventory end function getLootInventory() local lootInventory = {} if not isElement (isPlayerInLoot()) then return false end for id, item in ipairs(inventoryItems["Primary Weapon"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Secondary Weapon"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Pistols"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Specially Weapon"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Ammo"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Food"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Medic"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["VehicleParts"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Items"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end for id, item in ipairs(inventoryItems["Toolbelt"]) do local quant = getElementData(isPlayerInLoot(),item[1]) if quant and quant >= 1 then table.insert(lootInventory,{item[1],quant}) end end return lootInventory end function getMySlots() vestSlots = getActiveVestSlots(getLocalPlayer()) if vestSlots then return {getPlayerCurrentSlots()+vestSlots,getPlayerMaxAviableSlots()+vestSlots} else return {getPlayerCurrentSlots(),getPlayerMaxAviableSlots()} end end function getLootSlots() if not isElement (isPlayerInLoot()) then return {0,0} else return {getLootCurrentSlots(isPlayerInLoot()),getLootMaxAviableSlots(isPlayerInLoot())} end end function refreshInventory() if(inv_itemscolumn) then row1,column1 = guiGridListGetSelectedItem(inv_itemsgrid) guiGridListClear(inv_itemsgrid) local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Primary Weapon",true,false) for id,item in ipairs(inventoryItems["Primary Weapon"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) if getElementData(getLocalPlayer(),"currentweapon_1") and item[1] == getElementData(getLocalPlayer(),"currentweapon_1") then guiGridListSetItemColor ( inv_itemsgrid, row, inv_itemscolumn,255,0,0) guiGridListSetItemColor ( inv_itemsgrid, row, inv_amountcolumn,255,0,0) end end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Secondary Weapon",true,false) for id,item in ipairs(inventoryItems["Secondary Weapon"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) if getElementData(getLocalPlayer(),"currentweapon_2") and item[1] == getElementData(getLocalPlayer(),"currentweapon_2") then guiGridListSetItemColor ( inv_itemsgrid, row, inv_itemscolumn,255,0,0) guiGridListSetItemColor ( inv_itemsgrid, row, inv_amountcolumn,255,0,0) end end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Pistols",true,false) for id,item in ipairs(inventoryItems["Pistols"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) if getElementData(getLocalPlayer(),"currentweapon_4") and item[1] == getElementData(getLocalPlayer(),"currentweapon_4") then guiGridListSetItemColor ( inv_itemsgrid, row, inv_itemscolumn,255,0,0) guiGridListSetItemColor ( inv_itemsgrid, row, inv_amountcolumn,255,0,0) end end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Specially Weapon",true,false) for id,item in ipairs(inventoryItems["Specially Weapon"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) if getElementData(getLocalPlayer(),"currentweapon_3") and item[1] == getElementData(getLocalPlayer(),"currentweapon_3") then guiGridListSetItemColor ( inv_itemsgrid, row, inv_itemscolumn,255,0,0) guiGridListSetItemColor ( inv_itemsgrid, row, inv_amountcolumn,255,0,0) end end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Ammo",true,false) for id,item in ipairs(inventoryItems["Ammo"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Foods / Drinks",true,false) for id,item in ipairs(inventoryItems["Food"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Medic",true,false) for id,item in ipairs(inventoryItems["Medic"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Vehicle Parts",true,false) for id,item in ipairs(inventoryItems["VehicleParts"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Misc",true,false) for id,item in ipairs(inventoryItems["Items"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) if getActiveVest(getLocalPlayer()) == item[1] then guiGridListSetItemColor(inv_itemsgrid,row,inv_itemscolumn,0,255,0) guiGridListSetItemColor(inv_itemsgrid,row,inv_amountcolumn,0,255,0) end if getActiveHelmet(getLocalPlayer()) == item[1] then guiGridListSetItemColor(inv_itemsgrid,row,inv_itemscolumn,0,255,0) guiGridListSetItemColor(inv_itemsgrid,row,inv_amountcolumn,0,255,0) end for i=1,#BackpacksTable do if item[1] == BackpacksTable[i][1] then if BackpacksTable[i][2] == getElementData(getLocalPlayer(),"MAX_Slots") then guiGridListSetItemColor(inv_itemsgrid,row,inv_itemscolumn,255,0,0) guiGridListSetItemColor(inv_itemsgrid,row,inv_amountcolumn,255,0,0) end end end end end local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,"- Toolbelt",true,false) for id,item in ipairs(inventoryItems["Toolbelt"])do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then local row = guiGridListAddRow(inv_itemsgrid) guiGridListSetItemText(inv_itemsgrid,row,inv_itemscolumn,item[1],false,false) guiGridListSetItemText(inv_itemsgrid,row,inv_amountcolumn,getElementData(getLocalPlayer(),item[1]),false,false) end end if row1 and column1 then guiGridListSetSelectedItem(inv_itemsgrid,row1,column1) end vestSlots = getActiveVestSlots(getLocalPlayer()) if vestSlots then guiSetText(inv_slotslabel,"Slots: "..getPlayerCurrentSlots()+vestSlots.."/"..getPlayerMaxAviableSlots().." + "..vestSlots) else guiSetText(inv_slotslabel,"Slots: "..getPlayerCurrentSlots().."/"..getPlayerMaxAviableSlots()) end end end function refreshLoot(loot,gearName) if loot == false then guiGridListClear(loot_grid) guiSetText(loot_amountlabel,"Empty") guiSetText(LootLabel,"Gear") return end if(loot_lootcolumn) then row2,column2 = guiGridListGetSelectedItem(loot_grid) guiGridListClear(loot_grid) if gearName then guiSetText(LootLabel,gearName) end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Primary Weapon",true,false) for id,item in ipairs(inventoryItems["Primary Weapon"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Secondary Weapon",true,false) for id,item in ipairs(inventoryItems["Secondary Weapon"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Pistols",true,false) for id,item in ipairs(inventoryItems["Pistols"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Specially Weapon",true,false) for id,item in ipairs(inventoryItems["Specially Weapon"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Ammo",true,false) for id,item in ipairs(inventoryItems["Ammo"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Foods / Drinks",true,false) for id,item in ipairs(inventoryItems["Food"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Medic",true,false) for id,item in ipairs(inventoryItems["Medic"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Vehicle Parts",true,false) for id,item in ipairs(inventoryItems["VehicleParts"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Misc",true,false) for id,item in ipairs(inventoryItems["Items"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,"- Toolbelt",true,false) for id,item in ipairs(inventoryItems["Toolbelt"])do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then local row = guiGridListAddRow(loot_grid) guiGridListSetItemText(loot_grid,row,loot_lootcolumn,item[1],false,false) guiGridListSetItemText(loot_grid,row,loot_amountcolumn,getElementData(loot,item[1]),false,false) end end if row2 and column2 then guiGridListSetSelectedItem(loot_grid,row2,column2) end guiSetText(loot_amountlabel,"Slots: "..getLootCurrentSlots(loot).."/"..(getLootMaxAviableSlots(loot)or 0)) end end function getPlayerMaxAviableSlots() return getElementData(getLocalPlayer(),"MAX_Slots") end function getLootMaxAviableSlots(loot) return getElementData(loot,"MAX_Slots") end function getPlayerCurrentSlots() local current_SLOTS = 0 for _,category in pairs(inventoryItems)do for id,item in pairs(category)do if getElementData(getLocalPlayer(),item[1]) and getElementData(getLocalPlayer(),item[1])>= 1 then current_SLOTS = current_SLOTS + item[2]*getElementData(getLocalPlayer(),item[1]) end end end if getActiveVest(getLocalPlayer()) then current_SLOTS = current_SLOTS - getActiveVestSlots(getLocalPlayer()) end if isWeaponEquiped(1) then current_SLOTS = current_SLOTS - 3 end if isWeaponEquiped(2) then current_SLOTS = current_SLOTS - 2 end if isWeaponEquiped(3) then current_SLOTS = current_SLOTS - 1 end if isWeaponEquiped(4) then current_SLOTS = current_SLOTS - 2 end return math.floor(current_SLOTS) end function getLootCurrentSlots(loot) local current_SLOTS = 0 for _,category in pairs(inventoryItems)do for id,item in pairs(category)do if getElementData(loot,item[1]) and getElementData(loot,item[1])>= 1 then current_SLOTS = current_SLOTS + item[2]*getElementData(loot,item[1]) end end end return math.floor(current_SLOTS) end function getItemSlots(ItemName) for _,category in pairs(inventoryItems)do for id,item in pairs(category)do if ItemName == item[1] then return item[2] end end end return false end function isToolbeltItem(ItemName) for id,item in ipairs(inventoryItems["Toolbelt"])do if ItemName == item[1] then return true end end return false end function getItemInfo(ItemName) for _,category in pairs(inventoryItems)do for id,item in pairs(category)do if ItemName == item[1] then return item[4] end end end return false end function playerMoveItemOutOfInventory(itemName) if getElementData(localPlayer,"dayz:new_inv") or source == inv_dropbutton then if getElementData(getLocalPlayer(),"CantUseInv") then stateCounter = getElementData(getLocalPlayer(),"PingCounter") if not stateCounter then stateCounter = 0 end setElementData(getLocalPlayer(),"PingCounter",stateCounter + 1) end if playerMovedInInventory then startRollMessage2("Inventory","Abusing exploits will result in a ban!",255,22,0)return end if not getElementData(localPlayer,"dayz:new_inv") then itemName = guiGridListGetItemText(inv_itemsgrid,guiGridListGetSelectedItem(inv_itemsgrid),1) end if getElementData(getLocalPlayer(),itemName) and getElementData(getLocalPlayer(),itemName)>= 1 then if isPlayerInLoot() then local isVehicle = getElementData(isPlayerInLoot(),"vehicle") local isTent = getElementData(isPlayerInLoot(),"tent") if isVehicle and not isTent then if isToolbeltItem(itemName) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol"))+ getItemSlots(itemName)<= getLootMaxAviableSlots(isPlayerInLoot()) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory","Inventory is full!",255,22,0) return end elseif isToolbeltItem(itemName) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) elseif getLootCurrentSlots(getElementData(getLocalPlayer(),"currentCol"))+ getItemSlots(itemName)<= getLootMaxAviableSlots(isPlayerInLoot()) then triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory","Inventory is full!",255,22,0) return end else triggerEvent("onPlayerMoveItemOutOFInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) end end if getElementData(localPlayer,"dayz:new_inv") then setTimer(triggerEvent,200,2,"refreshInventoryManual",localPlayer) return end local gearName = guiGetText(LootLabel) local col = getElementData(getLocalPlayer(),"currentCol") setTimer(refreshInventory,200,2) if isPlayerInLoot() then setTimer(refreshLoot,200,2,col,gearName) end end end addEventHandler("onClientGUIClick",inv_dropbutton,playerMoveItemOutOfInventory) function onPlayerMoveItemOutOFInventory(itemName,loot) keyState = getKeyState("lalt") itemPlus = getAmmoPlus(itemName) for i,weaponData in pairs(weaponTable)do if weaponData[1] == itemName then triggerServerEvent("removeBackWeaponOnDrop",getLocalPlayer()) end end if not getElementData(loot,"itemloot") and getElementType(getElementData(loot,"parent")) == "vehicle" then end if getActiveVest(getLocalPlayer()) == itemName and getElementData(getLocalPlayer(),itemName) == 1 then startRollMessage2("Inventory","You can't drop your current vest!",255,22,0) return end if getActiveHelmet(getLocalPlayer()) == itemName and getElementData(getLocalPlayer(),itemName) == 1 then startRollMessage2("Inventory","You can't drop your current helmet!",255,22,0) return end if (getElementData(getLocalPlayer(),"wearingBackpack") == itemName) and (getElementData(getLocalPlayer(),getElementData(getLocalPlayer(),"wearingBackpack")) == 1) then startRollMessage2("Inventory","You can't drop your current backpack!",255,22,0) return end if itemPlus > getElementData(getLocalPlayer(),itemName) then itemPlus = getElementData(getLocalPlayer(),itemName) end if loot then if getElementType(loot)== "player" then triggerServerEvent("giveItemToAnotherPlayer",getLocalPlayer(),itemName,itemPlus) else avaliableSlotss = getLootMaxAviableSlots(loot) - getLootCurrentSlots(loot) if keyState then movingg = math.floor(avaliableSlotss/getItemSlots(itemName)) if movingg > getElementData(getLocalPlayer(),itemName) then movingg = getElementData(getLocalPlayer(),itemName) end setElementData(loot,itemName,(getElementData(loot,itemName)or 0)+ movingg) else setElementData(loot,itemName,(getElementData(loot,itemName)or 0)+ itemPlus) end local players = getElementsWithinColShape(loot,"player") if #players > 1 then triggerServerEvent("onPlayerChangeLoot",getRootElement(),loot) end end else triggerServerEvent("playerDropAItem",getLocalPlayer(),itemName,itemPlus) setElementData(getLocalPlayer(),itemName,getElementData(getLocalPlayer(),itemName)- itemPlus) return end if keyState then setElementData(getLocalPlayer(),itemName,getElementData(getLocalPlayer(),itemName)- movingg) else setElementData(getLocalPlayer(),itemName,getElementData(getLocalPlayer(),itemName)- itemPlus) end if loot and getElementData(loot,"itemloot") then triggerServerEvent("refre:~emLoot",getRootElement(),loot,getElementData(loot,"parent")) end end addEvent("onPlayerMoveItemOutOFInventory",true) addEventHandler("onPlayerMoveItemOutOFInventory",getRootElement(),onPlayerMoveItemOutOFInventory) function playerMoveItemInInventory(itemName) if getElementData(localPlayer,"dayz:new_inv") or source == loot_takebutton then if getElementData(getLocalPlayer(),"CantUseInv") then stateCounter = getElementData(getLocalPlayer(),"PingCounter") if not stateCounter then stateCounter = 0 end setElementData(getLocalPlayer(),"PingCounter",stateCounter + 1) end if not getElementData(localPlayer,"dayz:new_inv") then itemName = guiGridListGetItemText(loot_grid,guiGridListGetSelectedItem(loot_grid),1) end if isPlayerInLoot() then if getElementData(isPlayerInLoot(),itemName) and getElementData(isPlayerInLoot(),itemName)>= 1 then if not isToolbeltItem(itemName) then if getPlayerCurrentSlots()+ getItemSlots(itemName)<= getPlayerMaxAviableSlots() then if not playerMovedInInventory then triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot()) playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) else startRollMessage2("Inventory","Abusing exploits will result in a ban!",255,22,0) return end else startRollMessage2("Inventory","Inventory is full!",255,22,0) return end else playerMovedInInventory = true setTimer(function() playerMovedInInventory = false end,700,1) triggerEvent("onPlayerMoveItemInInventory",getLocalPlayer(),itemName,isPlayerInLoot()) end end if getElementData(localPlayer,"dayz:new_inv") then setTimer(triggerEvent,200,2,"refreshInventoryManual",localPlayer) return end if isPlayerInLoot() then local gearName = guiGetText(LootLabel) local col = getElementData(getLocalPlayer(),"currentCol") setTimer(refreshInventory,200,2) setTimer(refreshLoot,200,2,col,gearName) end end end end addEventHandler("onClientGUIClick",loot_takebutton,playerMoveItemInInventory) function onPlayerMoveItemInInventory(itemName,loot) itemPlus = getAmmoPlus(itemName) if loot then if itemPlus > (getElementData(loot,itemName)or 0) then itemPlus = getElementData(loot,itemName) or 1 end if getElementType(loot)== "player" then triggerServerEvent("takeItemToAnotherPlayer",getLocalPlayer(),itemName,itemPlus) else local avaliableSlotss = getPlayerMaxAviableSlots() - getPlayerCurrentSlots() if keyState then movingg = math.floor(avaliableSlotss/getItemSlots(itemName)) if movingg > getElementData(loot,itemName) then movingg = getElementData(loot,itemName) end setElementData(getLocalPlayer(),itemName,(getElementData(getLocalPlayer(),itemName)or 0)+ movingg) else setElementData(getLocalPlayer(),itemName,(getElementData(getLocalPlayer(),itemName)or 0)+ itemPlus) end if itemPlus > 0 then if keyState then setElementData(loot,itemName,(getElementData(loot,itemName)or 0)- movingg) else setElementData(loot,itemName,getElementData(loot,itemName)- itemPlus) end end local players = getElementsWithinColShape(loot,"player") if #players > 1 then triggerServerEvent("onPlayerChangeLoot",getRootElement(),loot) end end if getElementData(loot,"itemloot") then triggerServerEvent("refre:~emLoot",getRootElement(),loot,getElementData(loot,"parent")) end end end addEvent("onPlayerMoveItemInInventory",true) addEventHandler("onPlayerMoveItemInInventory",getRootElement(),onPlayerMoveItemInInventory) function onClientOpenInventoryStopMenu() triggerEvent("disableMenu",getLocalPlayer()) end function isPlayerInLoot() if getElementData(getLocalPlayer(),"loot") then return getElementData(getLocalPlayer(),"currentCol") end return false end ------------------------------------------------------------------------------ --right-click menu function onPlayerPressRightKeyInInventory(itemName) if not getElementData(localPlayer,"dayz:new_inv") then itemName = guiGridListGetItemText(inv_itemsgrid,guiGridListGetSelectedItem(inv_itemsgrid),1) end local itemName,itemInfo = getInventoryInfosForRightClickMenu(itemName) if isCursorShowing() and ( guiGetVisible(inv_window) or getElementData(localPlayer,"dayz:new_inv") ) and itemInfo then if itemName == "Box of Matches" then if getElementData(getLocalPlayer(),"Wood Pile")== 0 then return end end if itemName == "Bandage" then if getElementData(getLocalPlayer(),"bleeding")== 0 then return end end if itemName == "Medic Kit" then if getElementData(getLocalPlayer(),"blood")> 10500 then return end end if itemName == "Heat Pack" then if getElementData(getLocalPlayer(),"temperature")> 35 then return end end if itemName == "Painkiller" then if not getElementData(getLocalPlayer(),"pain") then return end end if itemName == "Canned Spaghetti (Fechado)" or itemName == "Canned Baked Beans (Fechado)" or itemName == "Can of Tactical Bacon (Fechado)" or itemName == "Canned Sardines (Fechado)" then if getElementData(getLocalPlayer(),"Opener")== 0 then return end end if itemName == "Morphine" then if not getElementData(getLocalPlayer(),"brokenbone") then return end end if itemName == "Blood Bag" then return end if itemName == getElementData(getLocalPlayer(),"wearingBackpack") then itemInfo = "Remove Backpack" end if itemName == getActiveVest(getLocalPlayer()) then itemInfo = "Remove Vest" end if itemName == getActiveHelmet(getLocalPlayer()) then itemInfo = "Remove Helmet" end -- убрать if itemInfo ~= "" then playerUseItem(itemName,itemInfo) end end end addEventHandler("onClientGUIDoubleClick",inv_itemsgrid,onPlayerPressRightKeyInInventory,false) function onPlayerPressRightKeyInInventory2() local itemName = guiGridListGetItemText(inv_itemsgrid,guiGridListGetSelectedItem(inv_itemsgrid),1) local itemName,itemInfo = getInventoryInfosForRightClickMenu(itemName) if guiGetVisible(inv_window) and itemName then showRightClickInventoryMenu2(itemName) end end bindKey("mouse2","down",onPlayerPressRightKeyInInventory2) function getInventoryInfosForRightClickMenu(itemName) for i,itemInfo in ipairs(inventoryItems["Primary Weapon"])do if itemName == itemInfo[1] then return itemName,"Equip Primary Weapon" end end for i,itemInfo in ipairs(inventoryItems["Secondary Weapon"])do if itemName == itemInfo[1] then return itemName,"Equip Secondary Weapon" end end for i,itemInfo in ipairs(inventoryItems["Pistols"])do if itemName == itemInfo[1] then return itemName,"Equip Pistol" end end for i,itemInfo in ipairs(inventoryItems["Specially Weapon"])do if itemName == itemInfo[1] then return itemName,"Equip Specially Weapon" end end for i,itemInfo in ipairs(inventoryItems["Ammo"])do if itemName == itemInfo[1] then return itemName,false end end for i,itemInfo in ipairs(inventoryItems["Food"])do if itemName == itemInfo[1] then if itemInfo[1] == "Water Bottle" or itemInfo[1] == "Milk" or itemInfo[1] == "Soda Bottle" then info = "Drink" elseif itemInfo[1] == "Canned Baked Beans (Fechado)" or itemInfo[1] == "Canned Spaghetti (Fechado)" or itemInfo[1] == "Canned Sardines (Fechado)" or itemInfo[1] == "Can of Tactical Bacon (Fechado)" then info = "Open" else info = "Eat" end return itemName,info end end for i,itemInfo in ipairs(inventoryItems["Items"])do if itemName == itemInfo[1] then return itemName,itemInfo[3] or false end end for i,itemInfo in ipairs(inventoryItems["Medic"])do if itemName == itemInfo[1] then return itemName,itemInfo[3] or false end end for i,itemInfo in ipairs(inventoryItems["VehicleParts"])do if itemName == itemInfo[1] then return itemName,itemInfo[3] or false end end for i,itemInfo in ipairs(inventoryItems["Toolbelt"])do if itemName == itemInfo[1] then return itemName,itemInfo[3] or false end end end ------------------------------ RightClickMenu 1 ------------------------------ rightclickWindow = guiCreateStaticImage(0,0,0.05,0.0215,"images/scrollmenu_1.png",true) headline["rightclickmenu"] = guiCreateLabel(0,0,1,1,"",true,rightclickWindow) guiLabelSetHorizontalAlign(headline["rightclickmenu"],"center") guiLabelSetVerticalAlign(headline["rightclickmenu"],"center") guiSetFont(headline["rightclickmenu"],"default-bold-small") guiSetVisible(rightclickWindow,false) function showRightClickInventoryMenu(itemName,itemInfo) if itemInfo then local screenx,screeny,worldx,worldy,worldz = getCursorPosition() guiSetVisible(rightclickWindow,true) guiSetText(headline["rightclickmenu"],itemInfo) local whith = guiLabelGetTextExtent(headline["rightclickmenu"]) guiSetPosition(rightclickWindow,screenx,screeny,true) local x,y = guiGetSize(rightclickWindow,false) guiSetSize(rightclickWindow,whith,y,false) guiBringToFront(rightclickWindow) setElementData(rightclickWindow,"iteminfo",{itemName,itemInfo}) end end function hideRightClickInventoryMenu() guiSetVisible(rightclickWindow,false) guiSetVisible(rightclickWindow2,false) end function hideRightClickInventoryMenu2(button) if button == "left" then hideRightClickInventoryMenu() end end addEventHandler("onClientGUIClick",inv_window,hideRightClickInventoryMenu2,false) addEventHandler("onClientGUIClick",loot_grid,hideRightClickInventoryMenu2,false) addEventHandler("onClientGUIClick",inv_itemsgrid,hideRightClickInventoryMenu2,false) function onPlayerClickOnRightClickMenu(button,state) if button == "left" then local itemName,itemInfo = getElementData(rightclickWindow,"iteminfo")[1],getElementData(rightclickWindow,"iteminfo")[2] hideRightClickInventoryMenu() playerUseItem(itemName,itemInfo) end end addEventHandler("onClientGUIClick",headline["rightclickmenu"],onPlayerClickOnRightClickMenu,false) ------------------------------ RightClickMenu 1 ------------------------------ ------------------------------ RightClickMenu 2 ------------------------------ rightclickWindow2 = guiCreateStaticImage(0,0,0.05,0.0215,"images/scrollmenu_1.png",true) headline["rightclickmenu2"] = guiCreateLabel(0,0,1,1,"",true,rightclickWindow2) guiLabelSetHorizontalAlign(headline["rightclickmenu2"],"center") guiLabelSetVerticalAlign(headline["rightclickmenu2"],"center") guiSetFont(headline["rightclickmenu2"],"default-bold-small") guiSetVisible(rightclickWindow2,false) InfoWindow = guiCreateWindow(382, 323, 268, 155, "Item Info: ", false) guiWindowSetSizable(InfoWindow, false) guiSetVisible(InfoWindow,false) InfoWindowInfo = guiCreateMemo(10, 25, 248, 84, "", false, InfoWindow) guiMemoSetReadOnly(InfoWindowInfo, true) InfoWindowButton = guiCreateButton(10, 119, 248, 26, "Close", false, InfoWindow) guiSetFont(InfoWindowButton, "default-bold-small") guiSetProperty(InfoWindow,"AlwaysOnTop","True") function CloseInfoWindow() guiSetVisible(InfoWindow,false) end addEventHandler("onClientGUIClick",InfoWindowButton,CloseInfoWindow,false) function showRightClickInventoryMenu2(itemName) if itemName then local screenx,screeny,worldx,worldy,worldz = getCursorPosition() guiSetVisible(rightclickWindow2,true) guiSetText(headline["rightclickmenu2"],"Info") local whith = guiLabelGetTextExtent(headline["rightclickmenu2"]) if guiGetVisible(rightclickWindow) then guiSetPosition(rightclickWindow2,screenx,screeny + 0.023,true) else guiSetPosition(rightclickWindow2,screenx,screeny,true) end local x,y = guiGetSize(rightclickWindow2,false) guiSetSize(rightclickWindow2,whith,y,false) guiBringToFront(rightclickWindow2) setElementData(rightclickWindow2,"iteminfo",{itemName,itemInfo}) end end function onPlayerClickOnRightClickMenu2(button,state) if button == "left" then local itemName,itemInfo = getElementData(rightclickWindow2,"iteminfo")[1],getElementData(rightclickWindow2,"iteminfo")[2] hideRightClickInventoryMenu() guiSetText(InfoWindow,"Item Info: "..itemName) guiSetText(InfoWindowInfo,getItemInfo(itemName)) guiSetVisible(InfoWindow,true) x,y = guiGetScreenSize() x2,y2 = guiGetSize(InfoWindow,false) guiSetPosition(InfoWindow,x/2 - x2/2,y/2 - y2/2,false) end end addEventHandler("onClientGUIClick",headline["rightclickmenu2"],onPlayerClickOnRightClickMenu2,false) ------------------------------ RightClickMenu 2 ------------------------------ function playerUseItem(itemName,itemInfo) if itemInfo == "Drink" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Actions/Drink.ogg") triggerServerEvent("onPlayerRequestChangingStats",getLocalPlayer(),itemName,itemInfo,"thirst") refreshNewInventory() elseif itemInfo == "Eat" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Actions/Eat.ogg") triggerServerEvent("onPlayerRequestChangingStats",getLocalPlayer(),itemName,itemInfo,"food") refreshNewInventory() elseif itemInfo == "Open" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) triggerServerEvent("onPlayerOpenFood",getLocalPlayer(),itemName) refreshNewInventory() elseif itemInfo == "Use Skin" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Actions/Skin.ogg") triggerServerEvent("onPlayerChangeSkin",getLocalPlayer(),itemName) refreshNewInventory() elseif itemName == "Empty Water Bottle" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerRefillWaterBottle",getLocalPlayer(),itemName) refreshNewInventory() elseif itemInfo == "Set Rate" then guiSetVisible(SetGPSRateWindow,true) elseif itemInfo == "Place Stinger" then setElementData(localPlayer,"Stinger",getElementData(localPlayer,"Stinger")-1) local x, y, z = getElementPosition(localPlayer) local rx, ry, rz = getElementRotation(localPlayer) x = x - math.sin(math.rad(rz))*2 y = y + math.cos(math.rad(rz))*2 rz = rz + 90 local groundZ = getGroundPosition(x,y,z) if(groundZ ~= z) then z = groundZ+0.2 end setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) triggerServerEvent("CreateStinger",localPlayer,x,y,z,rz) elseif itemName == "Tent" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Actions/MontarTenda.ogg") triggerServerEvent("onPlayerPitchATent",getLocalPlayer(),itemName) refreshNewInventory() elseif itemInfo == "Colocar Wire Fence" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerBuildAWireFence",getLocalPlayer(),itemName) elseif itemName == "Roadflare" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerPlaceRoadflare",getLocalPlayer(),itemName) refreshNewInventory() elseif itemInfo == "Make a Fire" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerMakeAFire",getLocalPlayer(),itemName) refreshNewInventory() elseif itemInfo == "Usar" then triggerServerEvent("onPlayerUseMedicObject",getLocalPlayer(),itemName) refreshInventory() refreshNewInventory() elseif itemName == "Bandage" then triggerServerEvent("onPlayerUseMedicObject",getLocalPlayer(),itemName) refreshInventory() refreshNewInventory() elseif itemInfo == "Use Googles" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) triggerServerEvent("onPlayerChangeView",getLocalPlayer(),itemName) elseif itemInfo == "Equip Primary Weapon" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Equip/equip1.wav") triggerServerEvent("onPlayerRearmWeapon",getLocalPlayer(),itemName,1) elseif itemInfo == "Equip Secondary Weapon" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Equip/equip2.wav") triggerServerEvent("onPlayerRearmWeapon",getLocalPlayer(),itemName,2) elseif itemInfo == "Equip Specially Weapon" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Equip/equip3.wav") triggerServerEvent("onPlayerRearmWeapon",getLocalPlayer(),itemName,3) elseif itemInfo == "Equip Pistol" then refreshInventory() triggerEvent("hideInventoryManual",localPlayer) playSound("sounds/Equip/equip3.wav") triggerServerEvent("onPlayerRearmWeapon",getLocalPlayer(),itemName,4) elseif itemInfo == "Use Vest" then --if getActiveVest(getLocalPlayer()) and getElementData(getLocalPlayer(),"vestLife") == getVestLife(getActiveVest(getLocalPlayer())) then --setElementData(getLocalPlayer(),getActiveVest(getLocalPlayer()),getElementData(getLocalPlayer(),getActiveVest(getLocalPlayer()))+1) --end for _,vest in pairs(VestsTable)do setElementData(localPlayer,vest[2],false) end for _,vest in pairs(VestsTable)do if vest[1] == itemName then var = vest[2] setElementData(getLocalPlayer(),"vestLife",vest[4]) break end end setElementData(localPlayer,var,true) triggerEvent("refreshInventoryManual",localPlayer) elseif itemInfo == "Use Helmet" then --if getActiveHelmet(getLocalPlayer()) and getElementData(getLocalPlayer(),"helmetLife") == getHelmetLife(getActiveHelmet(getLocalPlayer())) then --setElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer()),getElementData(getLocalPlayer(),getActiveHelmet(getLocalPlayer()))+1) --end for _,helmet in pairs(HelmetsTable)do setElementData(localPlayer,helmet[2],false) end for _,helmet in pairs(HelmetsTable)do if helmet[1] == itemName then var = helmet[2] setElementData(getLocalPlayer(),"helmetLife",helmet[4]) break end end setElementData(localPlayer,var,true) triggerEvent("refreshInventoryManual",localPlayer) elseif itemInfo == "Wear Backpack" then for _,backpack in pairs(BackpacksTable)do if itemName == backpack[1] then if getElementData(getLocalPlayer(),"MAX_Slots")== backpack[2] then triggerEvent("displayClientInfo",getLocalPlayer(),"inventory","Você já usando esta mochila!",255,22,0) elseif getPlayerCurrentSlots() > backpack[2] then triggerEvent("displayClientInfo",getLocalPlayer(),"inventory","Your current itens needs to be under "..backpack[2].."!",255,22,0) else setElementData(getLocalPlayer(),"MAX_Slots",backpack[2]) setElementData(getLocalPlayer(),"wearingBackpack",backpack[1]) triggerEvent("refreshInventoryManual",localPlayer) end end end elseif itemInfo == "Remove Backpack" then if getPlayerCurrentSlots() <= 8 then setElementData(getLocalPlayer(),"MAX_Slots",8) setElementData(getLocalPlayer(),"wearingBackpack",false) triggerEvent("refreshInventoryManual",localPlayer) else triggerEvent("displayClientInfo",getLocalPlayer(),"inventory","Your current itens needs to be under 8!",255,22,0) end elseif itemInfo == "Remove Vest" then vestSlots = getActiveVestSlots(getLocalPlayer()) if getElementData(getLocalPlayer(),"MAX_Slots")-vestSlots < getPlayerCurrentSlots() then triggerEvent("displayClientInfo",getLocalPlayer(),"inventory","Your current itens needs to be under "..getElementData(getLocalPlayer(),"MAX_Slots").."!",255,22,0) return end setElementData(getLocalPlayer(),getActiveVestVar(getLocalPlayer()),false) triggerEvent("refreshInventoryManual",localPlayer) elseif itemInfo == "Remove Helmet" then setElementData(getLocalPlayer(),getActiveHelmetVar(getLocalPlayer()),false) triggerEvent("refreshInventoryManual",localPlayer) end refreshInventory() end function weaponSwitch(ID) for _,item in pairs(weaponTable)do if getElementData(getLocalPlayer(),"currentweapon_1") == item[1] and ID == item[3] and item[5] == 1 then if getElementData(getLocalPlayer(),item[2])> 0 then setElementData(getLocalPlayer(),item[2],getElementData(getLocalPlayer(),item[2])- 1) return end end if getElementData(getLocalPlayer(),"currentweapon_2") == item[1] and ID == item[3] and item[5] == 2 then if getElementData(getLocalPlayer(),item[2])> 0 then setElementData(getLocalPlayer(),item[2],getElementData(getLocalPlayer(),item[2])- 1) end end if getElementData(getLocalPlayer(),"currentweapon_3") == item[1] and ID == item[3] and item[5] == 3 then if getElementData(getLocalPlayer(),item[1])> 0 then setElementData(getLocalPlayer(),item[1],getElementData(getLocalPlayer(),item[1])- 1) end end if getElementData(getLocalPlayer(),"currentweapon_4") == item[1] and ID == item[3] and item[5] == 4 then if getElementData(getLocalPlayer(),item[2])> 0 then setElementData(getLocalPlayer(),item[2],getElementData(getLocalPlayer(),item[2])- 1) end end end end addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(),weaponSwitch) function makeRadioStayOff() setRadioChannel(0) end addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) function getPlayerSackName() local slots = getElementData(localPlayer,"MAX_Slots") if slots then for i, v in ipairs ( sacks ) do if v[2] == slots then return v[1] end end end return false end outputDebugString("inventory loaded") ficarei grato.
  9. Lukkas2201

    Erro com Col

    pra depurar é so meter um outputDebugString com varias mensagens pra eu saber qual o erro atraves da mensagem que eu coloquei no debugstring ne? vou fazer isso
  10. Lukkas2201

    Erro com Col

    então mano, praticamente oque falta é so esse bug, o resto consegui resolver a maioria, essa gm adiquiri ano passado, e ja corrigi MUITOS bugs nela, sei onde tem a maioria das funcoes, porem esse bug surgiu recentemente, por iso ainda nao consegui saber oque é, pra mim nao compensa refazer desde o 0, tem MUITA coisa na minha Gm ja, mas o bug q mais atrapalha e oq falta so praticamente é esse :/
  11. Lukkas2201

    Erro com Col

    Seguinte, a um tempo atras estava com um problema, que eu pensei que fosse do Inventario do MTA DayZ, porém acabei descobrindo que não é, eu troquei o inventário todo, e o bug continuou, percebi que podia ser no script menu_client do mta dayz, porém eu to comparando ele com varios outros menu_client que tenho, e nao tem nada de errado. o erro é o seguinte, o player ta jogando de boa, ai ele vai lotear a tenda dele, e ele clica pra pegar o item, e não vai, o item fica la na tenda, mas simplesmente vc clica pra pegar e nao acontece nada, ai tem que ficar saindo e voltando pra tenda até desbugar, e quando ele consegue acessar, e começa a passar itens pra tenda, no caso seria ao contrario, ao invez de pegar, ele vai guardar, ai dps de um tempo os itens começam ir pro chão, como se ele tivesse saido da tenda, mas na verdade não saiu, e os itens na tenda continuam mostrando no inventario, só que em vez de ir pra tenda, vai pro chão ,creio eu que seja no menu_client, porém ta foda de conseguir saber qual função que seja, alguém poderia me ajudar? (obs: não é só com tenda, com gear de hospitalbox,, gear de corpo de player que no caso é o dead, tbm acontece) ------------S1L3NC3 local theTableMenuScroll = {} function startRollMessageMenu(text, r, g, b, data) table.insert(theTableMenuScroll,{text,r,g,b,data}) end function dxDrawingColorTextMenuScroll(str, ax, ay, bx, by, color, alpha, scale, font, alignX, alignY) if alignX then if alignX == "center" then elseif alignX == "right" then local w = dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) ax = bx - w end end if alignY then if alignY == "center" then local h = dxGetFontHeight(scale, font) ay = ay + (by-ay)/2 - h/2 elseif alignY == "bottom" then local h = dxGetFontHeight(scale, font) ay = by - h end end local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), alpha) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) end end local boxSpace = dxGetFontHeight(1,"default-bold")+dxGetFontHeight(1,"default-bold")*0.1 local optionsTable = { ["player"] = { {"Give Bandage"}, {"Give Painkiller"}, {"Give Morphine"}, }, } function showClientMenuItem(arg1,arg2,arg3,arg4) theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) numberMenuScroll = 1 if getElementData(localPlayer,"playerZombie") then return end if arg1 == "Take" then startRollMessageMenu("Gear: "..arg2,0,255,0,arg2) setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then startRollMessageMenu("Gear",255,255,255,"helicrashsite") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "AIRDROP" then startRollMessageMenu("Gear",255,255,255,"AIRDROP") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Hospitalbox" then startRollMessageMenu("Gear",255,255,255,"hospitalbox") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Vehicle" then startRollMessageMenu("> Gear ("..arg2.."): "..getLootCurrentSlots(arg4).."/"..(getElementData(arg4,"MAX_Slots") or 0).." Slots",0,255,0,"vehicle") setElementData(localPlayer,"usedItemTrue", true) if getElementData(getElementData(arg3,"parent"),"tent") then startRollMessageMenu("#FFFFFF> Remover Tent",0,255,0,"tent") return end if getElementHealth(arg3,"repairvehicle") < 1000 and getElementHealth(arg3) >= 50 then startRollMessageMenu("> Reparar ("..arg2.."): " ..tostring(math.floor(getElementHealth(arg3)/10)).."%",0,255,0,"repairvehicle") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"fuel") or 0) < getVehicleMaxFuel(arg4) then startRollMessageMenu("> Colocar Gasolina ("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",255,0,0,"FuelOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"fuel") or 0) >= 20 then startRollMessageMenu("> Remover Gasolina ("..tostring(math.floor(getElementData(arg4,"fuel") or 0)).."/"..getVehicleMaxFuel(arg4)..")",255,255,0,"FuelTwo") setElementData(localPlayer,"usedItemTrue", true) end local tires,engine,parts = getVehicleAddonInfos (getElementModel(arg3)) if (getElementData(arg4,"Tire_inVehicle") or 0) < tires then startRollMessageMenu("> Colocar Tire ("..(getElementData(arg4,"Tire_inVehicle") or 0).."/"..tires..")",255,0,0,"TireOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Engine_inVehicle") or 0) < engine then startRollMessageMenu("> Colocar Engine ("..(getElementData(arg4,"Engine_inVehicle") or 0).."/"..engine..")",255,0,0,"EngineOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) < parts then startRollMessageMenu("> Colocar Tank Parts ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",255,0,0,"PartsOne") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"armorPoints") or 0) < (getElementData(arg4,"armorPointsMax") or 0) then if (getElementData(localPlayer,"Steel Sheet") or 0) >= 0 then startRollMessageMenu("> Colocar Steel Sheet",255,0,0,"setListStale") setElementData(localPlayer,"usedItemTrue", true) end end if (getElementData(arg4,"receiver") or 0) < 1 then if getElementData(getLocalPlayer(),"Radio Device") >= 0 then startRollMessageMenu("> Colocar Radio Device",255,0,0,"receiver") setElementData(localPlayer,"usedItemTrue", true) end end if (getElementData(arg4,"Tire_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Tire ("..(getElementData(arg4,"Tire_inVehicle") or 0).."/"..tires..")",255,255,0,"TireTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Engine_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Engine ("..(getElementData(arg4,"Engine_inVehicle") or 0).."/"..engine..")",255,255,0,"EngineTwo") setElementData(localPlayer,"usedItemTrue", true) end if (getElementData(arg4,"Parts_inVehicle") or 0) > 0 then startRollMessageMenu("> Remover Tank Parts ("..(getElementData(arg4,"Parts_inVehicle") or 0).."/"..parts..")",255,255,0,"PartsTwo") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Player" then if getElementData(arg2,"bleeding") > 0 and getElementData(getLocalPlayer(),"Bandage") >= 1 then startRollMessageMenu("Give Bandage",255,255,255,"bandage") setElementData(localPlayer,"usedItemTrue", true) end if getElementData(arg2,"blood") < 11900 and getElementData(getLocalPlayer(),"Blood Bag") >= 1 then startRollMessageMenu("Administer Blood Bag",255,255,255,"giveblood") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Dead" then startRollMessageMenu("> Gear ("..arg2..")",0,255,0,"dead") startRollMessageMenu("#FFFFFF> Check Body",0,255,0,"deadreason") setElementData(localPlayer,"usedItemTrue", true) end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"#FFFFFF> Raw Meat") >= 1 then startRollMessageMenu("Cook Meat",255,255,255,"fireplace") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "patrol" then if getElementData(getLocalPlayer(),"Empty Gas Canister") >= 1 then startRollMessageMenu("#FFFFFF> Encher (Empty Gas Canister)",255,255,255,"patrolstation") setElementData(localPlayer,"usedItemTrue", true) end end if arg1 == "Wirefence" then startRollMessageMenu("Remove Wire Fence",255,255,255,"wirefence") setElementData(localPlayer, "usedItemTrue", "wirefence") end if arg1 == "Stinger" then startRollMessageMenu("Remove Stinger",255,255,255,"removestinger") setElementData(localPlayer,"usedItemTrue","removestinger") end if arg1 == "Gear" then startRollMessageMenu("> Gear",255,255,255,"itemloot") setElementData(localPlayer,"usedItemTrue", true) end numberMenuScroll = 1 end addEvent("showClientMenuItem",true) addEventHandler("showClientMenuItem",getLocalPlayer(),showClientMenuItem) function PlayerScrollMenuLalitka (key,keyState,arg) if getElementData(localPlayer,"usedItemTrue") then if ( keyState == "down" ) then if arg == "up" then numberMenuScroll = numberMenuScroll-1 if numberMenuScroll < 1 then numberMenuScroll = #theTableMenuScroll end elseif arg == "down" then numberMenuScroll = numberMenuScroll+1 if numberMenuScroll > #theTableMenuScroll then numberMenuScroll = 1 end end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenuLalitka, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenuLalitka, "down" ) function disableMenu() theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) setNewbieInfo (false,"","") end addEvent("disableMenu",true) addEventHandler("disableMenu",getLocalPlayer(),disableMenu) function refreshMenuCar() idd = numberMenuScroll theTableMenuScroll = {} setElementData(localPlayer,"usedItemTrue", false) setNewbieInfo (false,"","") showClientMenuItem("Vehicle",nil,getElementData(getElementData(localPlayer,"currentCol"),"parent"),getElementData(localPlayer,"currentCol")) numberMenuScroll = idd end addEvent("refreshMenuCar",true) addEventHandler("refreshMenuCar",getLocalPlayer(),refreshMenuCar) function getPlayerInCol(tab) for theKey,thePlayer in ipairs(tab) do if thePlayer ~= getLocalPlayer() then return true end end return false end isInFirePlace = false function onPlayerTargetPickup (theElement) if getElementData(getLocalPlayer(),"isDead",true) then return end if theElement == getLocalPlayer() then if getElementData(source,"parent") == getLocalPlayer() then return end local player = getPlayerInCol(getElementsWithinColShape ( source, "player" )) if getPedOccupiedVehicle(getLocalPlayer()) then return end isInFirePlace = false setElementData(getLocalPlayer(),"isInFirePlace",false) if getElementData(source,"player") then showClientMenuItem("Player",getElementData(source,"parent")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) return end if player then return end if getElementData(source,"tent") then if getElementData(source,"visible") == false then setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) return end end if getElementData(source,"patrolstation") then showClientMenuItem("patrol") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Gear","Need: Empty Gas Canister",source) return end if getElementData(source,"wirefence") then showClientMenuItem("Wirefence") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true, "Wirefence","Press '-' or 'middle-mouse' to remove the fence!\nRequired: Toolbox", source) return end if getElementData(source,"stinger") then showClientMenuItem("Stinger") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo(true, "Stinger","Press '-' or 'middle-mouse' to remove the Stinger!\nRequired: Toolbox", source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fireplace") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Fireplace","Need: Raw Meat",source) isInFirePlace = true return end if getElementData(source,"deadman") then showClientMenuItem("Dead",getElementData(source,"playername")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Gear","To Choose The Subject!\n"..getElementData(source,"item"),source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrashsite","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Search") setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end if getElementData(source,"vehicle") and not getElementData(source,"deadVehicle") then if not getElementData(source,"tent") then name = getVehicleName(getElementData(source,"parent")) else name = "Tent" end showClientMenuItem("Vehicle",name,getElementData(source,"parent"),source) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..name..")") setNewbieInfo(true, "Gear", "Pressione J para abrir!", source) return end if getElementData(source,"itemloot") then showClientMenuItem("Gear") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo (true,"Gear","Press J To Open Inventory",source) return end showClientMenuItem("stop") end end addEventHandler("onClientColShapeHit",getRootElement(),onPlayerTargetPickup) function onPlayerTargetPickup (theElement) if theElement == getLocalPlayer() then showClientMenuItem("stop") setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) setElementData(getLocalPlayer(),"near_trader",false) setElementData(getLocalPlayer(),"near_trader_shape",nil ) setNewbieInfo (false,"","") isInFirePlace = false setElementData(getLocalPlayer(),"isInFirePlace",false) if getElementData(source,"smeltery") then setElementData(getLocalPlayer(),"smeltery",false) end end end addEventHandler("onClientColShapeLeave",getRootElement(),onPlayerTargetPickup) local screenWidth, screenHeight = guiGetScreenSize() local newbieShow = false local newbieHead = "-" local newbieText = "-" local newbiePosition = 0,0,0 function setNewbieInfo (show,head,text,element) newbieShow = show newbieHead = head newbieText = text newbiePosition = element end addEventHandler("onClientRender", getRootElement(), function() local veh = getPedOccupiedVehicle (getLocalPlayer()) if veh then disableMenu() else for id, value in pairs(theTableMenuScroll) do if id == numberMenuScroll then r1menu,g1menu,b1menu = 25,153,25 else r1menu,g1menu,b1menu = 19,19,19 end dxDrawRectangle ( 0, 250+id*boxSpace, screenWidth*0.2, boxSpace, tocolor (r1menu,g1menu,b1menu,180) ) dxDrawingColorTextMenuScroll(value[1],6, 250+id*boxSpace, 6, 250+(id+1)*boxSpace, tocolor(value[2],value[3],value[4],170),170, 1, "default-bold", "center", "center") end end if getElementData(getLocalPlayer(),"isDead") == true then return end if newbieShow == false then return end local x,y,z = getElementPosition(newbiePosition) local x,y = getScreenFromWorldPosition (x,y,z) local length = dxGetTextWidth(newbieText, 1, "default-bold") if not x then return end local xx,yy,xx2,yy2 = x-length/2, y-70/2, length+22, 70 if newbieHead == "Item pickup" then dxDrawImage(x-length/2-screenWidth*0.01,y,screenWidth*0.02+length,screenHeight*0.1,"images/Loot1.png",0,0,0,tocolor(255,255,255)) else dxDrawImage(x-length/2-screenWidth*0.01,y,screenWidth*0.02+length,screenHeight*0.1,"images/Loot2.png",0,0,0,tocolor(255,255,255)) end end) function fireRaiseTemperature () if isInFirePlace then if getElementData(getLocalPlayer(),"temperature") <= 38 then setElementData(getLocalPlayer(),"temperature",getElementData(getLocalPlayer(),"temperature")+0.25) end end end setTimer(fireRaiseTemperature,10000,0) unbindKey("mouse3","both") function onPlayerPressMiddleMouse (key,keyState) if ( keyState == "down" ) then if not getElementData(localPlayer,"usedItemTrue") then return end local itemName = getMenuMarkedItem() if itemName == "helicrashsite" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "itemloot" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "wirefence" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Remove Wirefence" triggerServerEvent("removeWirefence",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "removestinger" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Remove Stinger" triggerServerEvent("RemoveStingerServer",getLocalPlayer(),getElementData(col,"parent")) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",-1,false,false,false,false) else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "hospitalbox" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "vehicle" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "repairvehicle" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Scrap Metal") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) setElementData(getLocalPlayer(),"Scrap Metal",(getElementData(getLocalPlayer(),"Scrap Metal") or 0)-1) -- startRollMessage2("Inventory", "Você reparou o o veículo!", 22, 255, 0 ) --setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Scrap Metal!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "object" then showInventory("j","down") return end if itemName == "receiver" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Radio Device") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"receiver",1) setElementData(getLocalPlayer(),"Radio Device",(getElementData(getLocalPlayer(),"Radio Device") or 0)-1) startRollMessage2("Inventory", "Você colocou Rádio Device no Veículo!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Radio Device!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelOne" then if (getElementData(getLocalPlayer(),"Full Gas Canister") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if getElementData(col,"fuel")+20 < getVehicleMaxFuel(col) then addingfuel = 20 elseif getElementData(col,"fuel")+20 > getVehicleMaxFuel(col)+15 then triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Tanque Cheio!",255,22,0) disableMenu() return else addingfuel = getVehicleMaxFuel(col)-getElementData(col,"fuel") end if (getElementData(col,"Parts_inVehicle") or 0) < 1 then addingfuel = addingfuel/3 triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Resultante do transporte de gasolina!",22,255,0) end setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")-1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)+1) setElementData(col,"fuel",getElementData(col,"fuel")+addingfuel) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Você encheu "..addingfuel.." L!",22,255,0) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Refuel.mp3") else startRollMessage2("Inventory", "Você não tem Full Gas Canister!", 255, 22, 0 ) end disableMenu() return end if itemName == "FuelTwo" then if (getElementData(getLocalPlayer(),"Empty Gas Canister") or 0) >= 1 then if (getElementData(getLocalPlayer(),"Hose") or 0) >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(getLocalPlayer(),"Full Gas Canister",getElementData(getLocalPlayer(),"Full Gas Canister")+1) setElementData(getLocalPlayer(),"Empty Gas Canister",(getElementData(getLocalPlayer(),"Empty Gas Canister") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) setElementData(col,"fuel",getElementData(col,"fuel")-20) triggerEvent ("displayClientInfo", getLocalPlayer(),"Vehicle","Você retirou 20L do Veículo!",22,255,0) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Refuel.mp3") else startRollMessage2("Inventory", "Você não tem Hose!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Empty Gas Canister!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tire") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Tire_inVehicle",(getElementData(col,"Tire_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocou um Tire!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tire!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "TireTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Tire_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Tire_inVehicle",(getElementData(col,"Tire_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Tire!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tire!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Engine") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Engine_inVehicle",(getElementData(col,"Engine_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Engine",(getElementData(getLocalPlayer(),"Engine") or 0)-1) ---triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocu um Engine!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Engine!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end --- steel sheet if itemName == "setListStale" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Steel Sheet") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"armorPoints",getElementData(col,"armorPoints") + 100) setElementData(getLocalPlayer(),"Steel Sheet",(getElementData(getLocalPlayer(),"Steel Sheet") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você adicionou Steel Sheet!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Steel Sheet!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "EngineTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Engine_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Engine_inVehicle",(getElementData(col,"Engine_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Engine",(getElementData(getLocalPlayer(),"Engine") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Engine!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Engine!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsOne" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then if (getElementData(getLocalPlayer(),"Tank Parts") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)+1) setElementData(getLocalPlayer(),"Tank Parts",(getElementData(getLocalPlayer(),"Tank Parts") or 0)-1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você colocou um Tank Parts!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tank Parts!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "PartsTwo" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then local col = getElementData(getLocalPlayer(),"currentCol") if (getElementData(col,"Parts_inVehicle") or 0) > 0 then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(col,"Parts_inVehicle",(getElementData(col,"Parts_inVehicle") or 0)-1) setElementData(getLocalPlayer(),"Tank Parts",(getElementData(getLocalPlayer(),"Tank Parts") or 0)+1) --triggerServerEvent("AnimAddFuel", getLocalPlayer(), getLocalPlayer()) startRollMessage2("Inventory", "Você removeu um Tank Parts!", 22, 255, 0 ) setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) playSound("sounds/Repair.mp3") else startRollMessage2("Inventory", "Você não tem Tank Parts!", 255, 22, 0 ) end else startRollMessage2("Inventory", "Você não tem Toolbox!", 255, 22, 0 ) end disableMenu() return end if itemName == "tent" then local screenW, screenH = guiGetScreenSize() showCursor(true) disableMenu() tentGuiConfirm = guiCreateWindow((screenW - 254) / 2, (screenH - 147) / 2, 254, 147, "Tent", false) guiWindowSetMovable(tentGuiConfirm, false) guiWindowSetSizable(tentGuiConfirm, false) tentLabelConfirm = guiCreateLabel(23, 34, 207, 15, "Deseja realmente remover a tenda?", false, tentGuiConfirm) guiSetFont(tentLabelConfirm, "default-bold-small") tentYesConfirm = guiCreateButton(23, 64, 81, 51, "Remover", false, tentGuiConfirm) tentCancelConfirm = guiCreateButton(149, 64, 81, 51, "Cancelar", false, tentGuiConfirm) addEventHandler("onClientGUIClick",tentYesConfirm, function () local col = getElementData(getLocalPlayer(),"currentCol") showCursor(false) guiSetVisible(tentGuiConfirm, false) triggerServerEvent("removeTent",getLocalPlayer(),getElementData(col,"parent")) setSoundMaxDistance(playSound3D("sounds/DesmontarTenda.mp3",x,y,z),15) end, false) addEventHandler("onClientGUIClick",tentCancelConfirm, function () showCursor(false) guiSetVisible(tentGuiConfirm, false) end, false) return end if itemName == "fireplace" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("addPlayerCookMeat",getLocalPlayer()) disableMenu() return end if itemName == "bandage" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "giveblood" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "dead" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Search" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "deadreason" then local col = getElementData(getLocalPlayer(),"currentCol") outputChatBox(getElementData(col,"deadreason"),244,244,244,true) return end if itemName == "patrolstation" then local col = getElementData(getLocalPlayer(),"currentCol") setPedAnimation (getLocalPlayer(),"BOMBER","BOM_Plant", -1,false,false,false,false) setElementData(getLocalPlayer(),"Empty Gas Canister",getElementData(getLocalPlayer(),"Empty Gas Canister")-1) setTimer ( function() setElementData(getLocalPlayer(),"Full Gas Canister",(getElementData(getLocalPlayer(),"Full Gas Canister") or 0)+1) triggerEvent ("displayClientInfo",getLocalPlayer(),"patrolstation","Você encheu um Empty Gas Canister!",0,255,0) end, 5000, 1 ) playSound("sounds/Refill.mp3") disableMenu() return end if isToolbeltItem(itemName) then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() return end if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() else startRollMessage2("Inventory", "Inventory Full!", 255, 0, 0 ) end end end bindKey ( "mouse3", "down", onPlayerPressMiddleMouse ) bindKey ( "-", "down", onPlayerPressMiddleMouse ) function getMenuMarkedItem() for i,guiItem in ipairs(spalteGuiText) do if getElementData(guiItem,"markedMenuItem") then return getElementData(guiItem,"usedItem") end end end function getMenuMarkedItem() for id, value in pairs(theTableMenuScroll) do if id == numberMenuScroll then return value[5] end end end
  12. Lukkas2201

    Erro com arma

    sim, é arma duplicada, porém tem varias armas duplicadas, como assault rifles, snipers, e so buga com shotguns
  13. Lukkas2201

    Erro com arma

    sim já, eu pensei que fosse na função OnPlayerWeaponFire, porém lá ta tudo certo.
  14. Lukkas2201

    Erro com arma

    boa tarde, seguinte, estou com um problema e não consigo saber oque é, meu servidor de dayz, quando equipo a shotgun, ou sniper (não é toda vez que acontece), mesmo estando com arma e munição, ela não atira, aparece a arma, a munição, ai quando clica pra atirar não acontece nada, ai tem que relogar do servidor, alguem sabe me dizer oque pode ser?
  15. Lukkas2201

    Spawn de Veiculo

    consegui mano, era isso mesmo, obrigadão, e lhe agradeço também pela paciencia que teve comigo kkk, obrigadão !!