Dr.Xen Posted August 30, 2014 Share Posted August 30, 2014 السلام عليكم ورحمة الله وبركاته .. اخبارركمم ... اهنيكم ل الدرااسةةة .. ض1 ممكن تعديل للــكود ابيه لو احد دخل الكول شيب يشتغل الصوت if sound then setSoundVolume ( sound, 200 ) setSoundMaxDistance(sound, 200) end end ) Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 وش ذا كله playSound وبس . Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 كل زقلحينً تجي ام زاحف للبي قلبها احترم تحترم ^ Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 لا ابي ام زاحف وامك ، كل ترآب انت وخشتك Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 anasd102030 : اسحب عليه وبس playSound الحين انت استخدم وطبعا كل ما يخش تتحقق من وجود الصوت وتشيله . Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 زاحف ابي لو دخل كول شيب .. ض1 Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 local colshape = createColSphere ( ... ) addEventHandler ( "onClientColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( element == getLocalPlayer ( ) ) then if ( isElement ( Sound ) ) then destroyElement ( Sound ) end Sound = playSound ( ... ) end end end end ) Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 انا مابي احط صوت من الجهاز ابيه من النت شف الكود : GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Edit = {} GUIEditor_Label = {} vehicleId = {603,587,559,541,451,429,515,402,470,561,562,411,565,503,431,522,571} AircraftId = {487,469} local Url2 = dxCreateTexture("3.png") addEventHandler( "onClientRender", root, function ( ) local x, y, z =2198.6999511719,432,9.6999998092651 dxDrawMaterialLine3D(x, y, z+0.6, x, y, z+5.6, Url2, 1, tocolor(255,255,255,255)) end ) abady1 = createMarker( 2138.6999511719,504.79998779297,9.8000001907349, 'cylinder', 1.7000000476837, 255, 0, 0, 255 ) abady2 = createMarker( 2138.8000488281,494.89999389648,9.8000001907349, 'cylinder', 1.7000000476837, 255, 0, 0, 255 ) mArkSound = createMarker( 2198.6999511719,432,9.6999998092651, 'cylinder', 1.7000000476837, 225, 0, 0, 255 ) local xx,yy = guiGetScreenSize() local xx = xx - 396 local yy = yy - 161 wnd = guiCreateWindow(xx/2,yy/2,396,161,".: Sound System :. [Leg]",false) guiSetAlpha(wnd,1) guiWindowSetSizable(wnd,false) GUIEditor_Edit[1] = guiCreateEdit(10,22,328,24,"",false,wnd) GUIEditor_Label[1] = guiCreateLabel(340,22,48,24,"الرابط ",false,wnd) addEvent('okS', true) addEventHandler('okS', root, function(url) sound = playSound3D( url, 2198.6999511719,432,9.6999998092651 ) if sound then setSoundVolume ( sound, 150 ) setSoundMaxDistance(sound, 150) end end ) addEvent('okStop', true) addEventHandler('okStop', root, function() destroyElement( sound ) end ) addEvent('ptf', true) addEventHandler('ptf', root, function() if not isElement( sound ) then outputChatBox('لم يتم تشغيل الصوت', 255, 0, 0, false) return end if isSoundPaused(sound) then setSoundPaused(sound, false) outputChatBox(' تم استئناف الصوت ', 0, 255, 0, false) else setSoundPaused(sound, true) outputChatBox(' تم ايقاف الصوت مؤقت ', 0, 255, 0, false) end end ) GUIEditor_Button[8] = guiCreateButton(11,80,117,29,"اغلاق الوحة",false,wnd) GUIEditor_Button[5] = guiCreateButton(274,65,102,26,"تشغيل الصوت",false,wnd) GUIEditor_Button[6] = guiCreateButton(166,65,102,26,"ايقاف الصوت",false,wnd) GUIEditor_Button[7] = guiCreateButton(169,108,207,28,"ايقاف \ استئناف الصوت مؤقت",false,wnd) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[5] ) then url = guiGetText( GUIEditor_Edit[1] ) if url == '' or url == ' ' then outputChatBox('تأكد من وضع رابط صحيح', 255, 0, 0, false) return end if isElement( sound ) then outputChatBox('تم تشغيل الصوت من قبل', 255, 0, 0, false) return end triggerServerEvent('sRoot', localPlayer,url) elseif ( source == GUIEditor_Button[6] ) then if not isElement( sound ) then outputChatBox('لم يتم تشغيل الصوت', 255, 0, 0, false) return end triggerServerEvent('stop', localPlayer) elseif ( source == GUIEditor_Button[7] ) then triggerServerEvent('sptf', localPlayer) elseif ( source == GUIEditor_Button[8] ) then setPedFrozen ( localPlayer, false ) guiSetVisible(wnd,false) showCursor( false ) end end ) guiSetVisible(wnd,false) local x,y = guiGetScreenSize() local x = x - 208 local y = y - 321 GUIEditor_Window[1] = guiCreateWindow(x/2,y/2,208,321,"Vehicles And Aircraft List",false) guiSetAlpha(GUIEditor_Window[1],1) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(10,25,184,244,false,GUIEditor_Window[1]) column = guiGridListAddColumn( GUIEditor_Grid[1], 'vehiceName', 0.80 ) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Button[1] = guiCreateButton(12,277,87,30,"الغاء",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(107,277,87,30,"اختيار",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) for i,id in ipairs ( vehicleId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromID( id ), false, false ) end for i,id2 in ipairs ( AircraftId ) do guiGridListSetItemText ( GUIEditor_Grid[1], guiGridListAddRow( GUIEditor_Grid[1] ), column, getVehicleNameFromID( id2 ), false, false ) end addEventHandler ("onClientMarkerHit", root, function( player ) if getElementType(player) == "player" and not isPedInVehicle( player ) and player == localPlayer and getElementData ( player , "Group" ) == "Leg" then if ( source == abady1 ) then local x,y,z = getElementPosition( localPlayer ) if z < 114 and z > 100 then end setPedFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) elseif ( source == abady2 ) then local x,y,z = getElementPosition( localPlayer ) if z < 114 and z > 100 then end setPedFrozen ( localPlayer, true ) guiSetVisible(GUIEditor_Window[1],true) showCursor( true ) elseif ( source == mArkSound ) then local xm, ym, zm = getElementPosition( localPlayer ) if not isPedInVehicle( localPlayer ) then if getPlayerSerial( localPlayer ) == 'F77D370EB766D26F55412E515564A903' then setPedFrozen ( localPlayer, true ) guiSetVisible(wnd,true) showCursor( true ) else outputChatBox('لوحة تشغيل خاصة لـ أنس', 255, 0, 0, false) end end end end end ) addEventHandler('onClientGUIClick', root, function() if ( source == GUIEditor_Button[1] ) then guiSetVisible(GUIEditor_Window[1],false) showCursor( false ) setPedFrozen ( localPlayer, false ) elseif ( source == GUIEditor_Button[2] ) then local name = guiGridListGetItemText( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) triggerServerEvent('giveCarOrAir', getLocalPlayer(), name) guiSetVisible(GUIEditor_Window[1],false) setPedFrozen ( localPlayer, false ) showCursor( false ) end end ) addEvent("warningSound", true) addEventHandler("warningSound", localPlayer, function() if isElement(warningSound) then stopSound(warningSound) end warningSound = playSound("warning.mp3") end ) سطر 29 تبع الصوت Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 (edited) عندكـ بعض الاخطاء .. ثاني شي عطيتك الكود وانت سوي اللي تبيه .. سطر 7 شيله وحط كودكـ ! Edited August 31, 2014 by Guest Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 (edited) * Edited August 31, 2014 by Guest Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 local colshape = createColSphere ( ... ) addEventHandler ( "onClientColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( element == getLocalPlayer ( ) ) then if ( isElement ( Sound ) ) then destroyElement ( Sound ) end setSoundVolume ( sound, 200 ) setSoundMaxDistance(sound, 200) end end end end ) كذا ^^؟؟ Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 local colshape = createColSphere ( ... ) addEventHandler ( "onClientColShapeHit", resourceRoot, function ( element ) if ( source == colshape ) then if ( element == getLocalPlayer ( ) ) then if ( isElement ( Sound ) ) then destroyElement ( Sound ) end setSoundVolume ( sound, 200 ) setSoundMaxDistance(sound, 200) end end end end ) كذا ^^؟؟ sound الى Sound لو مشغل الصوت من قبل صحيح .. بس استبدل كلمة بس لزوم تشغله برضو يوم يخش لانه يوم يخش يتحقق لو الصوت موجود ويشيله . بسطر 6 . Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 مو مشغل .. انا احط رابط في اللوحة وتشغل Link to comment
#DRAGON!FIRE Posted August 30, 2014 Share Posted August 30, 2014 طيب سوي استخدم كودي وشيل النقاط وحط الرابط ! Link to comment
Dr.Xen Posted August 30, 2014 Author Share Posted August 30, 2014 مو رابط واحد .. انا اجيب عدة روابط واحط باللوحة علشانن تشتغل Link to comment
#DRAGON!FIRE Posted August 31, 2014 Share Posted August 31, 2014 طيب وش المشكلة بالضبط .. سوي جدول ولا شي ماني فاهم عليكـ . Link to comment
Dr.Xen Posted August 31, 2014 Author Share Posted August 31, 2014 خلاص ت حل .. شكرآ لك.. 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