momar5700 Posted October 21, 2015 Share Posted October 21, 2015 (edited) كلنت local g_screenX, g_screenY = guiGetScreenSize(); local gScale = 0.2; local gAlphaDistance = 80; local gMaxDistance = 80; -- Max Distance local gTextAlpha = 150; local gTextSize = 2.5; 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( -3275.2436523438,-3007.7487792969,5, 'corona', 1.0, 0, 0, 0, 0 ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix(); local x1, y1, z1 = getElementPosition ( Marker ); local distance_1 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); 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( "لـ أخذ موتر #", x1_, y1_, x1_, y1_, tocolor ( 0, 0, 255, textalpha ), textscale * gTextSize, "default-bold", "center", "bottom", 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 سيرفر veh = {} marker = {} Data = { {-3275.2436523438,-3007.7487792969,5, "corona", 4, 255, 0, 0, 155 }, } setElementData(marker,'text3D','لـ أخذ موتر #') function giveVehicle ( element ) if ( getElementType ( element ) == "player" and not isPedInVehicle ( element ) ) then if ( isElement ( veh [ element ] ) ) then destroyElement ( veh [ element ] ) end veh [ element ] = nil local x, y, z = getElementPosition( element ) veh [ element ] = createVehicle ( 411, x , y + 3 , z + 3 ) setVehicleDamageProof ( veh [ element ] , true ) warpPedIntoVehicle( element ,veh [ element ] ) addVehicleUpgrade( veh [ element ] , 1010) addVehicleUpgrade( veh [ element ] , 1087) outputChatBox ( "# [ تم أعطائك موتر مع : نيترو + هيدروليك ]", element, 255, 0, 0, true ) outputChatBox ( "# [ ( Ctrl ) لـ تشغيل/ايقاف النيترو اضغط ]", element, 255, 255, 0, true ) outputChatBox ( "# [ ( Caps Lock ) لـ تشغيل/ايقاف الهيدروليك اضغط ]", element, 255, 0, 255, true ) end end addEventHandler("onResourceStart",resourceRoot, function () for k,v in ipairs ( Data ) do marker [ k ] = createMarker ( v [ 1 ] , v [ 2 ] , v [ 3 ] - 1 , v [ 4 ] , v [ 5 ] , v [ 6 ], v [ 7 ] , v [ 8 ] , v [ 9 ] ) addEventHandler("onMarkerHit", marker [ k ] , giveVehicle ) end end) addEventHandler("onPlayerQuit",root,function() if ( isElement ( veh [ source ] ) ) then destroyElement ( veh [ source ] ) end veh [ source ] = nil end) addEventHandler( "onVehicleExplode", root, function( ) setTimer( destroyElement, 2000, 1, source ) end ) addEventHandler( "onPlayerQuit", root, function( ) if Vehicles[source] then destroyElement( Vehicles[source] ) end end ) هي كل الابية انه كل سيارات تيجي يعني زي الي في الوزارة لما تدخل الماركت يعطيك سيارة ولما تدخل مره ثانيه يعطيك سيارة تانيه يعني يكون فيها كل سيارات هادا هو الي ابيه بس Edited October 23, 2015 by Guest Link to comment
3NAD Posted October 21, 2015 Share Posted October 21, 2015 قصدك سيارة عشوائية ؟؟ استخدم math.random ( from_ID, to_ID ) math.random ( 400, 600 ) -- من آي دي 400 إلى آي دي 600 في سطر 13 ^ Link to comment
momar5700 Posted October 21, 2015 Author Share Posted October 21, 2015 ايوه سيارات عشوئية بس ممكن تركبها انت لو سمحت ____________________________________________________________________________________________________ كيف احطها veh [ element ] = createVehicle ( 411, x , y + 3 , z + 3 ) Link to comment
Rockyz Posted October 21, 2015 Share Posted October 21, 2015 veh = {} marker = {} Data = { {-3275.2436523438,-3007.7487792969,5, "corona", 4, 255, 0, 0, 155 }, } setElementData(marker,'text3D','لـ أخذ موتر #') function giveVehicle ( element ) if ( getElementType ( element ) == "player" and not isPedInVehicle ( element ) ) then if ( isElement ( veh [ element ] ) ) then destroyElement ( veh [ element ] ) end veh [ element ] = nil local x, y, z = getElementPosition( element ) veh [ element ] = createVehicle ( math.random ( 400, 600 ), x , y + 3 , z + 3 ) setVehicleDamageProof ( veh [ element ] , true ) warpPedIntoVehicle( element ,veh [ element ] ) addVehicleUpgrade( veh [ element ] , 1010) addVehicleUpgrade( veh [ element ] , 1087) outputChatBox ( "# [ تم أعطائك موتر مع : نيترو + هيدروليك ]", element, 255, 0, 0, true ) outputChatBox ( "# [ ( Ctrl ) لـ تشغيل/ايقاف النيترو اضغط ]", element, 255, 255, 0, true ) outputChatBox ( "# [ ( Caps Lock ) لـ تشغيل/ايقاف الهيدروليك اضغط ]", element, 255, 0, 255, true ) end end addEventHandler("onResourceStart",resourceRoot, function () for k,v in ipairs ( Data ) do marker [ k ] = createMarker ( v [ 1 ] , v [ 2 ] , v [ 3 ] - 1 , v [ 4 ] , v [ 5 ] , v [ 6 ], v [ 7 ] , v [ 8 ] , v [ 9 ] ) addEventHandler("onMarkerHit", marker [ k ] , giveVehicle ) end end) addEventHandler("onPlayerQuit",root,function() if ( isElement ( veh [ source ] ) ) then destroyElement ( veh [ source ] ) end veh [ source ] = nil end) addEventHandler( "onVehicleExplode", root, function( ) setTimer( destroyElement, 2000, 1, source ) end ) addEventHandler( "onPlayerQuit", root, function( ) if Vehicles[source] then destroyElement( Vehicles[source] ) end end ) Link to comment
momar5700 Posted October 22, 2015 Author Share Posted October 22, 2015 veh = {} marker = {} Data = { {-3275.2436523438,-3007.7487792969,5, "corona", 4, 255, 0, 0, 155 }, } setElementData(marker,'text3D','لـ أخذ موتر #') function giveVehicle ( element ) if ( getElementType ( element ) == "player" and not isPedInVehicle ( element ) ) then if ( isElement ( veh [ element ] ) ) then destroyElement ( veh [ element ] ) end veh [ element ] = nil local x, y, z = getElementPosition( element ) veh [ element ] = createVehicle ( math.random ( 400, 600 ), x , y + 3 , z + 3 ) setVehicleDamageProof ( veh [ element ] , true ) warpPedIntoVehicle( element ,veh [ element ] ) addVehicleUpgrade( veh [ element ] , 1010) addVehicleUpgrade( veh [ element ] , 1087) outputChatBox ( "# [ تم أعطائك موتر مع : نيترو + هيدروليك ]", element, 255, 0, 0, true ) outputChatBox ( "# [ ( Ctrl ) لـ تشغيل/ايقاف النيترو اضغط ]", element, 255, 255, 0, true ) outputChatBox ( "# [ ( Caps Lock ) لـ تشغيل/ايقاف الهيدروليك اضغط ]", element, 255, 0, 255, true ) end end addEventHandler("onResourceStart",resourceRoot, function () for k,v in ipairs ( Data ) do marker [ k ] = createMarker ( v [ 1 ] , v [ 2 ] , v [ 3 ] - 1 , v [ 4 ] , v [ 5 ] , v [ 6 ], v [ 7 ] , v [ 8 ] , v [ 9 ] ) addEventHandler("onMarkerHit", marker [ k ] , giveVehicle ) end end) addEventHandler("onPlayerQuit",root,function() if ( isElement ( veh [ source ] ) ) then destroyElement ( veh [ source ] ) end veh [ source ] = nil end) addEventHandler( "onVehicleExplode", root, function( ) setTimer( destroyElement, 2000, 1, source ) end ) addEventHandler( "onPlayerQuit", root, function( ) if Vehicles[source] then destroyElement( Vehicles[source] ) end end ) بس في شيء واححد باقي انا ابية لما تيجي تغير سيارة تغيرة انت وراكب لانة علشان اجي للاحمر لازم يكون مو معي سياراة انا مابية كدا ابي يكون معي سيارة فهمت Link to comment
momar5700 Posted October 22, 2015 Author Share Posted October 22, 2015 خلاص سويته اصلا انتم مالكم فايدة طلبي بسيد بس الحمدالله سويته Link to comment
#|_oskar_|# Posted October 22, 2015 Share Posted October 22, 2015 خلاص سويته اصلا انتم مالكم فايدة طلبي بسيد بس الحمدالله سويته اذا اللي يساعدوك مالهم فايده فيد نفسك بنفسك ولا تطرح اكوادك للمساعده Link to comment
momar5700 Posted October 22, 2015 Author Share Posted October 22, 2015 خلا تم حل قفل الموضوع _.............................................................................ٍس 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