iMr.3a[Z]eF Posted June 2, 2013 Share Posted June 2, 2013 السلآم عليكم ورحمة الله وبركاته اليوم صممت سيارة أملاك خاصة يعني حاب أحط دخان لو يوصل للسرعة 10 يسوي الأوبجكت ولو أقل من 10 يروح سويت هالكود ما نفع function D5( ) local vehicle = getPedOccupiedVehicle ( localPlayer ) if ( vehicle ) then local Speed = getElementSpeed ( vehicle,"kmh" ) if ( Speed >= 9 ) then local x,y,z = getElementPosition(vehicle) local d5an = createObject ( 2780, x,y,z-2, 0, 0, 0 ) attachElements (d5an,vehicle,0,-2,-1) end end end مع العلم أن السيارة هي اللي تحت local C = createVehicle ( 565, 1797.2901611328, 841.5078125, 10.643834114075 ) Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 function D5() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) d5an = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(d5an, vehicle, 0, -2, -1) else if isElement(d5an) then destroyElement(d5an) end end end end addEventHandler("onClientVehicleEnter", root, function(thePlayer, seat) if seat == 0 then updateTimer = setTimer(D5, 50, 0) end end ) addEventHandler("onClientVehicleExit", root, function(thePlayer, seat) if seat == 0 then if isTimer(updateTimer) then killTimer(updateTimer) updateTimer = nil end end end ) Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 متأكد من الأفنتات؟ addEventHandler("onClientVehicleEnter", root, ??? Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 انا حاطها كلها سيرفر مب كلينت * ما أشتغل كودك يا تيتي Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 كيف تحطها سيرفر وانت معرف ال بلاير لوكال هنا؟ local vehicle = getPedOccupiedVehicle ( localPlayer ) Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 لأن البرمجة لاحسة مخي قسم ,,, حاب مساعدة الله لا يهينك Link to comment
AboShanab Posted June 2, 2013 Share Posted June 2, 2013 Sever Side ! function D5() local vehicle = getPedOccupiedVehicle(source) if vehicle then local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) d5an = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(d5an, vehicle, 0, -2, -1) else if isElement(d5an) then destroyElement(d5an) end end end end addEventHandler("onVehicleEnter", root, function(thePlayer, seat) if seat == 0 then updateTimer = setTimer(D5, 50, 0) end end ) addEventHandler("onVehicleExit", root, function(thePlayer, seat) if seat == 0 then if isTimer(updateTimer) then killTimer(updateTimer) updateTimer = nil end end end ) Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 ^^^ برضه طيب أبيه بالبيند كي (bindKey) Link to comment
3NAD Posted June 2, 2013 Share Posted June 2, 2013 Sever Side ! function D5() local vehicle = getPedOccupiedVehicle(source) if vehicle then local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) d5an = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(d5an, vehicle, 0, -2, -1) else if isElement(d5an) then destroyElement(d5an) end end end end addEventHandler("onVehicleEnter", root, function(thePlayer, seat) if seat == 0 then updateTimer = setTimer(D5, 50, 0) end end ) وشو ؟ D5 العنصر في الوظيفة Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 local timers = {} local objects = {} function D5(vehicle, player) local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) objects[player] = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(d5an, vehicle, 0, -2, -1) else if isElement(objects[player]) then destroyElement(objects[player]) end end end addEventHandler("onVehicleEnter", root, function(thePlayer, seat) if seat == 0 then timers[thePlayer] = setTimer(D5, 1000, 0, source, thePlayer) end end ) addEventHandler("onVehicleExit", root, function(thePlayer, seat) if seat == 0 then if isTimer(timers[thePlayer]) then killTimer(timers[thePlayer]) timers[thePlayer] = nil destroyElement(objects[thePlayer]) objects[thePlayer] = nil end end end ) addEventHandler("onPlayerQuit", root, function() if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil destroyElement(objects[source]) objects[source] = nil end end ) Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 local timers = {} local objects = {} function D5(vehicle, player) local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) if isElement(objects[player]) then return end objects[player] = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(objects[player], vehicle, 0, -2, -1) else if isElement(objects[player]) then destroyElement(objects[player]) objects[player] = nil end end end addEventHandler("onVehicleEnter", root, function(thePlayer, seat) if seat == 0 then timers[thePlayer] = setTimer(D5, 1000, 0, source, thePlayer) end end ) addEventHandler("onVehicleExit", root, function(thePlayer, seat) if seat == 0 then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end end ) addEventHandler("onPlayerQuit", root, function() if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end ) جربتها واشتغلت ^ Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 بس ما أشتغل عندي أنا سويت createVehicle * Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 Private Please الكود خاص عشان ذذ Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 local timers = {} local objects = {} 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 outputDebugString("Not an element. Can't get speed") return false end end function D5(vehicle, player) local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) if isElement(objects[player]) then return end objects[player] = createObject(2780, x, y, z-2, 0, 0, 0) attachElements(objects[player], vehicle, 0, -2, -1) else if isElement(objects[player]) then destroyElement(objects[player]) objects[player] = nil end end end addEventHandler("onVehicleEnter", C, function(thePlayer, seat) if seat == 0 then timers[thePlayer] = setTimer(D5, 1000, 0, source, thePlayer) end end ) addEventHandler("onVehicleExit", C, function(thePlayer, seat) if seat == 0 then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end end ) addEventHandler("onPlayerQuit", root, function() if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end ) C جرب هذا وحطه تحت كود سيارة Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 2013 يا سلآم عليك يا تيتي ضبط جداً تسلم ذذ Link to comment
iMr.3a[Z]eF Posted June 2, 2013 Author Share Posted June 2, 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 outputDebugString("Not an element. Can't get speed") return false end end function D5(vehicle, player) local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) if isElement(objects[player]) then return end objects[player] = createObject(2780, x, y, z-2, 0, 0, 0) setElementAlpha ( objects[player], 0 ) attachElements(objects[player], vehicle, 0, -2, -1) else if isElement(objects[player]) then destroyElement(objects[player]) objects[player] = nil end end end addEventHandler("onVehicleEnter", C, function(thePlayer, seat) if seat == 0 then timers[thePlayer] = setTimer(D5, 1000, 0, source, thePlayer) end end ) addEventHandler("onVehicleExit", C, function(thePlayer, seat) if seat == 0 then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end end ) addEventHandler("onPlayerQuit", root, function() if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end end end ) Link to comment
Tete omar Posted June 2, 2013 Share Posted June 2, 2013 بدل هذي بالاخرى function D5(vehicle, player) local Speed = getElementSpeed(vehicle,"kmh") if Speed >= 10 then local x,y,z = getElementPosition(vehicle) if isElement(objects[player]) then return end objects[player] = createObject(2780, x, y, z-2, 0, 0, 0) setElementAlpha(objects[player], 0.0) attachElements(objects[player], vehicle, 0, -2, -1) else if isElement(objects[player]) then destroyElement(objects[player]) objects[player] = nil end end end 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