-
Posts
4,805 -
Joined
-
Last visited
-
Days Won
10
Everything posted by فاّرس
-
اطرح مشكلتك , viewforum.php?f=104
-
ممكن تقولي وش فايده هالاختصار السحري؟ guiShowing = true ووش معنى اول شيء ما حطيت اسم النافذه وثاني شيء حطيته ؟
-
?parent يعطيك العافيه تآبل, ولكن كيف بتعرف انه فيه
-
اظن القسم خطأ, وما باقي مود الا سووه -__-
-
مبروكك القيم مود, , + الغبار راح من اول ما اختفى يزن , ولكن اشوفه رجع
-
والله اني كنت اقول البرمجه صعبه , لين تعلمت صارت شيء تافه بالنسبه لي, ما اقول الا مثل ما قال باين , يا ليتني ركزت كان فجرت الدنيا بموداتي,
-
اول شيء تشوف وش تسوي الوظيفه, مثلا , getRandomPlayer This function returns a random player. يعني يجيب لك لاعب عشوائي, Syntax وبعدين تقرأ الـ player getRandomPlayer ( ) طبعا تلاحظ انه مافي ارقومنتات, () كذا يعني بسيط, وبعدين تشوف, Returns Returns a random player, false if the server is empty. وان ما فهمت تشوف المثال , local randomPlayer = getRandomPlayer ( ) outputChatBox ( getPlayerName ( randomPlayer ).." is now the fugitive!" ) مثلآ , givePlayerMoney This function adds money to a player's current money amount. To set absolute values, setPlayerMoney can be used. يعني انه يعطي اللاعب فلوس, ولازم تقرأ الملاحظات والتحذيرآت, Note: Using this function client side (not recommended) will not change a players money server side. يعني يقولك انه غير مستحسن انك تحط الكود كلنت لأنه بعطي اللاعب فلوس وهميه, Syntax وبعدين تشوف الـ bool givePlayerMoney ( player thePlayer, int amount ) بعدين تشوف الارقومنتات, Required Arguments thePlayer: the player you are giving the money to. يعني اللاعب الي تبيه تعطيه فلوس amount: a positive integer number specifying the amount of money to give to the player. يعني قيمه الفلوس Syntax وطبعا في كلنت وسيرفر, وبعضها تختلف في الـ bool givePlayerMoney ( int amount ) Required Arguments amount: a positive integer number specifying the amount of money to give to the player.
-
ابحث بالويكي , او ادخل على الصفحات حق الفنكشنات, صفحه فنكشنات كلنت , https://wiki.multitheftauto.com/wiki/Cl ... _Functions صفحه فنكشنات سيرفر, https://wiki.multitheftauto.com/wiki/Se ... _Functions صفحه الايفنتات , ( الاحداث)ـ كلنت , https://wiki.multitheftauto.com/wiki/Cl ... ing_Events سيرفر, https://wiki.multitheftauto.com/wiki/Se ... ing_Events وهنا فنكشنات الناس تسويها تفيدك اذا مافي فنكشنات بالويكي, https://wiki.multitheftauto.com/wiki/Useful_Functions
-
الحين احنا نعطيك فنكشن , مثلا , getPlayerName تضغط عليه يوديك للويكي , بتلقى string getPlayerName ( player thePlayer ) انزل تحت شوي , thePlayer: the Player that you want to get his name. يعني اللاعب الي تبي تجيب اسمه, وطبعا يكون على حسب الايفنت, مثلا ايفنت , onPlayerJoin لو تدخل عليه بتلقى مكتوب , The source of this event is the player who joined. يعني بيصير كذا, getPlayerName(source) ^ ولازم يكون داخل الايفنت عشان يتعرف على السورس, وبالنسبه للايفنت, onPlayerWasted لو تضغط عليه بتدخل وتشوف مثال ,
-
نعم مع اي تدخل ينقذ الوضع , لأن صراحه مأساه, لازم يتوقف هالشيء , ابرياء كل يوم يقتلون اطفال وشباب وكبار ,
-
ابحث عن الي تبيه هنآ , https://community.multitheftauto.com/
-
مدري وش المشكله, ولكن جرب كرر, addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix( ); local x1, y1, z1 = getElementPosition ( marker ); local distance = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); if distance <= gMaxDistance then local x1_,y1_ = getScreenFromWorldPosition( x1, y1, z1 + 0.95, 0.06 ) if x1_ and y1_ then local scale = 1 / ( gScale * ( distance / gMaxDistance ) ); local alpha = ( ( distance - 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 end end ); addEventHandler ( 'onClientRender', root, function ( ) local x, y, z = getCameraMatrix( ); local x2, y2, z2 = getElementPosition ( marker2 ); local distance2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); if distance2 <= gMaxDistance then local x2_,y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ) if x2_ and y2_ then local scale = 1 / ( gScale * ( distance2 / gMaxDistance ) ); local alpha = ( ( distance2 - 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 ); واذا احد يعرف بيفيدك إن شاء الله,
-
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 ]; 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 x1, y1, z1 = getElementPosition ( marker ); local x2, y2, z2 = getElementPosition ( marker2 ); local distance = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); وعشان ما اسوي اكثر من شرط , سويت كذا, local Dis = distance,distance2 وضفت , local x2_,y2_ = getScreenFromWorldPosition( x2, y2, z2 + 0.95, 0.06 ) وسويت التحقق مع الشرط الاساسي, if x1_ and y1_ and x2_ and y2_ then وتضيف dxDrawText, dxDrawText( "Cars", x2_, y2_, x2_, y2_, tocolor ( 255, 255, 255, textalpha ), textscale * gTextSize, "arial", "center", "bottom", false, false, false, true );
-
جرب , 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, 0); local marker2 = createMarker( 209.6, 1920.1, 17.6-1, 'cylinder', 2, 255, 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 = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ); local distance2 = getDistanceBetweenPoints3D( x, y, z, x2, y2, z2 ); local Dis = distance,distance2 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 ) if x1_ and y1_ and x2_ and y2_ 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 ); 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
-
Table = { {1, 'A'}, {2, 'b'}, {3, 'c'}, {4, 'd'} } local window = guiCreateWindow(327, 164, 216, 308, "window", false) guiWindowSetSizable(window, false) local grid = guiCreateGridList(9, 73, 197, 183, false, window) local Column = guiGridListAddColumn(grid, "id", 0.4) local Column2 = guiGridListAddColumn(grid, "#", 0.4) for k,v in ipairs( Table ) do local Row = guiGridListAddRow(grid) guiGridListSetItemText(grid,Row,Column, v[1], false, false ) guiGridListSetItemText(grid,Row,Column2, v[2], false, false ) end
-
اظن انه بيشتغل , اطرح كودك ,
-
مثآل, Table = { {1, 'A'}, {2, 'b'}, {3, 'c'}, {4, 'd'} } Grid = guiCreateGridList(9, 73, 197, 183, false) Column2 = guiGridListAddColumn(Grid, "#", 0.4) for k,v in ipairs( Table ) do local Row = guiGridListAddRow ( Grid ) guiGridListSetItemText( Grid,Row,Column2, v[2], false, false ) end
-
v[1] كذا بيكتب القيمه الاولى , بالنسبه لكل قيمه بعمود, هذا مثال , local Column = guiGridListAddColumn( Grid, 'Vehicle', 0.2 ) local Column2 = guiGridListAddColumn( Grid, '#', 1 ) for k,v in ipairs( vehicle ) do local Row = guiGridListAddRow( Grid ) guiGridListSetItemText( Grid,Row,Column, v[1], false, false ) guiGridListSetItemText( Grid,Row,Column2, v[2], false, false ) end
-
Column = تقدر تسويه بـ , guiGridListAddColumn انت تحط بالكود الكولومن الي تبي يكون الكلام فيه , Grid = اسم الجريد حقك, v[1] = انا جبت قيمه الجدول وحددت انه يكتب بالجريد ليست القيمه الاولى , مثلا لو تبي القيمه الثانيه , v[2], بالنسبه لـ false , لو قريت الويكي بتعرف , section: Determines if the item is a section number: Tells whether the text item is a number value or not (used for sorting) Row = تقدر تسويه بـ , guiGridListAddRow وهذا يضيف سطر للجريد ليست
-
الماركر حجمه 0 خليه 2 او اكثر وهو اصلا ما بيكون ظاهر , 0 = Alpha لأن
-
اذا ما عدلت كود بلاوي , فأن الخطأ في الماركرات حجمها 0 ما راح تظهر اظن , Alpha = 0 ما بيظهر اظن,