™!>VàLéNTiNô<!™ Posted April 13, 2014 Share Posted April 13, 2014 انا مسوى كول شيب اللى يخبطو يسمعو صوت معين بس فى مشكلة ان الصوت يسمعو الكل يعنى السيرفر كلو ابيه انا بس اللى اسمعو وابى الصوت مايتكرر لو خبط الكول شيب مرتين مثلا انا دخلت منطقة ولمست الكول شيب وخرجت ودخلتها تانى الصوت يكون صوتين فوق بعض يرجى المساعدة وشكرا Link to comment
abu5lf Posted April 13, 2014 Share Posted April 13, 2014 انا مسوى كول شيب اللى يخبطو يسمعو صوت معينبس فى مشكلة ان الصوت يسمعو الكل يعنى السيرفر كلو ابيه انا بس اللى اسمعو وابى الصوت مايتكرر لو خبط الكول شيب مرتين مثلا انا دخلت منطقة ولمست الكول شيب وخرجت ودخلتها تانى الصوت يكون صوتين فوق بعض يرجى المساعدة وشكرا انت مسوي ترقير من سيرفر ل كلنت؟ https://wiki.multitheftauto.com/wiki/TriggerClientEvent اقرا : sendTo Link to comment
™!>VàLéNTiNô<!™ Posted April 13, 2014 Author Share Posted April 13, 2014 حذفت الترقر برضو فى صوت لكل السيرفر لما احد يلمس الكول شيب Link to comment
abu5lf Posted April 13, 2014 Share Posted April 13, 2014 حذفت الترقر برضو فى صوتلكل السيرفر لما احد يلمس الكول شيب ماتحذفه ، حط الترقير اشوف Link to comment
™!>VàLéNTiNô<!™ Posted April 13, 2014 Author Share Posted April 13, 2014 server addCommandHandler("رقص", function (thePlayer) if getElementType ( thePlayer ) == 'player' then setPedAnimation ( thePlayer, "DANCING", "dnce_m_b") end end ) client local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) addEventHandler("onClientColShapeHit", hillArea, function () local sound = playSound("sound.mp3") setSoundVolume(sound, 0.9) end ) انا حذفت الترقر ممكن تقلى كيف احطو هنا ؟ انا كنت مسوى الكول شيب فى السرفر بس كنت كاتب onColShapeHit Link to comment
The Killer Posted April 13, 2014 Share Posted April 13, 2014 جرب local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) addEventHandler("onClientColShapeHit", hillArea, function (hitPlayer) if hitPlayer == localPlayer then local sound = playSound("sound.mp3") setSoundVolume(sound, 0.9) end end ) Link to comment
فاّرس Posted April 13, 2014 Share Posted April 13, 2014 -- Client Side # local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) shape_ = function(hitPlayer) if hitPlayer == localPlayer then if eventName == 'onClientColShapeHit' then sound = playSound("sound.mp3") setSoundVolume(sound, 0.9) else if isElement(sound) then destroyElement(sound) sound = nil end end end end addEventHandler("onClientColShapeHit", hillArea,shape_) addEventHandler('onClientColShapeLeave',hillArea,shape_) Link to comment
#DRAGON!FIRE Posted April 13, 2014 Share Posted April 13, 2014 جرب local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) addEventHandler("onClientColShapeHit", hillArea, function (hitPlayer) if hitPlayer == localPlayer then local sound = playSound("sound.mp3") setSoundVolume(sound, 0.9) end end ) يجب انت تتحق من وجود الصوت .. وتسوي يوم يخرججـ ازالة للصوت > كودكـ يصير كذا local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) addEventHandler( "onClientColShapeHit", hillArea, function ( element ) if ( element == getLocalPlayer( ) ) then if ( isElement( sound ) ) then destroyElement( sound ) end sound = playSound( "sound.mp3" ) setSoundVolume( sound, 0.9 ) end end ) addEventHandler( "onClientColShapeLeave", hillArea, function ( element ) if ( element == getLocalPlayer( ) ) then if ( isElement( sound ) ) then destroyElement( sound ) end end end ) Link to comment
™!>VàLéNTiNô<!™ Posted April 13, 2014 Author Share Posted April 13, 2014 شكرا زاحف وشكرا للكل على المساعدة بس عندى استفسار يازاحف if ( isElement( sound ) ) then destroyElement( sound ) end بالكود الاول if ( isElement( sound ) ) then destroyElement( sound ) ) بالكود التانى اقصد فى الكول شيب وعند مغادرته ممكن شرح للكودين دولا احس انهم نفس بعض Link to comment
#DRAGON!FIRE Posted April 13, 2014 Share Posted April 13, 2014 فعلأ هم نفس بعض لانه بـ الكود الاول تحققت من وجود الصوت يوم يدخل اللاعب نفترض انه خرج من الماركر ودخل مرة اخرى .. والصوت موجود ( destroyElement ) ولو كان موجود حذفته ( isElement ) فـ تحققت من وجود الصوت وبـ الكود الثاني .. يوم يخرج اللاعب تحققت برضو من وجود الصوت وحذفته > لانه نفترض دخل وخرج وما عاد دخل مرة ثانية فـ الصوت يبقى موجود اتمنى فهمت .. اي شي ما فهمته تفضل قول # Link to comment
فاّرس Posted April 13, 2014 Share Posted April 13, 2014 احس اني ارد ع الفاضي, -- Client Side # local hillArea = createColRectangle ( -1381.53, -533.78, 100, 100 ) shape_ = function(hitPlayer) if hitPlayer == localPlayer then if eventName == 'onClientColShapeHit' then sound = playSound("sound.mp3") setSoundVolume(sound, 0.9) else if isElement(sound) then destroyElement(sound) sound = nil end end end end addEventHandler("onClientColShapeHit", hillArea,shape_) addEventHandler('onClientColShapeLeave',hillArea,shape_) كود زاحف مطول السالفه وذا مختصر Link to comment
#DRAGON!FIRE Posted April 13, 2014 Share Posted April 13, 2014 تذكر انه هو باقي مبتدأ .. يعني بسط له الكود عشان يفهمه Link to comment
™!>VàLéNTiNô<!™ Posted April 13, 2014 Author Share Posted April 13, 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