Mars2 Posted October 10, 2015 Share Posted October 10, 2015 السلام عليكم مرحبا بالجميع كيف الحال؟؟ انا بسوي كود لما الاعب يركب دباب مثل النرج ويصدم ما يقع منها وش الكود حقه؟؟ Link to comment
' A F . Posted October 10, 2015 Share Posted October 10, 2015 'onClientPlayerVehicleEnter' 'onClientPlayerVehicleExit' getElementModel setPedCanBeKnockedOffBike Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 الكود الثالث يتحقق من الموديل والرابع ما يخليه يسقط ؟؟ Link to comment
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 function changeCanBeKnockedOff ( command ) -- The player should enter /knock if canPedBeKnockedOffBike ( getLocalPlayer() ) then setPedCanBeKnockedOffBike ( getLocalPlayer(), false ) outputChatBox ( "Now you can't be knocked off your bike." ) else setPedCanBeKnockedOffBike ( getLocalPlayer(), true ) outputChatBox ( "Now you can be knocked off your bike." ) end end addCommandHandler ( "knock", changeCanBeKnockedOff ) مثال من الويكي بس من امر في اف ٨ Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 function nrg (theVehicle) local cars = getElementModel ( theVehicle ) if cars == 522 then setPedCanBeKnockedOffBike ( theVehicle, true ) end end addEventHandler( "onClientPlayerVehicleEnter",nrg,theVehicle ) معلش اعرف فيه اخطأء ممكن تقولون لي وش هي؟؟ Link to comment
TAPL Posted October 10, 2015 Share Posted October 10, 2015 function nrg (theVehicle) local cars = getElementModel ( theVehicle ) if cars == 522 then setPedCanBeKnockedOffBike ( source, false ) end end addEventHandler( "onClientPlayerVehicleEnter",root,nrg) Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 اخوي بس ما ضبط ركبت دباب وسرعت وصدمت جدار وسقط Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 اخوي مو ضابط انت فاهم وش ابي؟؟ انا ابي اذا ركبت دباب لو صدمت اي شي مستحيل اقع منها Link to comment
TAPL Posted October 10, 2015 Share Posted October 10, 2015 حط السطر ذا بملف كلينت setPedCanBeKnockedOffBike(localPlayer, false) فقط! Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 اخوي ضبط بس غريبه كل الدبابات ما يقع منها انا ابيها دباب محدد الي هوه 522 Link to comment
TAPL Posted October 10, 2015 Share Posted October 10, 2015 addEventHandler("onClientPlayerVehicleEnter", root, function(theVehicle) if getVehicleType(theVehicle) == "Bike" then if getElementModel(theVehicle) == 522 then setPedCanBeKnockedOffBike(source, false) else setPedCanBeKnockedOffBike(source, true) end end end) Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 ما اشتغل كل الدبابات ما يقع منهم بس خلاص انسى بخليهم للكل Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 ادري بس انت جرب اول شي شغل المود وسوي ريكونكت واركب دراجه غير النرج واصطدم جدار راح يقع لكن بس تركب النرج وتصدم جدار ما راح يقع وبعدين ارجع اخذ اي دراجه راح تبطل تقع جرب بس Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 ممكن اعرف وش كل وحدة متى اقدر احطها لانه محتار فيهم localPlayer source root player Link to comment
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 addEventHandler("onClientPlayerVehicleEnter", root, function(theVehicle) if getElementModel(theVehicle) == 522 then setPedCanBeKnockedOffBike(source, false) else setPedCanBeKnockedOffBike(source, true) end end) جرب كذا صار لدباب واحد Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 ما ضبط ممكن اعرف وش كل وحدة متى اقدر احطها لانه محتار فيهم localPlayer source root player Link to comment
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 اكتب في اف ٨ debugscript 3 وشوف وش يطلعلك وانسخه هنا Link to comment
Mars2 Posted October 10, 2015 Author Share Posted October 10, 2015 ما يطلع اخطاء خلاص ممكن تشرح لي الي حطيتهم؟؟ Link to comment
xBeSoOo Posted October 10, 2015 Share Posted October 10, 2015 Localplayer مثل source تقريبا بس لوكال بلاير تستخدم اكثر شي في الكلينت وسورس تستخدم اكثر شي في السيرفر Root مدري بالضبط وش هي Player يعني لاعب Link to comment
Rockyz Posted October 10, 2015 Share Posted October 10, 2015 (edited) Root = يجيب جميع الالمنتات وهو اختصار getRootElement Source = للاعب الي دخل او ضغط او الي سوا الحدث يعني نفس addEventHandler ( "onPlayerJoin", root, function ( ) kickPlayer (source,"Dont Join Again LOL") end ) طبعا هذا فقط مثال لا اكثر Edited October 10, 2015 by Guest 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