i got this error, but the script working fine... -.- bad argument #1 to 'len' (string expected, got boolean)
how to fix this?
code:
function currentSongName()
local radio_title = getElementData(resourceRoot, "radio.title")
if string.len(radio_title) >= x*0.0625 then
radio_title = string.sub(radio_title, 1, 80)..".."
end
for i, shading in pairs ( offsetShadings ) do
dxDrawText("Radio: "..radio_title, xD+shading[1], yD+shading[2], xD, yD+textHeight, tocolor ( 0, 0, 0, 255 ), scale, font, "left", "center", false, false, true, true)
end
dxDrawText("Radio: #ffffff"..radio_title, xD, yD, xD, yD+textHeight, tocolor ( 70, 215, 0, 255 ), scale, font, "left", "center", false, false, true, true)
end
addEventHandler('onClientRender', root, currentSongName)