Bassam*Syria Posted July 13, 2016 Posted July 13, 2016 السلام عليكم انا سويت كود لما الاعب يضرب على اوبجيكت يختفي لكن في مشكله مدري وين الاكواد function test ( attacker, weapon, targetElem ) -- if ( weapon == 42 ) then if ( getElementType ( targetElem ) == "object" ) and ( getElementModel ( targetElem ) == 2023 ) then destroyElement ( targetElem ) end --end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), test )
Bassam*Syria Posted July 13, 2016 Author Posted July 13, 2016 إستعمل الحدث ذا : onClientObjectDamage شكرا على تعليقكم اخوي لكن انا جربته وما اشتغل لو تقدر تعدل على كودي تكون فضل
N3xT Posted July 13, 2016 Posted July 13, 2016 addEventHandler("onClientObjectDamage", root, function(_,attacker) if ( attacker ) then destroyElement(source) end end)
Bassam*Syria Posted July 13, 2016 Author Posted July 13, 2016 addEventHandler("onClientObjectDamage", root, function(_,attacker) if ( attacker ) then destroyElement(source) end end) شكرا اخوي ظبت لكن في مشكله انا ضفت لو كان معاه سلاح طفايه الحريق لكن مو راضي يظبت M4 غيرت السلاح سويته ظبت ! كيف ممكن اسويها ؟
N3xT Posted July 13, 2016 Posted July 13, 2016 ^ العفو , وحياك الله تأكد من الآي دي حق الطفاية + هل هي سلاح ؟
Bassam*Syria Posted July 13, 2016 Author Posted July 13, 2016 ^ العفو , وحياك الله تأكد من الآي دي حق الطفاية + هل هي سلاح ؟ يب هي سلاح لاك لما ارب مافي تعيين يعني تعيين و تضرب ما يطلع دائره بالنص الشاشه زي السلاح العادي اعتقد هنا المشكله كيف ممكن اسويها ؟
N3xT Posted July 13, 2016 Posted July 13, 2016 addEventHandler("onClientObjectDamage", root, function(_,attacker) if ( attacker ) then if ( getPedWeapon ( attacker ) == 42 ) then destroyElement(source) end end end)
Me[Z]oO Posted July 13, 2016 Posted July 13, 2016 addEventHandler("onClientObjectDamage", root, function(_,attacker) if ( attacker ) then if ( getPedWeapon ( attacker ) == 42 ) then destroyElement(source) end end end) افترض لو هو مسوي مود اخر وحاطط اوبجيكت واجا لاعب ضرب الاوبجيكت بالسلاح (ID = 42) ؟ رح يختفي لذلك تحقق ان السورس == اسم متغير انشاء الاوبجيكت + تحقق من الاتاكر هو لاعب @Bassam لو حاط كلمة local قبل متغير انشاء الاوبجيكت يا ريت تشيلها بعد التعديل addEventHandler("onClientObjectDamage", root, function(_,attacker) if attacker and getElementType(attacker) == 'player' then if source == اسم متغير انشاء الاوبجيكت then if getPedWeapon ( attacker ) == 42 then destroyElement(source) end end end end )
فاّرس Posted July 13, 2016 Posted July 13, 2016 ^ لأنه هو يبيها كذا مثل كوده اللي فوق getElementModel يستخدم
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