1337.Ibrahim Posted July 2, 2017 Share Posted July 2, 2017 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] Link to comment
iMr.Omar Posted July 2, 2017 Share Posted July 2, 2017 وش تبي تسوي بالظبط ؟ تبي تجيب الماركرات وتحطها باللستة وتختار وتحذفها ؟ Link to comment
1337.Ibrahim Posted July 2, 2017 Author Share Posted July 2, 2017 10 minutes ago, iMr.Omar said: وش تبي تسوي بالظبط ؟ تبي تجيب الماركرات وتحطها باللستة وتختار وتحذفها ؟ يب Link to comment
iMr.Omar Posted July 2, 2017 Share Posted July 2, 2017 addCommandHandler ( 'camera' , function ( ) guiSetVisible ( wnd , not guiGetVisible ( wnd ) ) ; showCursor ( guiGetVisible ( wnd ) ) ; for index , values in ipairs ( getElementsByType ( 'marker' ) ) do local newRow = guiGridListAddRow ( GridList ) ; guiGridListSetItemText ( GridList , newRow , 1 , 'Marker #'..tostring(index) , false , false ) guiGridListSetItemData ( GridList , newRow , 1 , { Element = values } ); end end ); addEventHandler ( 'onClientGUIClick' , resourceRoot , function ( ) if ( source == Cm ) then local aSelected = guiGridListGetSelectedItem ( GridList ) ; if ( aSelected ~= -1 ) then local aElement = guiGridListGetItemData ( GridList , aSelected , 1 ) [ 'Element' ] ; if ( isElement ( aElement ) ) then destroyElement ( aElement ) ; end end end end ); 1 Link to comment
1337.Ibrahim Posted July 2, 2017 Author Share Posted July 2, 2017 @iMr.Omar صار يكرر الماركرات في القريد ليست Link to comment
iMr.Omar Posted July 2, 2017 Share Posted July 2, 2017 addCommandHandler ( 'camera' , function ( ) guiSetVisible ( wnd , not guiGetVisible ( wnd ) ) ; showCursor ( guiGetVisible ( wnd ) ) ; guiGridListClear ( GridList ) ; for index , values in ipairs ( getElementsByType ( 'marker' ) ) do local newRow = guiGridListAddRow ( GridList ) ; guiGridListSetItemText ( GridList , newRow , 1 , 'Marker #'..tostring(index) , false , false ) guiGridListSetItemData ( GridList , newRow , 1 , { Element = values } ); end end ); addEventHandler ( 'onClientGUIClick' , resourceRoot , function ( ) if ( source == Cm ) then local aSelected = guiGridListGetSelectedItem ( GridList ) ; if ( aSelected ~= -1 ) then local aElement = guiGridListGetItemData ( GridList , aSelected , 1 ) [ 'Element' ] ; if ( isElement ( aElement ) ) then destroyElement ( aElement ) ; end end end end ); ماعليش نسيت اكمل الكود 1 Link to comment
1337.Ibrahim Posted July 2, 2017 Author Share Posted July 2, 2017 @iMr.Omar يعطيك الف عافية Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now