function cam ( )
guiSetVisible(wnd, not guiGetVisible(wnd))
showCursor(guiGetVisible(wnd))
guiGridListClear(GridList)
for id, marker in ipairs(getElementsByType("marker")) do
local row = guiGridListAddRow ( GridList )
guiGridListSetItemText ( GridList, row, 1, "Marker " .. id, false, false )
end
end
addCommandHandler ( "camera",cam )
addEventHandler("onClientGUIClick",root,
function ()
if source == Cm then
local x, y, z = getElementPosition(localPlayer)
marker = createMarker ( x , y , z, "cylinder", 1.5, 255, 255, 0, 170 )
elseif source == Rm then
if guiGridListGetSelectedItem ( GridList ) ~= -1 then
guiGridListGetItemText (GridList,guiGridListGetSelectedItem (GridList),1)
guiGridListRemoveRow ( GridList,camera )
destroyElement(marker)
end
end
end)
السلام عليكم
اذا سويت اكثر من ماركر ماقدر احذف الماركرات اللي قبل
WARNING: camera\client.lua:41: Bad argument @ 'destroyElement' [Expected element at argument 1]
WARNING: camera\client.lua:41: Bad argument @ 'destroyElement' [Expected element at argument 1]