GTA Közösség - A magyar GTA fórum

Multi Theft Auto (MTA) => MTA: Szerverfejlesztés => Segítségkérés => A témát indította: lakat0410 - 2019. Február 03. - 19:42:02

Cím: SawMTA inventory
Írta: lakat0410 - 2019. Február 03. - 19:42:02
Sziasztok, az lenne a problémám, hogy a sawmta modban, az inventory nem nyílik meg, az actionbar is működik és az azon lévő itemek, de az inv nem jelenik meg. Mi lehet a baj? Előre is köszi a válaszokat!
Cím: SawMTA inventory
Írta: Core - 2019. Február 04. - 15:16:09
debugscript nem ír semmit?
Cím: SawMTA inventory
Írta: lakat0410 - 2019. Február 04. - 19:00:31
attempt to perform arithmetic on a nil value
 
Ehhez a functionhoz: 
 

function getAllItemWeight()
local bagWeight = 0
local keyWeight = 0
local vehWeight = 0
local objectWeight = 0
if isElement(elementSource) then
   if getElementType(elementSource) == \"player\" then
      if inventoryItems[elementSource][\"bag\"] then
         for i = 1, row * column do
            if (inventoryItems[elementSource][\"bag\"]) then
               bagWeight = bagWeight + (getItemWeight(inventoryItems[elementSource][\"bag\"][\"id\"]) * inventoryItems[elementSource][\"bag\"][\"count\"])
            end
         end
      end
      if inventoryItems[elementSource][\"key\"] then
         for i = 1, row * column do
            if (inventoryItems[elementSource][\"key\"]) then
               keyWeight = keyWeight + (getItemWeight(inventoryItems[elementSource][\"key\"][\"id\"]) * inventoryItems[elementSource][\"key\"][\"count\"])
            end
         end
      end
   end
   if getElementType(elementSource) == \"vehicle\" then
      if inventoryItems[elementSource] then
         if inventoryItems[elementSource][\"vehicle\"] then
            for i = 1, row * column do
               if (inventoryItems[elementSource][\"vehicle\"]) then
                  vehWeight = vehWeight + (getItemWeight(inventoryItems[elementSource][\"vehicle\"][\"id\"]) * inventoryItems[elementSource][\"vehicle\"][\"count\"])
               end   
            end
         end
      end
   end
   if getElementType(elementSource) == \"object\" then
      if inventoryItems[elementSource][\"object\"] then
         for i = 1, row * column do
            if (inventoryItems[elementSource][\"object\"]) then
               objectWeight = objectWeight + (getItemWeight(inventoryItems[elementSource][\"object\"][\"id\"]) * inventoryItems[elementSource][\"object\"][\"count\"])
            end   
         end
      end
   end
end
return bagWeight + keyWeight + vehWeight + objectWeight
end

 
 
Cím: SawMTA inventory
Írta: Jason - 2019. Február 04. - 19:24:45
Olyan módtól ne is várj csodát, amit úgy tettek fel, hogy elcseszték előtte :D 
Cím: SawMTA inventory
Írta: ArcFox - 2019. Február 04. - 19:32:25
\"W2169xg.png\"
Cím: SawMTA inventory
Írta: lakat0410 - 2019. Február 04. - 19:38:16
Csak érdeklődtem, kipróbálni szerettem volna, de köszi :D
 
 
 
:DD