Doesn't sets the memo text to the info,
root = getRootElement()
sx,sy = guiGetScreenSize()
addCommandHandler("shop",function()
shop = {}
shop['window'] = guiCreateWindow((sx/2)-320,(sy/2)-240,640,480,"Shop",false)
shop['info1'] = guiCreateMemo(0.3644,0.1812,0.4759,0.3068,"",true,shop['window'])
shop['info2'] = guiCreateMemo(0.3644,0.6039,0.4759,0.3068,"",true,shop['window'])
loadShop()
end
)
function itm1(x,y,w,h,text,info)
local btn = guiCreateButton(x,y,w,h,text,true,shop['window'])
setElementData(btn,"infoindex",1)
setElementData(btn,"info",info)
end
function itm2(x,y,w,h,text,info)
local btn = guiCreateButton(x,y,w,h,text,true,shop['window'])
setElementData(btn,"infoindex",2)
setElementData(btn,"info",info)
end
function loadShop()
itm1(0.1714,0.1787,0.1597,0.0652,"Flip","Flip your car for $500") -- this for test
end
function getItemInfo()
if getElementData(source,"info") then
local infoindex = getElementData(source,"infoindex")
local info = getElementData(source,"info")
local infoMemo = "shop['info"..infoindex.."']"
guiSetText(infoMemo,info)
end
end
addEventHandler("onClientMouseEnter",root,getItemInfo)
I tried to debug using outputChatBox(info) under getItemInfo works but still doesn't works for the memo