Jump to content

mouamle

Members
  • Posts

    303
  • Joined

  • Last visited

Everything posted by mouamle

  1. المتغيرات كلها فاهمها بس شغلة وحدة بس الي هيه عندي متغير بملف اسمة A.lua TheCar = createVehicle ( {...} ) x, y, z = getElementPosition( TheCar ) ابي استعدي المتغيرات x, y, z في ملف B.lua
  2. function Click() -- فنكشن if ( source == Button ) then -- Button اسم الزر guiSetVisible ( GUIEditor.window[1], true ) -- جعل اللوحة مرئية end -- أند لل if end -- اند لل function addEventHandler("onClientGUIClick", root, Click) -- حدث لما اللاعب يضغط على زر gui
  3. mouamle

    طلب

    جربت هذي الطريقة ونجحت local x,y = guiGetScreenSize() -- Get players resolution. local playerName = getPlayerName ( localPlayer ) -- Get players name. local MOTDText = "Welcome to our server, this is a test MOTD script for MTA's Wiki." -- Example of MOTD message. local Alpha1 = 150 local Alpha2 = 250 function drawStuff() dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, Alpha1 ) ) -- Create our black transparent MOTD background Rectangle. dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, Alpha2 ), 1, "bankgothic" ) -- Create Welcome title. dxDrawText ( "Welcome " .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, Alpha2 ), 1, "bankgothic" ) -- Create Welcome title shadow. dxDrawLine ( x/3.6, y/3.3, x/1.35, y/3.3, tocolor ( 255, 255, 255, Alpha2 ), 2 ) -- Create underline for title. dxDrawLine ( x/3.59, y/3.275, x/1.348, y/3.275, tocolor ( 0, 0, 0, Alpha2 ), 2 ) -- Create underline shadow. dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, Alpha2 ), 1, "clear" ) -- Create MOTD text. end function X() addEventHandler("onClientRender", root, drawStuff) -- Keep everything visible with onClientRender. Alpha1 = 150 Alpha2 = 250 end addCommandHandler("X", X) function Close() Alpha1 = 0 Alpha2 = 0 end addCommandHandler("XC", Close) صحيحة طريقتي ولا خطأ ؟
  4. mouamle

    طلب

    السلام عليكم ذا الكود (نسختة من الويكي) local x,y = guiGetScreenSize() -- Get players resolution. local playerName = getPlayerName ( localPlayer ) -- Get players name. local MOTDText = "Welcome to our server, this is a test MOTD script for MTA's Wiki." -- Example of MOTD message. function drawStuff() dxDrawRectangle ( x/3.8, y/3.8, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) -- Create our black transparent MOTD background Rectangle. dxDrawText ( "Welcome " .. playerName, x/3.5, y/3.6, x, y, tocolor ( 255, 255, 255, 255 ), 1, "bankgothic" ) -- Create Welcome title. dxDrawText ( "Welcome " .. playerName, x/3.48, y/3.58, x, y, tocolor ( 0, 0, 0, 255 ), 1, "bankgothic" ) -- Create Welcome title shadow. dxDrawLine ( x/3.6, y/3.3, x/1.35, y/3.3, tocolor ( 255, 255, 255, 255 ), 2 ) -- Create underline for title. dxDrawLine ( x/3.59, y/3.275, x/1.348, y/3.275, tocolor ( 0, 0, 0, 255 ), 2 ) -- Create underline shadow. dxDrawText ( MOTDText, x/3.6, y/3, x, y, tocolor ( 255, 255, 255, 255 ), 1, "clear" ) -- Create MOTD text. end function X() addEventHandler("onClientRender", root, drawStuff) -- Keep everything visible with onClientRender. end addCommandHandler("X", X) وضفت الة function X() addEventHandler("onClientRender", root, drawStuff) -- Keep everything visible with onClientRender. end addCommandHandler("X", X) لما اكتب الأمر X تطلعلي تافذة ال DX المطلوب كود يغلق نافذة ال DX وشكرا
  5. جرب addEvent("Muscles", true) addEventHandler("Muscles", root, function ( theplayer ) takePlayerMoney(theplayer, 100000) local stat = getPedStat(theplayer, 23) if stat < 1000 then outputChatBox("You now own Muscles ", theplayer) end end ) ------------------------------ addEvent("Skinny", true) addEventHandler("Skinny", root, function ( theplayer ) takePlayerMoney(theplayer, 50000) local stat = getPedStat(theplayer , 25) if stat < 1000 then outputChatBox("You now own Skinny ", theplayer) end end ) -------------------------- addEvent("Paunch", true) addEventHandler("Paunch", root, function ( theplayer ) takePlayerMoney(theplayer, 75000) local stat = getPedStat(theplayer, 21) if stat < 1000 then outputChatBox("You now own Paunch", theplayer) end end ) بس ما اتوقع يشتغل
  6. صحيح الموضوع قديم بس اكثرة يعتمد على فهمك للرياضيات وبصراحة فادني بأختبار الرياضيات
  7. https://wiki.multitheftauto.com/wiki/SmoothMoveCamera
  8. السلام عليكم سؤال Gui.EditBox1 ابي القيمة الي فية مثلا تنحفظ ب .db File قاعدة بيانات وابي اجيب القيمة واحطها ب Editbox ثاني وشكرا
  9. لما تسوي صورة شوف الأرقمنتات في ارقمنت rotation: the rotation, in degrees for the image. تكدر تسوي مثلا local rotation = 0 dxDrawImage(260, 92, 811, 536, ":guieditor/images/dot_white.png", rotation, 0, 0, tocolor(255, 255, 255, 255), false) اذا تريد تخلي الصورة تدور أتوقع تكدر تسوي هيج شي for i = 0,360 do rotation = rotation + 1 end
  10. ولازم بملف ال meta يصير <script src="Client.[color=#FF0000]luac[/color]" type="client" />
  11. تقدر لكن بنفس المود فقط local تحط المتغير بدون كلمة شكرا
  12. السلام عليكم سؤال بسيط ما اعرف معقد المهم عندي Variable بملف Clinet2 في طريقة اكدر استعدي فيها ال Variable في ملف Clinet1 ?????
  13. مركز الخليج متوقف شوفو هذا الموضوع https://forum.multitheftauto.com/viewtopic.php?f=91&t=76726
  14. السلام عليكم سويت لوحة تسجيل وحسب الأصول وكل شي شغال تمام بس ابي اضيف لها checkbox يحفظ معلومات تسجيل الدخول حتى ما يجي اللاعب يكتبهم كل ما يدخل السيرفر وش احتاج من فنكشنات ؟ -- Client Side function Login1() -- Login Button if ( source == GUIEditor.button[1] ) then UserName = guiGetText(GUIEditor.edit[1]) PassWord = guiGetText(GUIEditor.edit[2]) triggerServerEvent("LogIn1", localPlayer, UserName, PassWord) end end addEventHandler("onClientGUIClick", resourceRoot, Login1) function Register1() -- Register Button if (source == GUIEditor.button[2]) then UserName = guiGetText(GUIEditor.edit[1]) PassWord = guiGetText(GUIEditor.edit[2]) triggerServerEvent("Register1", localPlayer, UserName, PassWord) end end addEventHandler("onClientGUIClick", resourceRoot, Register1) function Register1() -- Register Button if (source == GUIEditor.button[3]) then triggerServerEvent("Register1", localPlayer) end end addEventHandler("onClientGUIClick", resourceRoot, Register1) -- Server Side -- Login ----------------------------------------------------------------------------------------------------------------- addEvent("LogIn1", true) addEventHandler("LogIn1", root, function ( UserName, PassWord) local account = getAccount ( UserName, PassWord ) local Logined = logIn ( source, account, PassWord ) if (Logined) then outputChatBox(" <{تم تسجيل دخولك بنجاح}> ", source, 255,255,0) else outputChatBox(" <{لم يتم تسجيل الدخول تأكد من معلومات حسابك أو هذا الحساب مسجل بالفعل}> ", source, 255,0,0) end end ) -- Register ----------------------------------------------------------------------------------------------------------------- addEvent("Register1", true) addEventHandler("Register1", root, function( UserName, PassWord) local accountAdded = addAccount(UserName, PassWord) if (accountAdded) then outputChatBox(" <{تمت تجيلك بنجاح}> ", source, 255,255,0) else outputChatBox(" <{لم يتم تسجيل الدخول أو هذا الحساب موجود بالفعل}> ", source, 255,0,0) end end )
  15. على أساس اني مبتدأ في البرمجة
  16. ممكن حل ؟ Server.lua:19: Bad argument @ 'logIn' [Expected player at argument 1, got nil] addEvent("LogIn1", true) addEventHandler("LogIn1", root, function ( UserName, PassWord) logIn ( Player, UserName, PassWord ) -- Line 19 end )
  17. السلام عليكم طلب بسيط أو معقد ما اعرف المهم -- Client side function button1() if ( source == button1 ) then name = guiGetText(Name) age = guiGetText(Age) triggerServerEvent("info", localPlayer, name, age) end end addEventHandler("onClientGUIClick", resourceRoot, button1) -- Server Side addEvent("info", true) addEventHandler("info", root, function () outputChatBox("Player Name is: " .. name .. "And Player age is: " .. age) end ) لما اسوي triggerServerEvent في طريقة انقل ال Variable من الكلنت لل سيرفر ؟
  18. السلام عليكم ممكن واحد يشرحلي كيف اسوي triggerServerEvent
×
×
  • Create New...