yazan Posted February 12, 2013 Posted February 12, 2013 سلام عليكم ودي كود لو تسرع اكثر من 50يطلع صوت متل تحذير يلي يكون متل تنتن يلي ما فهم طلبي بوضح له اكثر سبحان الله ---------------------------------- LUA 56%
3NAD Posted February 12, 2013 Posted February 12, 2013 أضف ذا أول الملف function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end وبعدها تطبق عليه .. مثال addCommandHandler ( "checkSpeed", function ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) if theSpeed > 120 then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) else outputChatBox ( "* Your Speed Is ["..theSpeed.." km/h]", thePlayer, 0, 255, 0, true ) end end end )
yazan Posted February 12, 2013 Author Posted February 12, 2013 وين الصوت بل موضع ؟؟؟ سبحان الله ---------------------------------- LUA 56%
3NAD Posted February 12, 2013 Posted February 12, 2013 انا ما بسوي لك الكود اللي تبيه اعتمد على نفسكـ .. playSound
yazan Posted February 12, 2013 Author Posted February 12, 2013 لا انا ما قلت ودي تجهز الكود كامل انا بعمله و بطرح لو فيه اخطاء لكن شفت كودك ما فيه اكود اصوت و مفكر انك مجهز كود سبحان الله ---------------------------------- LUA 56%
yazan Posted February 12, 2013 Author Posted February 12, 2013 يسير كذا لكن ما ودي هو يضيف في اف 8 ودي تلقائي بدل addCommandHandler ( "checkSpeed", لحله addCommandHandler ( "checkSpeed", functionfunction ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) if theSpeed > 120 then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) else outputChatBox ( "* Your Speed Is ["..theSpeed.." km/h]", thePlayer, 0, 255, 0, true ) end function wasted (killer, weapon, bodypart) local sound = playSound("sounds/yazan.mp3") setSoundVolume(sound, 0.5) end end ) سبحان الله ---------------------------------- LUA 56%
PaiN^ Posted February 12, 2013 Posted February 12, 2013 الكود فيه أغلاط حاول مرة ثانيية وانا بحاول اسويه لك " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
PaiN^ Posted February 12, 2013 Posted February 12, 2013 -- Client !! addEvent( "onHighSpeed", true ) addEventHandler( "onHighSpeed", root, function ( ) if ( getElementType ( source ) == "player" ) and ( isPedInVehicle ( source ) ) then local Vehicle = getPedOccupiedVehicle ( source ) local Speed = getElementVelocity ( Vehicle ) if ( Speed >= 100 ) then playSound ( "Sound.mp3", true ) else cancelEvent() end end end ) حاس إن فيه أغلاط بس إن شاء الله يشتغل " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
iPrestege Posted February 12, 2013 Posted February 12, 2013 -- Client !! addEvent( "onHighSpeed", true ) addEventHandler( "onHighSpeed", root, function ( ) if ( getElementType ( source ) == "player" ) and ( isPedInVehicle ( source ) ) then local Vehicle = getPedOccupiedVehicle ( source ) local Speed = getElementVelocity ( Vehicle ) if ( Speed >= 100 ) then playSound ( "Sound.mp3", true ) else cancelEvent() end end end ) حاس إن فيه أغلاط بس إن شاء الله يشتغل It has no sense .
PaiN^ Posted February 12, 2013 Posted February 12, 2013 -- Client !! addEvent( "onHighSpeed", true ) addEventHandler( "onHighSpeed", root, function ( ) if ( getElementType ( source ) == "player" ) and ( isPedInVehicle ( source ) ) then local Vehicle = getPedOccupiedVehicle ( source ) local Speed = getElementVelocity ( Vehicle ) if ( Speed >= 100 ) then playSound ( "Sound.mp3", true ) else cancelEvent() end end end ) حاس إن فيه أغلاط بس إن شاء الله يشتغل It has no sense . Well, Can you fix it please " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
yazan Posted February 12, 2013 Author Posted February 12, 2013 مثل ما قلك اخوي برستيج ما له معنا يعني هذى ما يطلع سرعه لزمه +ما له وقت محدد مشان يسير حدث سبحان الله ---------------------------------- LUA 56%
yazan Posted February 12, 2013 Author Posted February 12, 2013 addEvent( "onHighSpeed", true ) addEventHandler( "onHighSpeed", root, function ( ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) if theSpeed > 120 then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) else outputChatBox ( "* Your Speed Is ["..theSpeed.." km/h]", thePlayer, 0, 255, 0, true ) if ( Speed >= 100 ) then playSound ( "Sound.mp3", true ) else cancelEvent() end end end ) سبحان الله ---------------------------------- LUA 56%
yazan Posted February 12, 2013 Author Posted February 12, 2013 هذى الكود مزجت اكثر من واحد يعني حق تحقق من سرع و صوت و كود عناد يلي يطلع كم بل شات سبحان الله ---------------------------------- LUA 56%
PaiN^ Posted February 12, 2013 Posted February 12, 2013 مافي فنكشن اسمه getElementSpeed -_-" " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
iPrestege Posted February 12, 2013 Posted February 12, 2013 أضف ذا أول الملف function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end وبعدها تطبق عليه ..
yazan Posted February 12, 2013 Author Posted February 12, 2013 وين المسعدات شباب حولنا فيه سبحان الله ---------------------------------- LUA 56%
iMr.Dawix~# Posted February 12, 2013 Posted February 12, 2013 function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end addEventHandler ( "onVehicleStartEnter", getRootElement(), function ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) local speed = 120 --بدله للسرعه الي تبيها if theSpeed > speed then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) playSound ("speed.mp3") end end end ) My E-mails: [ [email protected] ],[ [email protected] ],[ [email protected] ] " Manners Maketh Man " " الأخلاق تصنع الرجل " ░░░░░███████ ]▄▄▄▄▄▄▄▄ BooM ! ▂▄▅█████████▅▄▃▂ ███████████████████]. ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤
iPrestege Posted February 12, 2013 Posted February 12, 2013 function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end addEventHandler ( "onVehicleStartEnter", getRootElement(), function ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) local speed = 120 --بدله للسرعه الي تبيها if theSpeed > speed then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) playSound ("speed.mp3") end end end ) onVehicleStartEnter -- Server PlaySound -- Client
iMr.Dawix~# Posted February 12, 2013 Posted February 12, 2013 function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end addEventHandler ( "onVehicleStartEnter", getRootElement(), function ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) local speed = 120 --بدله للسرعه الي تبيها if theSpeed > speed then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) playSound ("speed.mp3") end end end ) onVehicleStartEnter -- Server PlaySound -- Client سوه انت ترايقر اكره شيء في عمري الترايقر My E-mails: [ [email protected] ],[ [email protected] ],[ [email protected] ] " Manners Maketh Man " " الأخلاق تصنع الرجل " ░░░░░███████ ]▄▄▄▄▄▄▄▄ BooM ! ▂▄▅█████████▅▄▃▂ ███████████████████]. ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤
yazan Posted February 12, 2013 Author Posted February 12, 2013 فعلن اخوي وضيفه صوت كلنت لكن ما اعرف ادمج كلنت و سيرفر !!! سبحان الله ---------------------------------- LUA 56%
yazan Posted February 12, 2013 Author Posted February 12, 2013 هذى كلنت صحيح local sound = playSound("sounds/wasted.mp3") setSoundVolume(sound, 0.7) end addEventHandler ( "onVehicleStartEnter", getRootElement(), سبحان الله ---------------------------------- LUA 56%
PaiN^ Posted February 12, 2013 Posted February 12, 2013 "onVehicleStartEnter" server side only -_-" " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
yazan Posted February 12, 2013 Author Posted February 12, 2013 يب مشكور للتنبيه المشكله منه سبحان الله ---------------------------------- LUA 56%
yazan Posted February 12, 2013 Author Posted February 12, 2013 شباب صحوحون الكود ما عليكم امر function getElementSpeed ( element, unit ) if unit == nil then unit = 0 end if isElement ( element ) then local x,y,z = getElementVelocity(element) if ( unit == "mph" or unit == 1 or unit == "1" ) then return ( x^2 + y^2 + z^2 ) ^ 0.5 * 100 else return ( x^2 + y^2 + z^2 ) ^ 0.5 * 1.61 * 100 end else return false end end addEventHandler ( "onVehicleStartEnter", getRootElement(), functionfunction ( thePlayer ) if isPedInVehicle ( thePlayer ) then local theVehicle = getPedOccupiedVehicle ( thePlayer ) local theSpeed = getElementSpeed ( theVehicle, "kmh" ) local speed = 120 --بدله للسرعه الي تبيها if theSpeed > speed then outputChatBox ( "* Your Speed Is Too High ["..theSpeed.." km/h]", thePlayer, 255, 255, 0, true ) playSound ("speed.mp3") end end end ) مشكلته في تشغل صوت امر تشغيل كلنت و انا ما اعرف ادمج كلنت و سيرفر سبحان الله ---------------------------------- LUA 56%
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