Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 14/09/17 in all areas

  1. @Rakan# 'onPlayerDamage' مأيتكنسل إستخدم 'onClientPlayerDamage'
    2 points
  2. بسم الله الرحمن الرحيم سلام عليكم ورحمة الله وبركاته ,, حبيت اطرح شرح executeSQLQuery مفصل وكامل ان شاء الله . لكثرة الاعضاء الغير فاهمين له او الجاهلين له بسم الله نبدأ .. executeSQLQuery = عبارة عن قاعدة في سيرفرك dbConnect = عبارة عن قاعدة متصلة بالخادم او بالملف اولاً بننشئ كود الاتصال لو كنت بتستعمل dbFunctions test_db = dbConnect( "sqlite", "file.db" ) -- عبر ملف test_db = dbConnect( "mysql", "dbname=frank;host=1.2.3.4", "username", "password", "share=1" ) -- عن طريق الاتصال بالخادم .: ) فالنفترض انه عندنا القاعدة بهذا الشكل : { } فاضي صحيح ؟ طيب عشان ننشئ تيبل وندرج فيه المعلومات , بنحتاج نكتب هالكود : local result1 = executeSQLQuery ( "CREATE TABLE IF NOT EXISTS players (name TEXT, money TEXT, health TEXT)" ) local qh = dbQuery( test_db, "CREATE TABLE IF NOT EXISTS players (name TEXT, money TEXT, health TEXT)" ) -- نسوي الأمر local result2 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result1 and result2 ) then print ( "Success to create tables" ) -- نكتب في الديبق نجاح في انشاء الجداول end -- CREATE TABLE IF NOT EXISTS players (name TEXT, money TEXT, health TEXT) -- الترجمة : -- players اصنع جدول اذا ماكان فيه جدول بأسم -- والأعمدة هي : -- name, money, health بيطلع الناتج في القاعدة ~> { players = { } } ^ الجدول حق players فاضي نبي نضيف عليه قيمة مثلا .. local result31 = executeSQLQuery ( "INSERT INTO players(name,money,health) VALUES(?,?,?)", 'wifi','1000','100' ) local qh2 = dbQuery( test_db, "INSERT INTO players(name,money,health) VALUES(?,?,?)", 'wifi','1000','100' ) -- نسوي الأمر local result41 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result31 and result41 ) then print ( "Success to insert values" ) -- نكتب في الديبق نجاح في ادخال القيم end -- INSERT INTO players(name,money,health) VALUES(?,?,?) -- الترجمة : -- أدخال الى player -- والأعمدة هي : -- name, money, health -- والقيم : -- ?,?,? == 'wifi', '1000', '100' ملاحظة مهمة جداً : عند وضع سهم داخل الأمر او اي عملية SQL استبداله بالارقمنت خارج العملية كمثال : ("?,?",'wifi','1000') -- الاستفهام الاول بيستبدل بوايفاي -- والاستفاهم الثاني بيستبدل برقم ألف ("?,'1000'",'wifi') -- الاستفهام الاول بيستبدل بوايفاي ^ أتمنى تكون وضحت : بيطلع الناتج في القاعدة ~> { players = { { name='wifi', money='1000', health='100' } } } لو نبي نضيف قيمة ثانية بأسم نصور مثلاً وجا بروس قال انا الي ابي اصير القيمة وتضاربو وبعدين صار بروس القيمة ونصور راح .. كذا نسوي : local result3 = executeSQLQuery ( "INSERT INTO players(name,money,health) VALUES(?,?,?)", 'BrosS','-1000','10' ) local qh3 = dbQuery( test_db, "INSERT INTO players(name,money,health) VALUES(?,?,?)", 'BrosS','-1000','10' ) -- نسوي الأمر local result4 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result3 and result4 ) then print ( "Success to insert values" ) -- نكتب في الديبق نجاح في ادخال القيم end -- INSERT INTO players(name,money,health) VALUES(?,?,?) -- الترجمة : -- أدخال الى player -- والأعمدة هي : -- name, money, health -- والقيم : -- ?,?,? == 'BrosS', '-1000', '10' بيطلع الناتج في القاعدة ~> { players = { { name='wifi', money='1000', health='100' }, { name='BrosS', money='-1000', health='10' }, } } طيب لو نبي نجيب فلوس واي فاي كيف ؟ بهذي الطريقة : local result5 = executeSQLQuery ( "SELECT money FROM players WHERE name=?", 'wifi' ) local qh4 = dbQuery( test_db, "SELECT money FROM players WHERE name=?", 'wifi' ) -- نسوي الأمر local result6 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result5 and result6 ) then print ( "Success to select values" ) -- نكتب في الديبق نجاح في تحديد القيم print ( result5, result6 ) -- راح يطبع لنا فلوس واي فاي -- Result : -- 1000 end -- SELECT money FROM players WHERE name=? -- الترجمة : -- تحديد عامود money -- من جدول players -- اين القيمة المطابقة في عامود name -- والقيم : -- ? = 'wifi' شكل التحديد في القاعدة ~> -- > = التحديد -- ? = أين -- == = يطابق { >players = { { ?name=='wifi', >money='1000', health='100' }, { name='BrosS', money='-1000', health='10' }, } } -- توضيح اكثر { >players = { -- نحدد التيبل الي نريده { ?name='wifi', >money='1000', health='100' }, -- ? نحدد القيمة الي نريدها< + الي نبحث عنها { name='BrosS', money='-1000', health='10' }, } } مثال اخر لو نبي نجيب هيلث بروس : local result7 = executeSQLQuery ( "SELECT health FROM players WHERE name=?", 'BrosS' ) local qh5 = dbQuery( test_db, "SELECT health FROM players WHERE name=?", 'BrosS' ) -- نسوي الأمر local result8 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result7 and result8 ) then print ( "Success to select values" ) -- نكتب في الديبق نجاح في تحديد القيم print ( result5, result6 ) -- راح يطبع لنا دم بروس -- Result : -- 10 end -- SELECT money FROM players WHERE name=? -- الترجمة : -- تحديد عامود money -- من جدول players -- اين القيمة المطابقة في عامود name -- والقيم : -- ? = 'BrosS' الآن لو نبي نعدل على فلوس واي فاي او هلث بروس شلون ؟ بهذه الطريقة . : local result9 = executeSQLQuery ( "UPDATE players SET health='5' WHERE name=?", 'BrosS' ) local qh6 = dbQuery( test_db, "UPDATE players SET health='5' WHERE name=?", 'BrosS' ) -- نسوي الأمر local result10 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result9 and result10 ) then print ( "Success to edit values" ) -- نكتب نجاح في تعديل القيم end -- UPDATE players SET health='5' WHERE name=? -- الترجمة : -- تحديث جدول player -- تحديد عامود health='القيمة الجديدة' -- اين القيمة المطابقة في عامود name -- والقيم : -- ? = 'BrosS' النتيجة او الطريقة في القاعدة ~> -- > = التحديد -- ? = أين -- ! = تعديل -- == = يطابق { >players = { { name='wifi', money='1000', health='100' }, { ?name=='BrosS', money='-1000', !health='10' }, } } -- Result : { players = { { name='wifi', money='1000', health='100' }, { name='BrosS', money='-1000', health='5' }, } } ثم بروس صار دمه مره قليل وراح بروس المستشفى وعالجه نصور لكن للأسف مات ونبي نحذفه من الجدول شلون ؟ local result11 = executeSQLQuery ( "DELETE FROM players WHERE name=?", 'BrosS' ) local qh7 = dbQuery( test_db, "DELETE FROM players WHERE name=?", 'BrosS' ) -- نسوي الأمر local result12 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result11 and result12 ) then print ( "Success to delete values" ) -- نكتب نجاح في حذف قيمة end -- DELETE FROM players WHERE name=? -- الترجمة : -- حذف من players -- اين القيمة المطابقة في عامود name -- والقيم : -- ? = 'BrosS' النتيجة او الطريقة في القاعدة ~> -- > = التحديد -- ? = أين -- ! = حذف -- == = يطابق { >players = { { name='wifi', money='1000', health='100' }, !{ ?name=='BrosS', money='-1000', health='5' }, } } -- Result : { players = { { name='wifi', money='1000', health='100' }, } } ثم فجأه واي فاي حزن لأن بروس مات وقال بيستقيل , وصار مافي اي قيمة باقية شلون نحذف الجدول ؟ local result7 = executeSQLQuery ( "DROP TABLE players" ) local qh8 = dbQuery( test_db, "DROP TABLE players" ) -- نسوي الأمر local result8 = dbPoll( qh, -1 ) -- ونطلع النتيجة if ( result7 and result8 ) then print ( "Success to drop table" ) -- نكتب نجاح في حذف الجدول end -- DROP TABLE players -- الترجمة : -- حذف جدول players تنبيه مهم : الترجمة ليست حرفية انما بالمعنى فقط او للتوضيح بنسبة لغة البرمجة المشاركون في المسرحية : @!#NssoR_) @#BrosS @iMr.WiFi..! من فضلكم تصفيق حار من اجلهم .. اعتذر اذا اشركت احدكم وماكان وده يشارك .. او العكس " الشرح مقدم على يد : واي فاي الحكمة من القصة لا تسلب حق غيرك لو كان في ابسط او اصغر الاشياء لأن بيجي شخص بيسلب حقك في اسوء او اكبر الاشياء وفي الختام اتمنى الشرح افادكم ولو قليل وتفهمون ان شاء الله وتقولون الله يرحمك ي بروس ?
    1 point
  3. السلام عليكم و رحمة الله و بركاته .. كيفكم شباب ان شاء الله تكونو بخير اليوم جايبلكم دورة تعتبر من اكمل الدورات الاساسية عن برمجة LUA الدورة كلها تطبيق بالفيديو ناقصها فقط فيديوهوين تقريبا هما شرح اللوب و GUI و تكون كملت اتمنى تستفيدو و تدعموني رابط القناة https://www.youtube.com/channel/UCfD0642L4lC3wzGPzqsJJIw رابط الدورة اتمنى متنسوش الدعم بلايك و شير و سبسكرايب و شكرا اسف الدرس الاول جودة مش عالية و ان شاء الله بيترفع بجودة اعلى
    1 point
  4. I can see nothing, i am using the dark theme for the forum, does it contain bug with attaching topics in posts?
    1 point
  5. not en ese caso sirve para contrariar guiGetVisble si la ventana es visible dara true y con el not sera un false entonces ara que el panel desaparesca , si guiGetVisble da false es por que no esta visible el panel entonces con el not se convierte en un true y el panel aparecera en conclusión el not te ayuda a resumir esto if guiGetVisible(ventanaGangs) == true then guiSetVisible(ventanaGangs, false) elseif guiGetVisible(ventanaGangs) == false then guiSetVisible(ventanaGangs, true) end a solo esto guiSetVisible(ventanaGangs, not guiGetVisible(ventanaGangs))
    1 point
  6. https://github.com/multitheftauto/mtasa-blue
    1 point
  7. السلام عليكم اخي اكوادك فيها اخطاء و هيا اولا انت مسوي لو اللاعب في دايمنشن 1 ومات لازم تعملو spawn لانو ما ينفع تغير الدامينشن و اللاعب ميت فالكود لازم يكون كذا function respawn () local x, y, z = getElementPosition ( source ) --هنا علشان ينزلو في نفس مكان القتل local dim = getElementDimension ( source ) --علشان ينززل في نفس الدايمنشن اللي كان فيه local skin = getPlayerSkin ( source ) --علشان يكون لابس نفس اللبس local int = getElementInterior ( source ) --علشان لو كان جوا انتريور ينزل في نفس الانتريور local team = getPlayerTeam ( source ) --علشان ينزل في نفس التيم spawnPlayer (source, x, y, z, 0, skin, int, dim, team) --ديه فنكشن الاحياء اصلا end addEventHandler ( "onPlayerWasted", root, respawn) بالنسبة للكومان مينفعش تكون كل حاجة سورس زي ما انت ما عامل الكوماند تكون كذا function dim0 ( thePlayer, commandName) setElementDimension ( thePlayer, 0) end addCommandHandler ("leave", dim0) اما بالنسبة للميديكك لازم تستخدم كليننت لانو السيرفر ايفينت ديه ملهاش كانسل -- client side function canceldamage ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "Medic" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", root, canceldamage) بالنسبة لأخر سؤال اه تستطيع زي بتاع الميديك بس هتضيف شرط -- client side function canceldamagepolice ( attacker ) if ( attacker) and ( attacker ~= source ) and ( getTeamName ( getPlayerTeam ( attacker )) == "police" ) then if ( getTeamName ( getPlayerTeam ( source )) == "اسم التيم التاني " ) then cancelEvent ( ) end end end addEventHandler ( "onClientPlayerDamage", root, canceldamagepolice)
    1 point
  8. آها معليش , شكرا ع المعلومه م دريت يعطيك العافيه
    1 point
  9. عذرا ..! استبدلها تسذي -- اذا كتب الاعب هذه الكومند يكون في ديمنشن صفر addCommandHandler("leave",function(player) setElementDimension(player,0) end ) -- اذا كان تيم الشخص ميدك لا يتسطيع ان يقتل الاعبون addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Medic" then cancelEvent() end end) addEventHandler("onPlayerDamage", root, function(attacker) if attacker and attacker ~= source and getTeamName(getPlayerTeam(attacker)) == "Police" then cancelEvent() end end)
    1 point
  10. Try to fix it yourself the following way: Everywhere where you see a line similar to dxDrawText("Login",loginX+shadowScale,loginY+shadowScale,loginX+sX*0.2,loginY+sY*0.15,tocolor(0,0,0,loginData.loginAlpha),loginData.fontScale*0.25,loginData.font,"right","center",true,false,false) try to add or withdraw some numbers until you have the text/image in the correct position. So for example in the above line try to make it like this: dxDrawText("Login",loginX+shadowScale+200, loginY+shadowScale+300, loginX+sX*0.2+150, loginY+sY*0.15+250, tocolor(0, 0, 0, loginData.loginAlpha), loginData.fontScale*0.25, loginData.font, "right", "center", true, false, false) As you see I added some numbers (+200, etc.) to each value and this way the text or image will move somewhere else on the screen. Try to play around with it like that until you find the sweat spot for the buttons and text. One thing to remember is: First value after the "Login" string is the X coordinate of the text on the screen (left or right). The value after the X one is the Y value (up or down). The 3rd value is the X coordinate of the text's boundarybox and the 4th value is the Y coordinate of the boundarybox. Now, what's a boundary box? Well let's just say that if the boundary box of the text is too small on the X side (left or right) then the text will move to a new line when it reaches the end of the boundary box. Example: if the boundary box is too small the text won't show as "Login" on a single line but instead on the first line it will be "Log" and the "in" part will be moved to another line. Here's some really useful descriptions that will help you understand things better. And remember, play around and you'll get the hang of it https://wiki.multitheftauto.com/wiki/DxDrawText https://wiki.multitheftauto.com/wiki/DxDrawImage
    1 point
  11. @Starztec Siempre puedes usar shaders para añadir paintjobs customs a vehículos con el uv map bien hecho. Para saber el nombre de una textura de un vehículo remplazado, siempre puedes abrir el .txd del vehículo y ahí puedes exportar la textura para crear un paintjob o ver el nombre de la textura para remplazarla en el shader. Puedes usar este shader para remplazar la textura Shader.fx texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } Y luego en cliente usas estas funciones para remplazar la textura dxCreateShader() dxCreateTexture() engineApplyShaderToWorldTexture() dxSetShaderValue()
    1 point
  12. Give me the screenshot --[[Easing Type can be found through the function such as getEasingValue or others.]] DGS:dgsMoveTo(dxgui,targetX,targetY,Relative,false,EasingType,timeMS) -- This works fine. DGS:dgsMoveTo(dxgui,targetX,targetY,Relative,true,EasingType,speedX,speedY) -- I think this is buggy. DGS:dgsSizeTo(dxgui,targetW,targetH,Relative,false,EasingType,timeMS) -- This works fine. DGS:dgsSizeTo(dxgui,targetW,targetH,Relative,true,EasingType,speedX,speedY) -- I think this is buggy. DGS:dgsAlphaTo(dxgui,targetAlpha,false,EasingType,timeMS) -- This works fine. DGS:dgsAlphaTo(dxgui,targetAlpha,true,EasingType,speed) -- I think this is buggy.
    1 point
  13. This tool allows you to attach objects of SA on your vehicle, save templates and use them again. If you want to set it for only admins, check server/globals.lua. The command is /tune but you can change it on config.lua. Download link: https://community.multitheftauto.com/?p=resources&s=details&id=14769
    1 point
  14. Hello, im actually developing some holoscreens for MTA, in more detail these are screens floating around everywhere you want in the 3d world of GTA. The main features are: -Can be placed anywhere as a simple element. -Are only rendered when you want and if they are on the screen. -You can interact with them pointing with your gun, aiming or just looking at them (it's a setting value), it outputs x,y of pointer.. -Can be rotated. -Are lightweight, they will run on any PC and they do not use heavy functions like processLine or etc... They just use simple maths.. An example image.. AND YES IT WILL BE FULLY OPEN SOURCE..
    1 point
  15. Если попросту, то у тестинга есть две основные задачи, который он обязан выполнить. Первая - проверка работоспособности режима или каких-то его отдельных вещей. Скажем, игроку должно быть комфортно или не очень что-то выполнять - администрация наблюдает, опрашивает, делает выводы. Вторая - собственно то, что могут дать сами тестеры. Сколько людей - столько и мнений, конечно. Но когда БОЛЬШИНСТВО хочет что-то видеть, чего-то пока не нет - это некий сигнал администрации к действиям. Тестер должен прежде всего хотеть играть - это как в случае с проектами Blizzard. Долго не думая, "Метелица" набрала изрядное количество простых игроков - как "мастеров", так и "новичков". И опросила. Собственно, только методом проб и ошибок можно добиться какого-то конкретного результата, "тыкаться" из крайности в крайность с дури ума - не выход. Надо набирать игроков на тест и смотреть, слушать, думать, переделывать... Это целая работа. Возможно, необходимая, возможно, для кого-то приятная, но всё-таки целая работа. ...Собственно, я это к чему? Ну, во-первых думаю, что в некоторой степени прав (но допускаю мысль о том, что мне, как и любому другому человеку, свойственно ошибаться). Кроме того, пригласите куда-нибудь на тест Идей много, просто льются из ушей. Да и достойных русскоязычных серверов ролевой игры я не видел ещё. Хочется привнести что-то своё - используя свои наблюдения, свой опыт игры так сказать. Хотя б через советы и отзывы о работе администрации. Да и скучно уже с буржуями играть
    1 point
×
×
  • Create New...