Szerző Téma: Jelvény Hiba  (Megtekintve 886 alkalommal)

Jelvény Hiba
« Dátum: 2016. Március 10. - 16:48:24 »
0 Show voters
Üdvözlet, lenne egy kis problémám a jelvény rendszerrel hogy amikor fel akarom tenni akkor egy kis szöveget kapok a degubscriptbe és nem működik,de viszont hogyha még egyszer rámegyek az itemre akkor a levétellel nincsen semmi baj. Ha valaki tudna segíteni nagyon megköszönném  :)
Ezt a szöveget írja: ERROR:SM_items/sitemmuvelet.lua:366: attempt to concatenate local \'shortname\' (a boolean value)
 
if getPlayerTeam(source) then
      local team = getPlayerTeam(source)
      local shortname = getElementData(team,\"shortname\")
      local ftype = getElementData(team,\"type\")
      local ftypecolors = {
         
  • = {137, 58, 35}, [1] = {180, 128, 128},
  • [2] = {0, 180, 255}, [3] = {90, 180, 70},
             [4] = {240, 35, 17}, [5] = {245, 160, 20},
          }
          setElementData(source, \"isBadgeActive\", 1)
          setElementData(source, \"tagName\", \"(\"..shortname..\")\")
          setElementData(source, \"tagNameColorR\", ftypecolors
[ftype][1])
      setElementData(source, \"tagNameColorG\", ftypecolors[ftype][2])
      setElementData(source, \"tagNameColorB\", ftypecolors[ftype][3])
      exports.SM_brain:sendLocalMeAction(source, \"felveszi a jelvényét.\")
   end
end

Jelvény Hiba
« Válasz #1 Dátum: 2016. Március 10. - 20:51:16 »
0 Show voters
A \"shortname\" váltózóval probléma van. Így le fog futni, viszont nézz utána, hogy pontosan van-e egyáltalán érték adva a \"shortname\"-hez!
 
if getPlayerTeam(source) then
        local team = getPlayerTeam(source)
        local shortname = getElementData(team,\"shortname\") or \"Hiba\"
        local ftype = getElementData(team,\"type\")
                local ftypecolors = {
                       
  • = {137, 58, 35}, [1] = {180, 128, 128},

                        [2] = {0, 180, 255}, [3] = {90, 180, 70},
                        [4] = {240, 35, 17}, [5] = {245, 160, 20},
                }
                setElementData(source, \"isBadgeActive\", 1)
                setElementData(source, \"tagName\", \"(\"..shortname..\")\")
                               
                setElementData(source, \"tagNameColorR\", ftypecolors[ftype][1])
                setElementData(source, \"tagNameColorG\", ftypecolors[ftype][2])
                setElementData(source, \"tagNameColorB\", ftypecolors[ftype][3])
                exports.SM_brain:sendLocalMeAction(source, \"felveszi a jelvényét.\")
        end
end

Jelvény Hiba
« Válasz #2 Dátum: 2016. Március 10. - 20:57:20 »
0 Show voters
Köszönöm a segítséget most már működik

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal