hassan.k.s.a Posted October 11, 2012 Share Posted October 11, 2012 جرب ma = createMarker (x,y,z, "cylinder", 2, 255, 0, 255, 255 ) V = {} function M( thePlayer ) if V[thePlayer] then if isElement(V[thePlayer]) then destroyElement(V[thePlayer]) end end local x,y,z = getElementPosition(thePlayer) V[thePlayer] = createVehicle(411,x,y,z) warpPedIntoVehicle(source, V[thePlayer]) end addEventHandler( "onMarkerHit", ma, M ) Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 جرب الطريقة هذي vehicle = { } vehicle[source] = createVehicle ( ... ) if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end بس اجي على الماركر بوقف وما يصير شي يمكن انا وضعته غلط ... function g() setElementData(source,"xxx",tostring("Yes")) end addEventHandler("onPlayerJoin",root,g) ma = createMarker (1556.6724853516,-1606.4342041016, 12.3, "cylinder", 2, 255, 0, 255, 150 ) vehicle = { } function M( thePlayer ) get = getElementData(thePlayer,"xxx") if get == "Yes" then if not isPedInVehicle(thePlayer) then x,y,z = getElementPosition( thePlayer ) if getElementModel( thePlayer ) == 287 then vehicle[source] = createVehicle ( 596, x, y, z ) setVehicleColor(vehicle[source],27,54,160,255,255,255) warpPedIntoVehicle(thePlayer,vehicle[source]) if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end end end end end addEventHandler( "onMarkerHit", ma, M ) Link to comment
abu5lf Posted October 11, 2012 Share Posted October 11, 2012 مايحتاج الخرابيط حقت حسن vehicle = { } function M() if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end vehicle[source] = createVehicle ( 411, getElementPosition ( ... ) ) warpPedIntoVehicle ( ... ) end Link to comment
hassan.k.s.a Posted October 11, 2012 Share Posted October 11, 2012 جرب ma = createMarker (x,y,z, "cylinder", 2, 255, 0, 255, 255 ) V = {} function M( thePlayer ) if V[thePlayer] then if isElement(V[thePlayer]) then destroyElement(V[thePlayer]) end end local x,y,z = getElementPosition(thePlayer) V[thePlayer] = createVehicle(411,x,y,z) warpPedIntoVehicle(source, V[thePlayer]) end addEventHandler( "onMarkerHit", ma, M ) جرب هذا وقولي الخطأ اذا كان فيه خطأ Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 جرب الطريقة هذي vehicle = { } vehicle[source] = createVehicle ( ... ) if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end مشكووووور Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 طيب مثلا انا عملت كمان ماركر وانا بروح اخد سيارة من ماركر الاول ورحت اخد كمان سيارة من الماركر الثاني كيف بدي تختفي السيارة الي اختها من الماركر الاول ؟؟ اسف من كثر الطلبات هذه اخر طلب لاني بدي انهيه Link to comment
|Mr|-Talal07-| Posted October 11, 2012 Share Posted October 11, 2012 اضف الافنت على نفس الوظيفه بس غير الماركر الى الماركر الثاني و جرب Link to comment
abu5lf Posted October 11, 2012 Share Posted October 11, 2012 (edited) طيب مثلا انا عملت كمان ماركروانا بروح اخد سيارة من ماركر الاول ورحت اخد كمان سيارة من الماركر الثاني كيف بدي تختفي السيارة الي اختها من الماركر الاول ؟؟ اسف من كثر الطلبات هذه اخر طلب لاني بدي انهيه vehicle = {} local TableMarker = { { x = 0, y = 0, z = 0 }, { x = 10, y = 10, z = 10 } } for _, m in ipairs ( TableMarker ) do local marker = createMarker ( m.x, m.y, m.z ) addEventHandler ( 'onMarkerHit', marker, function ( ... ) if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end vehicle[source] = createVehicle ( 411, getElementPosition ( ... ) ) warpPedIntoVehicle ( ..., vehicle[source] ) end ) end جرب Edited October 12, 2012 by Guest Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 vehicle = {} local TableMarker = { { x = 1556.6724853516, y = -1606.4342041016, z = 12.3 }, { x = 1544.0750732422, y = -1609.6583241953, z = 12.3 } } addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for _, m in ipairs ( TableMarker ) do local marker = createMarker ( m.x, m.y, m.z ) end addEventHandler ( 'onMarkerHit', marker, onHit ) end ) function onHit (thePlayer ) if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end vehicle[source] = createVehicle ( 596, getElementPosition (x,y,z) ) warpPedIntoVehicle ( thePlayer,vehicle[source] ) end ما يصير شي ويعطيني WARNING >> AddEventHandler Link to comment
abu5lf Posted October 11, 2012 Share Posted October 11, 2012 جربته واشتغل شف ردي مرة ثانية وجرب Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 مو ظابط خلص انسه الموضوع Link to comment
RLP[Farouk] Posted October 11, 2012 Author Share Posted October 11, 2012 يب اشتغل بس تيجي السيارة وتختفي ع سريع Link to comment
TAPL Posted October 12, 2012 Share Posted October 12, 2012 vehicle = {} local TableMarker = { {x = 1556.6724853516, y = -1606.4342041016, z = 12.3}, {x = 1544.0750732422, y = -1609.6583241953, z = 12.3} } addEventHandler("onResourceStart", resourceRoot, function() for _, m in ipairs (TableMarker) do local marker = createMarker(m.x, m.y, m.z) addEventHandler("onMarkerHit", marker, onHit) end end) function onHit(player) if getElementType(player) == "player" and not isPedInVehicle(player) then if isElement(vehicle[player]) then destroyElement(vehicle[player]) end local x, y, z = getElementPosition(player, x, y, z) vehicle[player] = createVehicle(596, x, y, z) warpPedIntoVehicle(player, vehicle[player]) 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