-
Posts
303 -
Joined
-
Last visited
Everything posted by mouamle
-
[Lua] #3 تحديث 1 || أنواع القيم والمتغيرات
mouamle replied to </Mr.Tn6eL>'s topic in دروس في البرمجة
المتغيرات كلها فاهمها بس شغلة وحدة بس الي هيه عندي متغير بملف اسمة A.lua TheCar = createVehicle ( {...} ) x, y, z = getElementPosition( TheCar ) ابي استعدي المتغيرات x, y, z في ملف B.lua -
function Click() -- فنكشن if ( source == Button ) then -- Button اسم الزر guiSetVisible ( GUIEditor.window[1], true ) -- جعل اللوحة مرئية end -- أند لل if end -- اند لل function addEventHandler("onClientGUIClick", root, Click) -- حدث لما اللاعب يضغط على زر gui
-
جربت هذي الطريقة ونجحت 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) صحيحة طريقتي ولا خطأ ؟
-
السلام عليكم ذا الكود (نسختة من الويكي) 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 وشكرا
-
جرب 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 ) بس ما اتوقع يشتغل
-
يب موجود بالرياضيات
-
صحيح الموضوع قديم بس اكثرة يعتمد على فهمك للرياضيات وبصراحة فادني بأختبار الرياضيات
-
https://wiki.multitheftauto.com/wiki/SmoothMoveCamera
-
لما تسوي صورة شوف الأرقمنتات في ارقمنت 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
-
ولازم بملف ال meta يصير <script src="Client.[color=#FF0000]luac[/color]" type="client" />
-
مركز الخليج متوقف شوفو هذا الموضوع https://forum.multitheftauto.com/viewtopic.php?f=91&t=76726
-
السلام عليكم سويت لوحة تسجيل وحسب الأصول وكل شي شغال تمام بس ابي اضيف لها 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 )
-
ممكن حل ؟ 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 )
-
السلام عليكم طلب بسيط أو معقد ما اعرف المهم -- 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 من الكلنت لل سيرفر ؟
-
السلام عليكم ممكن واحد يشرحلي كيف اسوي triggerServerEvent
