Ü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
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