Stranger
Members-
Posts
710 -
Joined
-
Last visited
Everything posted by Stranger
-
مشكور على المعلومه لبى قلبك طيب الاول يربط طيب هذي تجيبه كيف يعني ؟؟ getElementParent
-
local marker = createMarker( x, y, z, "cylinder", 1.5, 150, 0, 0 ) addEventHandler ( "onMarkerHit", marker, function ( player ) if ( getElementType ( player ) == "player" ) and not ( isPedInVehicle ( player ) ) then setElementPosition ( player, x, y, z ) end end, false ) endبعد الـ false يقصد إنه يضيف لأنه هو معرف الماركر بالحدث مب مسويها بشرط addEventHandler: Required Arguments eventName: The name of the event you want to attach the handler function to. attachedTo: The element you wish to attach the handler to. The handler will only be called when the event it is attached to is triggered for this element, or one of its children. Often, this can be the root element (meaning the handler will be called when the event is triggered for any element). handlerFunction: The handler function you wish to call when the event is triggered. This function will be passed all of the event's parameters as arguments, but it isn't required that it takes all of them. Optional Arguments getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this) اها مشكور على المعلومه
-
ماشاءالله واضح v لا تزعل بس مزح بس يبي لها فهم مو بس انقليزي لغه +1
-
local marker = createMarker( x,y,z,"cylinder",1.5, 150, 0, 0 ) addEventHandler ("onMarkerHit",marker, function ( player ) if ( getElementType ( player ) == ( "player" ) ) then setElementPosition ( player , x,y,z ) end end )
-
وعليكم السلام مافهمت وش قصدك مكتوب فيه لاكن كود النقل هذا هو onMarkerHit createMarker getElementType setElementPosition
-
وضبط The Best مشكور بس جربت طريقة
-
مشكور لبى قلبك ادري اني تعتبك بس فيه مشكله ثانيه اذا قربت من الماركر الكلام يختفي + اذا بعدت وتلف يمين ولا يسار يطلع ويختفي !!!
-
طيب انا سويت كذا ماضبط local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local marker = createMarker( 218.64996, 1920.15149, 16.6406, 'cylinder', 2, 0, 0, 0, 0 ); local marker2 = createMarker( 209.64996, 1920.15149, 16.6406, 'cylinder', 2, 0, 0, 0, 0 ); local marker3 = createMarker( 200.64996, 1920.15149, 16.6406, 'cylinder', 2, 0, 0, 0, 0 ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix( ); local x1, y1, z1 = getElementPosition ( marker ); local x2, y2, z2 = getElementPosition ( marker2 ); local x3, y3, z3 = getElementPosition ( marker3 ); local distance = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local distance3 = getDistanceBetweenPoints3D( x, y, z, x3, y3, z3 ); local Dis = distance,distance2,distance3 if Dis <= gMaxDistance then local x1_,y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ) local x2_,y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ) local x3_,y3_ = getScreenFromWorldPosition( x3, y3, z3 + 0.95, 0.06 ) if x1_ and y1_ and x2_ and y2_ and x3_ and y3_ then local scale = 1 / ( gScale * ( Dis / gMaxDistance ) ); local alpha = ( ( Dis - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); dxDrawText( "Cars", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); dxDrawText( "Cars", x3_, y3_, x3_, y3_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ][ 3 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ 1 ][ 2 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2 alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end
-
مشكور لبى قلبك طيب اذا ضفت ماركر ثاني اعدل في هذي ولا لا ؟ function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end
-
local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local marker = createMarker( 215.6, 1920.1, 17.6-1, 'cylinder', 2, 255, 0, 0, 170 ); local marker2 = createMarker( 209.6, 1920.1, 17.6-1, 'cylinder', 2, 255, 0, 0, 170 ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( marker ); local x2, y2, z2 = getElementPosition ( marker2 ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end نفس المشكله الكلام في ماركر واحد
-
يب الكود مو حقي مدري حق بلاوي ولا لا لقيت الكود بدون صاحب !! + يب انا حاطها 0 عشان يطلع الكلام بس Edit # local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local marker = createMarker( 218.6, 1920.1, 17.6-1, 'cylinder', 0, 0, 0, 0, 0 ); local marker2 = createMarker( 209.6, 1920.1, 17.6-1, 'cylinder', 0, 0, 0, 0, 0 ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( marker ); local x2, y2, z2 = getElementPosition ( marker2 ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); function math.evalCurve( curve, input ) if input < curve[ 1 ][ 1 ] then return curve[ 1 ][ 2 ]; end for idx = 2, #curve do if input < curve[ idx ][ 1 ] then local x1 = curve[ idx - 1 ][ 1 ]; local y1 = curve[ idx - 1 ][ 2 ]; local x2 = curve[ idx ][ 1 ]; local y2 = curve[ idx ][ 2 ]; local alpha = ( input - x1 ) / ( x2 - x1 ); return math.lerp( y1, y2, alpha ); end end return curve[ #curve ][ 2 ]; end function math.lerp( from, to, alpha ) return from + ( to-from ) * alpha; end كذا بيطلع الكلام في ماركر واحد بس
-
طيب عندي طلب ثاني ,, !! local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.3; local gAlphaDistance = 25; local gMaxDistance = 50; -- Max Distance local gTextAlpha = 120; local gTextSize = 1; local gAlphaDiff = gMaxDistance - gAlphaDistance; gScale = 1 / gScale * 800 / g_screenY; local gMaxScaleCurve = { { 0, 0 }, { 3, 3 }, { 13, 5 } }; local gTextScaleCurve = { { 0, 0.8 }, { 0.8, 1.2 }, { 99, 99 } }; local gTextAlphaCurve = { { 0, 0 }, { 25, 100 }, { 120, 190 }, { 255, 190 } }; local marker = createMarker( 218.6, 1920.1, 17.6-1, 'cylinder', 0, 0, 0, 0, 0 ); local marker2 = createMarker( 209.6, 1920.1, 17.6-1, 'cylinder', 0, 0, 0, 0, 0 ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( marker ); local x2, y2, z2 = getElementPosition ( marker2 ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance_2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); if distance_1 <= gMaxDistance then local x1_, y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ); if x1_ and y1_ then -- local scale = 1 / ( gScale * ( distance_1 / gMaxDistance ) ); local alpha = ( ( distance_1 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x1_, y1_, x1_, y1_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end elseif distance_2 <= gMaxDistance then local x2_, y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ); if x2_ and y2_ then local scale = 1 / ( gScale * ( distance_2 / gMaxDistance ) ); local alpha = ( ( distance_2 - gAlphaDistance ) / gAlphaDiff ); alpha = ( alpha < 0 ) and gTextAlpha or gTextAlpha - ( alpha * gTextAlpha ); scale = math.evalCurve( gMaxScaleCurve, scale ); local textscale = math.evalCurve( gTextScaleCurve, scale ); local textalpha = math.evalCurve( gTextAlphaCurve, alpha ); dxDrawText( "Cars", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true ); end end end ); وش الخطأ فيه
-
ادري انا حاط الكود ناقص + اللون يوم تختار سياره من اللوحه وتنزلها تشوف اللون احمر مثلا بس غيرك يشوفه لون ثاني كل ما تنزل سياره تشوفها لونها احمر انا ابيها كذا بس ما يشوفها غيرك واحد ثاني يشوفها لون ثاني مثلا اخضر اصفر كذا يعني كل مره يشوف لون ثاني بس الي نزلها يشوف احمر بس
-
السلام عليكم يا شباب الحين عندي مشكه في ذا الكود انه اذا اخترت سياره اللون ما يشوفه الا انا بس ابي ال setVehicleColor لكل من يختار سياره يجي اللون الي حاطه انا هو يجي لكل الناس بس ما يشوفه غيرهم ابيه عام local vehicles = {} addEventHandler("Vehiclee", root, function(model, state) if(state == "Cars")then if(isElement(vehicles client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil vehicles[ client ] = createVehicle(model, getElementPosition(client)) end warpPedIntoVehicle(client, vehicles[ client ]) elseif(state == "[Manster]")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil end x,y,z = getElementPosition(client) vehicles[ client ] = createVehicle(model,x,y-1,z) warpPedIntoVehicle(client, vehicles[ client ]) setVehicleColor(vehicles[ client ], 255, 0, 0 ) setVehiclePaintjob(vehicles[ client ], 0) end end end )
-
+ تحطها تحت كود النافذه
-
جرب --**************** -- By Manster .. --**************** addEvent("Vehiclee", true) Markers = { [1] = { 2852.69921875,1281,10.9 }, -- احداثيات الماركر [2] = { 2853,1275.69921875,10.9 }, -- احداثيات الماركر [3] = { 2852.5,1269.69921875,10.9 }, -- احداثيات الماركر [4] = { 2852,1263,10.9 }, -- احداثيات الماركر [5] = { 2851.599609375,1257.5,10.9 }, -- احداثيات الماركر } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 255, 255, 255, 250 ) end end ) addEventHandler("onMarkerHit", resourceRoot, function(hitElem) if(getElementType(hitElem) == "player")then if getElementData ( hitElem,'Group' ) ~= 'GHOST' then outputChatBox("#FF0000* #FFF000Only For #FF0000 .:[GHOST]:. #FFF000Group ", hitElem, 255, 255, 0, true) else if not(isPedInVehicle(hitElem))then triggerClientEvent(hitElem, "open", hitElem, "true") end end end end ) local vehicles = {} addEventHandler("Vehiclee", root, function(model, state) if(state == "Cars")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil vehicles[ client ] = createVehicle(model, getElementPosition(client)) end warpPedIntoVehicle(client, vehicles[ client ]) elseif(state == "[GHOST]")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil end vehicles[ client ] = createVehicle(model, getElementPosition(client)) warpPedIntoVehicle(client, vehicles[ client ]) setVehicleColor(vehicles[ client ], 14, 127, 0 ) -- هنا تلون السياره setVehiclePaintjob(vehicles[ client ], 2) -- هنا الباينت جوب الشكل ! end end ) addEventHandler("onPlayerQuit", root, function() if(vehicles[ source ])then destroyElement(vehicles[ source ]) vehicles[ source ] = nil end end ) تم + شكرا المقر تبرمج كله بفضلك :] العفو , في الخدمه !!
-
جرب --**************** -- By Manster .. --**************** addEvent("Vehiclee", true) Markers = { [1] = { 2852.69921875,1281,10.9 }, -- احداثيات الماركر [2] = { 2853,1275.69921875,10.9 }, -- احداثيات الماركر [3] = { 2852.5,1269.69921875,10.9 }, -- احداثيات الماركر [4] = { 2852,1263,10.9 }, -- احداثيات الماركر [5] = { 2851.599609375,1257.5,10.9 }, -- احداثيات الماركر } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 255, 255, 255, 250 ) end end ) addEventHandler("onMarkerHit", resourceRoot, function(hitElem) if(getElementType(hitElem) == "player")then if getElementData ( hitElem,'Group' ) ~= 'GHOST' then outputChatBox("#FF0000* #FFF000Only For #FF0000 .:[GHOST]:. #FFF000Group ", hitElem, 255, 255, 0, true) else if not(isPedInVehicle(hitElem))then triggerClientEvent(hitElem, "open", hitElem, "true") end end end end ) local vehicles = {} addEventHandler("Vehiclee", root, function(model, state) if(state == "Cars")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil vehicles[ client ] = createVehicle(model, getElementPosition(client)) end warpPedIntoVehicle(client, vehicles[ client ]) elseif(state == "[GHOST]")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil end vehicles[ client ] = createVehicle(model, getElementPosition(client)) warpPedIntoVehicle(client, vehicles[ client ]) setVehicleColor(vehicles[ client ], 14, 127, 0 ) -- هنا تلون السياره setVehiclePaintjob(vehicles[ client ], 2) -- هنا الباينت جوب الشكل ! end end ) addEventHandler("onPlayerQuit", root, function() if(vehicles[ source ])then destroyElement(vehicles[ source ]) vehicles[ source ] = nil end end )
-
هو مين قالك اني مبرمج!!!انا جاي اتعلم ض1 بس لسا بكير اتعلم باخد شي جاهز بخلص شغلي وبعدين اتعلم !! اوكي استخدم الكود هذا وبيلف لك السياره !! Server ! --**************** -- By Manster .. --**************** addEvent("Vehiclee", true) Markers = { [1] = { x,y,z }, -- احداثيات الماركر [2] = { x,y,z }, -- احداثيات الماركر [3] = { x,y,z }, -- احداثيات الماركر [4] = { x,y,z }, -- احداثيات الماركر [5] = { x,y,z }, -- احداثيات الماركر } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, TheMarkers in ipairs ( Markers ) do TheMarker = createMarker ( TheMarkers[1], TheMarkers[2], TheMarkers[3] - 1, "cylinder", 2, 255, 255, 255, 250 ) end end ) addEventHandler("onMarkerHit", resourceRoot, function(hitElem) if(getElementType(hitElem) == "player")then if getElementData ( hitElem,'Group' ) == 'Group Name' then outputChatBox("#FF0000* #FFF000Only For #FF0000 .:[Group Name]:. #FFF000Group ", hitElem, 255, 255, 0, true) else if not(isPedInVehicle(hitElem))then triggerClientEvent(hitElem, "open", hitElem, "true") end end end end ) local vehicles = {} addEventHandler("Vehiclee", root, function(model, state) if(state == "Cars")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil vehicles[ client ] = createVehicle(model, getElementPosition(client)) setVehicleColor( vehicles[ client ], 255, 0, 0 ) setVehiclePaintjob(vehicles[ client ], 0) end warpPedIntoVehicle(client, vehicles[ client ]) elseif(state == "[GHOST]")then if(isElement(vehicles[ client ]))then destroyElement(vehicles[ client ]) vehicles[ client ] = nil end vehicles[ client ] = createVehicle(model, getElementPosition(client)) setVehicleRotation ( vehicles[ client ], 0, 0, 90 ) setVehicleColor( vehicles[ client ], 255, 0, 0 ) -- ! هنا لو تبي تغير لون السياره setVehiclePaintjob(vehicles[ client ], 0) -- هنا الباينت جوب يعني الشكل ! warpPedIntoVehicle(client, vehicles[ client ]) end end ) addEventHandler("onPlayerQuit", root, function() if(vehicles[ source ])then destroyElement(vehicles[ source ]) vehicles[ source ] = nil end end )