mouamle Posted March 8, 2014 Share Posted March 8, 2014 السلام عليكم أبي كود ماركر من أوقف عليها يفتح لوحة gui ويضهر الماوس + زر لغلق اللوحه وأن أمكن زر يعطي سلاح Link to comment
' ρяofзśŝoя 亗 Posted March 8, 2014 Share Posted March 8, 2014 السلام عليكم أبي كود ماركر من أوقف عليها يفتح لوحة gui ويضهر الماوس + زر لغلق اللوحه وأن أمكن زر يعطي سلاح الموضوعع انطرحح من قبل .. دور عليهه # Link to comment
mouamle Posted March 8, 2014 Author Share Posted March 8, 2014 ممكن الرابط أو مكان الموضوع Link to comment
The Killer Posted March 8, 2014 Share Posted March 8, 2014 Event # 'onClientMarkerHit' function # guiSetVisible showCursor Event # 'onClientGUIClick' function # guiCreateWindow bindKey showCursor triggerServerEvent server side # addEvent addEventHandler giveWeapon Link to comment
abu5lf Posted March 9, 2014 Share Posted March 9, 2014 -- Client Side GUIEditor_Window = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(478, 201, 296, 372, "Select a vehicle", false) guiSetVisible ( GUIEditor_Window[1] , false ) GUIEditor_Grid[1] = guiCreateGridList(9, 21, 278, 243, false, GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1], "Available vehicles :", 0.9) aCars = { --[[{ 'Car Name', Id Car };]] { 'Camry', 411 }; } for _, aCar in ipairs( aCars )do local gRow = guiGridListAddRow( GUIEditor_Grid[1] ) guiGridListSetItemText( GUIEditor_Grid[1], gRow, 1, tostring( aCar[ 1 ] ), false, false ) guiGridListSetItemData( GUIEditor_Grid[1], gRow, 1, tostring( aCar[ 2 ] ) ) end addEventHandler( 'onClientGUIDoubleClick', GUIEditor_Grid[1], function( ) local iRow, iCol = guiGridListGetSelectedItem( GUIEditor_Grid[1] ) if( iRow and iCol and iRow ~= -1 and iCol ~= -1 )then local ID_Car = tonumber( guiGridListGetItemData( GUIEditor_Grid[1], iRow, 1 ) ) if ID_Car ~= '' then triggerServerEvent( 'giveCar', localPlayer, ID_Car ) guiSetVisible( GUIEditor_Window[1], false ) showCursor( false ) end end end, false ) Marker1 = createMarker( 0, 0, 4, 'arrow', 2.5, 0, 0, 255, 150 ) addEventHandler( 'onClientMarkerHit', Marker1, function( hitPlayer ) if hitPlayer == localPlayer then guiSetVisible( GUIEditor_Window[1], true ) showCursor( true ) end end ) -- Server Side vehicle = { } addEvent( 'giveCar', true ) addEventHandler( 'giveCar', getRootElement( ), function( ID ) if isElement( vehicle[ source ] ) then destroyElement( vehicle[ source ] ) vehicle[ source ] = nil end vehicle[ source ] = createVehicle( ID , getElementPosition( source ) ) warpPedIntoVehicle( source, vehicle[ source ] ) end ) addEventHandler( 'onPlayerQuit', getRootElement( ), function( ) if isElement( vehicle[ source ] ) then destroyElement( vehicle[ source ] ) vehicle[ source ] = nil end end ) Link to comment
mouamle Posted March 11, 2014 Author Share Posted March 11, 2014 -- Client Side GUIEditor_Window = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(478, 201, 296, 372, "Select a vehicle", false) guiSetVisible ( GUIEditor_Window[1] , false ) GUIEditor_Grid[1] = guiCreateGridList(9, 21, 278, 243, false, GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) guiGridListAddColumn(GUIEditor_Grid[1], "Available vehicles :", 0.9) aCars = { --[[{ 'Car Name', Id Car };]] { 'Camry', 411 }; } for _, aCar in ipairs( aCars )do local gRow = guiGridListAddRow( GUIEditor_Grid[1] ) guiGridListSetItemText( GUIEditor_Grid[1], gRow, 1, tostring( aCar[ 1 ] ), false, false ) guiGridListSetItemData( GUIEditor_Grid[1], gRow, 1, tostring( aCar[ 2 ] ) ) end addEventHandler( 'onClientGUIDoubleClick', GUIEditor_Grid[1], function( ) local iRow, iCol = guiGridListGetSelectedItem( GUIEditor_Grid[1] ) if( iRow and iCol and iRow ~= -1 and iCol ~= -1 )then local ID_Car = tonumber( guiGridListGetItemData( GUIEditor_Grid[1], iRow, 1 ) ) if ID_Car ~= '' then triggerServerEvent( 'giveCar', localPlayer, ID_Car ) guiSetVisible( GUIEditor_Window[1], false ) showCursor( false ) end end end, false ) Marker1 = createMarker( 0, 0, 4, 'arrow', 2.5, 0, 0, 255, 150 ) addEventHandler( 'onClientMarkerHit', Marker1, function( hitPlayer ) if hitPlayer == localPlayer then guiSetVisible( GUIEditor_Window[1], true ) showCursor( true ) end end ) -- Server Side vehicle = { } addEvent( 'giveCar', true ) addEventHandler( 'giveCar', getRootElement( ), function( ID ) if isElement( vehicle[ source ] ) then destroyElement( vehicle[ source ] ) vehicle[ source ] = nil end vehicle[ source ] = createVehicle( ID , getElementPosition( source ) ) warpPedIntoVehicle( source, vehicle[ source ] ) end ) addEventHandler( 'onPlayerQuit', getRootElement( ), function( ) if isElement( vehicle[ source ] ) then destroyElement( vehicle[ source ] ) vehicle[ source ] = nil end end ) شكرا لكن ما أبية قريد لست أبيه زر بيتون 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