baba Posted March 13, 2015 Share Posted March 13, 2015 سلام عليكم شباب ابي كود صوره احطها انا توضيح انا عندي لوحه ابي اركب لها صوره يعني اذا فتحت الوحه يكون الخلفيه حقت الوحه صوره انا الي حطيتها ارجو التوضيخ Link to comment
baba Posted March 13, 2015 Author Share Posted March 13, 2015 function showClientImage() guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), showClientImage ) ممكن توضح يعني وين احط عنوان حق الوحه وكذا Link to comment
Bassam*Syria Posted March 13, 2015 Share Posted March 13, 2015 اها يعني تبي بدال الوحه العاديه تبي تحط صوره من عندك ؟ شوف ذي الوحه العاديه يعني لوحه من برنامج جوي اديتور GUIEditor.window[1] = guiCreateWindow(321,90,292,332, "", false) GUIEditor.button[1] = guiCreateButton(9,433,138,43, "Take Job", false, GUIEditor.window[1]) كيف اسوي الوحه صوره ؟ شوف كيف تصير تبدل guiCreateWindow ب guiCreateStaticImage يعي يصير GUIEditor.Image[1] = guiCreateStaticImage(321,90,292,332, "p.png", false) p.png = اسم الصوره مع صيغتها p= اسم الصوره \ png = صيغتها و الزر الي يكون عليها يصير GUIEditor.button[1] = guiCreateButton(9,433,138,43, "Take Job", false, GUIEditor.Image[1]) اتمنا تكون فهمت Link to comment
baba Posted March 13, 2015 Author Share Posted March 13, 2015 شكرن يا بسام بس ممكن تركبه على لوحه عاديه اي لوحه بس ابي اعرف وش الي يتغير وش ازيد وين ينحط الكود + بسام انا اعز صديك لك بس انا مغير اسمي اذا رجعت لي مضيك بتتذكرني Link to comment
TAPL Posted March 13, 2015 Share Posted March 13, 2015 wnd = guiCreateWindow(200, 200, 150, 300, "Test", false) guiCreateStaticImage(0, 0, 150, 300, "imagename.png", false, wnd) Link to comment
baba Posted March 14, 2015 Author Share Posted March 14, 2015 ولله بحاول اركب الكود على الوحه بس مو عارف لو تقدر توضح لي اكثر Link to comment
Bassam*Syria Posted March 14, 2015 Share Posted March 14, 2015 اخوي اطرح لوحتك مع اسم الصوره الموجوده في ملف المود ( الي تبي تحطها بدال الوحه العاديه بظبتها لك و انت اتعلم من كودك Link to comment
xAbO-d7mY Posted March 14, 2015 Share Posted March 14, 2015 ححط ذذ الكود ف أول سطر ! و أمورك ف السليمم # function guiCreateWindow( x2, y2, width2, height2, titleBarText2, relative2 ) local mainBackground = guiCreateStaticImage ( x2, y2, width2, height2, "Back.png", relative2 ) -- بدل بـ Back ب أسم الصورة اللي عندك # local mainBackgroundLabel = guiCreateLabel ( 160, 0, 950, 950, titleBarText2, false, mainBackground ) guiSetFont ( mainBackgroundLabel, newFont2 ) guiSetEnabled ( mainBackgroundLabel, false ) return mainBackground end Link to comment
baba Posted March 14, 2015 Author Share Posted March 14, 2015 local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "baba", false) guiWindowSetSizable(GUIEditor.window, false) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) ذا الكود يا بسام Link to comment
Mr.T9 Posted March 14, 2015 Share Posted March 14, 2015 local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "baba", false) guiWindowSetSizable(GUIEditor.window, false) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) ذا الكود يا بسام local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {}, img = {} } GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "baba", false) guiWindowSetSizable(GUIEditor.window, false) GUIEditor.img guiCreateStaticImage(0, 0, 150, 300, "imagename.png", false, GUIEditor.window) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) Link to comment
Mr.T9 Posted March 14, 2015 Share Posted March 14, 2015 local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "baba", false) guiWindowSetSizable(GUIEditor.window, false) س GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) ذا الكود يا بسام local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {}, img = {} } GUIEditor.window = guiCreateWindow(256, 98, 294, 435, "baba", false) guiWindowSetSizable(GUIEditor.window, false) GUIEditor.img guiCreateStaticImage(0, 0, 150, 300, "test.png", false, GUIEditor.window) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) غير مسار الصورة + الطول والعرض ومكانها Link to comment
baba Posted March 14, 2015 Author Share Posted March 14, 2015 ممكن توضح ىاكثر يا حب لاني اتلخبط وين احط اسم اصوره وكذا + وين احط مسار الصورح Link to comment
Mr.T9 Posted March 14, 2015 Share Posted March 14, 2015 ممكن توضح ىاكثر يا حب لاني اتلخبط وين احط اسم اصوره وكذا+ وين احط مسار الصورح اسم الصورة test المسار test.png Link to comment
baba Posted March 14, 2015 Author Share Posted March 14, 2015 يا حب ركبت كل شي وشغلت المود الماركر طلع بس لما ادخل الماركر ماي يفتح لي الوحه Link to comment
Bassam*Syria Posted March 14, 2015 Share Posted March 14, 2015 تفضل اخوي نشالله تكون فهمت كيف local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateStaticImage(256, 98, 294, 435, "P.png", false) -- P.png اسم الصوره مع سيغتها guiWindowSetSizable(GUIEditor.window, false) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end end end) Link to comment
baba Posted March 14, 2015 Author Share Posted March 14, 2015 تفضل اخوي نشالله تكون فهمت كيف local skins = { "Skin Jobs 1 (skin: 271)", "Skin Jobs 2 (skin: 298)" } GUIEditor = { --label = {}, button = {}, window = {}, memo = {}, gridlist = {} } GUIEditor.window = guiCreateStaticImage(256, 98, 294, 435, "P.png", false) -- P.png اسم الصوره مع سيغتها guiWindowSetSizable(GUIEditor.window, false) GUIEditor.memo = guiCreateMemo(9, 27, 275, 219, " \"{SMILIES_PATH}/icon_razz.gif\" alt=\"\" title=\"Razz\" /> ", false, GUIEditor.window) guiMemoSetReadOnly(GUIEditor.memo, true) GUIEditor.aceptar = guiCreateButton(9, 397, 127, 28, "Take Skin Jop", false, GUIEditor.window) GUIEditor.cancelar = guiCreateButton(157, 397, 127, 28, "Exit", false, GUIEditor.window) GUIEditor.gridlist = guiCreateGridList(9, 256, 275, 131, false, GUIEditor.window) guiGridListSetSelectionMode(GUIEditor.gridlist,2) _skins = guiGridListAddColumn(GUIEditor.gridlist, "اختار شخصياتك", 0.9) guiSetVisible(GUIEditor.window, false) for index, skin in ipairs ( skins ) do local row = guiGridListAddRow ( GUIEditor.gridlist ) guiGridListSetItemText ( GUIEditor.gridlist, row, _skins, tostring ( skin ), false, false ) end addEventHandler ( "onClientGUIClick", guiRoot, function ( ) if ( source == GUIEditor.aceptar ) then local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist ) if ( row and col and row ~= -1 and col ~= -1 ) then local skinName = guiGridListGetItemText ( GUIEditor.gridlist, row, 1 ) if ( skinName == "Skin Jobs 1 (skin: 271)" ) then triggerServerEvent ( "setBarco", localPlayer, 271 ) elseif ( skinName == "Skin Jobs 2 (skin: 298)" ) then triggerServerEvent ( "setBarco", localPlayer, 298 ) end guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) else outputChatBox ( "اخترا شخصيتك ", 255, 0, 0 ) end elseif ( source == GUIEditor.cancelar ) then guiSetVisible ( GUIEditor.window, false ) showCursor ( false ) end end ) function pe () if guiGetVisible (GUIEditor.window) == true then else showCursor (true) guiSetVisible (GUIEditor.window,true) end end addEvent ("baba", true) addEventHandler ("baba",root, pe) addEvent ( "barco_set_location", true ) addEventHandler ( "barco_set_location", root, function ( x, y, z ) marker = createMarker ( x, y, z - 1, "cylinder", 2.5, 235, 141, 19, 153 ) blip = createBlipAttachedTo ( marker, 41 ) addEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) end ) function onBarcoStopHit ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) and ( hitPlayer == localPlayer ) then triggerServerEvent ( "pizza_finish", localPlayer ) if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end addEventHandler ( "onClientVehicleExit", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then if isElement ( blip ) then destroyElement ( blip ) end if isElement ( marker ) then removeEventHandler ( "onClientMarkerHit", marker, onBarcoStopHit ) destroyElement ( marker ) end end end ) GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Marker = {} GUIEditor_Window = {} vehicleId = {535,600} GUIEditor_Marker[1] = createMarker(2473.52051, -1696.91187, 12.51631,"cylinder",3,255,255,0,255) GUIEditor_Marker[2] = createMarker(2459.45264, -1690.21484, 12.54478,"cylinder",3,255,0,0,0) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(200,147,246,314,"baba",false) guiSetVisible(GUIEditor_Window[1],false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,34,228,155,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) column = guiGridListAddColumn(GUIEditor_Grid[1],"vehicle name",0.9) GUIEditor_Button[2] = guiCreateButton(20,208,210,41,"Select",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(20,252,210,41,"Close",false,GUIEditor_Window[1]) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromModel( id ), false, false ) end ------------------------------------------------------------------------------------------------------ addEventHandler ("onClientMarkerHit", GUIEditor_Marker[1], function( player ) if getPlayerTeam( player ) and getTeamName( getPlayerTeam( player ) ) == 'baba' and not isPedInVehicle( player ) and player == localPlayer then x999,y999,z999 = getElementPosition( localPlayer ) setElementFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setElementFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('gvoa', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setElementFrozen ( localPlayer, false ) showCursor( false ) end end ) ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- addEventHandler("onClientRender", getRootElement(), function() local x, y, z = getElementPosition (GUIEditor_Marker[2]) local x2, y2, z2 = getElementPosition(localPlayer) if(isLineOfSightClear(x, y, z, x2, y2, z2, true, true, false, true)) then local sx, sy = getScreenFromWorldPosition(x, y, z+2) if(sx) and (sy) then local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distance < 100) then dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") dxDrawText("baba", sx, sy, sx, sy, tocolor(255, 255, 0, 1000), 2-(distance/100), "arial", "center", "center") end end 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