-
Posts
2,259 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Adham
-
جرب عملته ع السريع عشان عندي مدرسه -- Client -- addEventHandler('onClientGUIClick',root, function ( ) if ( source == delete ) then local Data = guiGridListGetItemText ( Grid, guiGridListGetSelectedItem ( Grid ), 1 ) if Data == "" then outputChatBox ( "حدد اسم", 255,255,255,true ) return end triggerServerEvent ( "Test", localPlayer, Data ) end end ) --Server -- addEvent ( "Test", true ) addEventHandler ( "Test", root, function ( playerData ) if ( getElementData ( source, "Diamond", true ) then local Name = getPlayerFromName ( playerData ) if ( Name ) then setElementData ( Name, "Diamond", false ) end end end )
-
guiGetText triggerServerEvent getPlayerAccount isGuestAccount getAccount getRealTime string.sub or string.format -- مثال صغير -- لين يخش السرفر يخش اسمه بالقريد لست ويظهر الاسم و الوقت الدخل فيه -- Server Side -- addEventHandler ( "onPlayerJoin", root, function ( ) local Name = getPlayerName ( source ):gsub( "#%x%x%x%x%x%x", "" ) local time = getRealTime( ) local Date = string.format( '%04d-%02d-%02d %02d:%02d', time.year + 1900, time.month + 1, time.monthday, time.hour, time.minute ) triggerClientEvent ( root,"addPlayers", root, Name, Data ) end ) -- Client Side -- addEvent ( "addPlayers", true ) addEventHandler ( "addPlayers", root, function (Name, Data) local row = guiGridListAddRow ( aGridList ) guiGridListSetItemText( aGridList, row, 1, Name, false, false) guiGridListSetItemText( aGridList, row, 2, Data, false, false) end )
-
جرب addCommandHandler ( "shnohaza", function ( ) local Sound = playSound ( "string soundPath" ) end )
-
لو تقرأ الموضوع من الاول بيكون أفضل
-
شف : المشكله في كل هذا ان لما اعمل اكسبورت لمسج بوكس ادوس علي زر تفتح لوحه مسج بوكس error المشكله انا لما اضعط علي زر واضعط علي مره تانيه تظهر الوحه مرتين ورا بعض . Edited 34 minutes ago by Deativated
-
لأ , لمن اضعطط علي زر البالوحه العاديه تظهر لوحه ايرور بعدين ادوس ع الزر اتاني الب نفس الوحه يجي لوحه ايرور تاني 2 ورا بعض
-
نو دي بق لما اضعط علي الزار يجي الوحه واضعط عليه مره تانيه يظهر الوحه تاني
-
--[[-----------DOCUMENTATION--------------- SYNTAX: guibutton,guibutton,guibutton = guiShowMessageBox ( string message, string boxType, string title [, string button1, string button2, stringbutton3] ) REQUIRED ARGUMENTS * message - The message you want in the message box * boxType - Either "warning","question","error","info". Displays different icons accordingly OPTIONAL ARGUMENTS guiShowMessageBox allows for up to 3 buttons in the message box * forceShowing - Ensures that nothing else but the message box can be clicked, besides gui elements created afterwards. * button1 - A string of the first button that appears * button2 - A string of the second button that appears * button3 - A string of the third button that appears Not specifying forceShowing will default to false. Not specifying all buttons will only create that many buttons. For example, specifying 2 buttons will only display 2 buttons. Not specifying any buttons at all will default to one "OK" button. All buttons hide the message box by default RETURNS: Returns 3 gui elements of the each button the gui window. If these dont exist nil is returned instead. You can attach these to a onClientGUIClick event to do whatever you want. --------------------------------------------------------]] local validTypes = { ["warning"]=true, ["question"]=true, ["error"]=true, ["info"]=true } local screenX, screenY = guiGetScreenSize() local guiAttached = {} ---Msg box position/size config local msgBox = {} msgBox.sizeX = 280 msgBox.sizeY = 135 --- function guiShowMessageBox ( message, boxType, title, forceShowing, button1, button2, button3 ) local aMessage = {} local buttons = { button1,button2,button3 } --add checks to ensure everything is valid if type(message) ~= "string" then outputDebugString ( "guiShowMessageBox - Invalid 'message' specified.", 0 ) return false end if not validTypes[boxType] then outputDebugString ( "guiShowMessageBox - Invalid 'type' specified.", 0 ) return false end if type(title) ~= "string" then outputDebugString ( "guiShowMessageBox - Invalid 'title' specified.", 0 ) return false end ---work out the number of buttons local buttonCount = 0 while type(buttons[buttonCount+1]) == "string" do buttonCount = buttonCount + 1 end if buttonCount == 0 then button1 = "OK" buttonCount = 1 end local cover if ( forceShowing ) then cover = guiCreateButton ( 0, 0, 1, 1, "", true ) guiSetAlpha ( cover, 0 ) addEventHandler ( "onClientGUIClick", cover, bringMsgBoxToFront ) end local formPosX = screenX / 2 - msgBox.sizeX/2 local formPosY = screenY / 2 - msgBox.sizeY/2 aMessage.Form = guiCreateWindow ( formPosX,formPosY, msgBox.sizeX, msgBox.sizeY, title, false ) guiWindowSetSizable ( aMessage.Form, false ) aMessage.Image = guiCreateStaticImage ( 15, 28, 42, 42, "images/"..boxType..".png", false, aMessage.Form ) aMessage.Label = guiCreateLabel ( 76, 35, 190, 65, message, false, aMessage.Form ) guiLabelSetHorizontalAlign ( aMessage.Label,"left",true) --create gui buttons --130 local guiButton1, guiButton2, guiButton3 if buttonCount == 1 then guiButton1 = guiCreateButton ( 99, 104, 84, 23, button1, false, aMessage.Form ) addEventHandler ( "onClientGUIClick", guiButton1, aMessageBoxClick ) guiAttached[guiButton1] = {} guiAttached[guiButton1].parent = aMessage.Form guiAttached[guiButton1].forcedButton = cover elseif buttonCount == 2 then guiButton1 = guiCreateButton ( 48.5, 104, 84, 23, button1, false, aMessage.Form ) guiButton2 = guiCreateButton ( 149.5, 104, 84, 23, button2, false, aMessage.Form ) addEventHandler ( "onClientGUIClick", guiButton2, aMessageBoxClick ) guiAttached[guiButton1] = {} guiAttached[guiButton2] = {} guiAttached[guiButton1].parent = aMessage.Form guiAttached[guiButton2].parent = aMessage.Form guiAttached[guiButton1].forcedButton = cover guiAttached[guiButton2].forcedButton = cover elseif buttonCount == 3 then guiButton1 = guiCreateButton ( 10, 104, 84, 23, button1, false, aMessage.Form ) guiButton2 = guiCreateButton ( 100, 104, 84, 23, button2, false, aMessage.Form ) guiButton3 = guiCreateButton ( 190, 104, 84, 23, button3, false, aMessage.Form ) addEventHandler ( "onClientGUIClick", guiButton1, aMessageBoxClick ) addEventHandler ( "onClientGUIClick", guiButton2, aMessageBoxClick ) addEventHandler ( "onClientGUIClick", guiButton3, aMessageBoxClick ) guiAttached[guiButton1] = {} guiAttached[guiButton2] = {} guiAttached[guiButton3] = {} guiAttached[guiButton1].parent = aMessage.Form guiAttached[guiButton2].parent = aMessage.Form guiAttached[guiButton3].parent = aMessage.Form guiAttached[guiButton1].forcedButton = cover guiAttached[guiButton2].forcedButton = cover guiAttached[guiButton3].forcedButton = cover end --260 -- if ( forceShowing ) then guiAttached[cover] = aMessage.Form end return guiButton1, guiButton2, guiButton3 end function aMessageBoxClick () if source ~= this then return end guiSetVisible ( guiAttached[source].parent, false ) destroyElement ( guiAttached[source].parent ) local forcedButton = guiAttached[source].forcedButton if ( forcedButton ) then guiSetVisible ( forcedButton, false ) destroyElement ( forcedButton ) guiAttached[forcedButton] = nil end guiAttached[source] = nil end function bringMsgBoxToFront() guiBringToFront ( guiAttached[source] ) end
-
شف هذا مود لوحده function show(msg) exports.msgbox:guiShowMessageBox(msg,"error","error",false,"OK") end addEventHandler ( "onClientGUIClick", root, function ( ) if source == buton then show ( "test" ) end end ) والمود مسج بوكس شغال بس لما اضعط عليه مرتين يجي الوحه مرتين
-
`ذا احطه بالوحه الاوله ولا لوحه ال error ?ّ
-
شف : المشكله في كل هذا ان لما اعمل اكسبورت لمسج بوكس ادوس علي زر تفتح لوحه مسج بوكس error المشكله انا لما اضعط علي زر واضعط علي مره تانيه تظهر الوحه مرتين ورا بعض .
-
معلش , لاهنت سوال انا لو سويت لوحه الان و فيها Label سويت مثلا يوم يدوس علي زرار يفتح له الوحه ويخلي الابيل guiSetText -- كذا كذا ويدوس زر تاني يخلي guiSetText برده يغير الكلام بيحصل مشاكل فيه ^ ؟ ---- المشكله في كل هذا ان لما اعمل اكسبورت لمسج بوكس ادوس علي زر تفتح لوحه مسج بوكس ايرير المشكله انا لما اضعط علي زر واضعط علي مره تانيه تظهر الوحه مرتين ورا بعض .
-
يعني الفكشن هذا ماله طلب ب موضوعي ولا ؟ guiMoveToBack
-
ممكن مثال ؟ اوضح من الويكي و لو م فهمت علي انا سويت لوحه ف7 ممثلا ولما يضعط علي زر تفتح له لوحه eror ولما يضعط علي زر اخر او نفس الزر م يقدر يضعط علي الازرار البالوحه
-
لا , انا ابيه لما يفتح الوحه التانيه الوحه انا مسويها تكون فوق الوحه الاوله انا ابي لما يفتح الوحه التانيه مي قدر يتحكم في الوحه الاول ويدوس علي زر والخ
-
السلأم عليكم ورحمه الله وبركاته .. كيف حالكم شباب ؟ انشاء الله تكونو بخير جميعأ اليوم انا جالس اسوي مود .. انا سويت لين يضعط علي زر يفتح له " لوحه " المشكله : ان انا ابي لين تفتح له الوحه م يقدر يضعط شي في الوحه الاوله ولا زر ولا شي و الوحه التانيه فوق الوحه الاوله فهمتو علي ؟ شو الفكشن المناسب ؟
-
"onClientGUIClick" guiSetVisible -- false guiSetVisible -- true
-
تفضل @Abu-Solo سويت لك مثال كامل اذا كتب في الايديت يجي قريد لست ويتحفظ .. كلنت : addEventHandler ( "onClientGUIClick", root, -- حدث اذا ضعط علي الزر function ( ) -- وظيفه if source == button then -- تحقق من الزر الضعط عليه local Edit1 = guiGetText ( GUIEditor.edit[1] ) local Edit2 = guiGetText ( GUIEditor.edit[2] ) local Edit3 = guiGetText ( GUIEditor.edit[3] ) if Edit1 == "" or Edit2 == "" or Edit3 == "" then return end -- تحقق انه كاتب بالايديت شي triggerServerEvent ( "Test", localPlayer, Edit1, Edit2, Edit3 ) end -- انهاء الحدث end -- انهاء الوظيفه ) -- قوس addEvent ( "Test1", true ) addEventHandler ( "Test1", root, function ( Table ) -- وظيفه guiGridListClear( GUIEditor.gridlist[1] ) -- تحديث القريد لست for i, _ in ipairs( Table ) do -- نسوي لوب علي الجدول local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) -- نضيف راو جديد guiGridListSetItemText( GUIEditor.gridlist[1], row, 1,Table[i].Edit1, false, false) -- نكتب بالقريد لست الكلام الطلع بالايديت إلخ guiGridListSetItemText( GUIEditor.gridlist[1], row, 2,Table[i].Edit2, false, false) guiGridListSetItemText( GUIEditor.gridlist[1], row, 3,Table[i].Edit3, false, false) end -- انهاء الوب end -- انهاء الفكشن ) -- قوس addEventHandler( "onClientResourceStart", resourceRoot, -- حدث اذا المود اتفتح function( ) -- وظيفه triggerServerEvent( "Refresh", localPlayer ) -- تريقر لسرفر -- ذا عشان تسوي تحديث للقاعده او " القريد لست " end ) سرفر : executeSQLQuery( "CREATE TABLE IF NOT EXISTS `TEST` ( Edit1, Edit2, Edit3 ) " ) -- تصنع قاعده بيانات addEvent ( "Test", true ) -- استقبال التريقر addEventHandler ( "Test", root, -- استقبال التريقر function ( Edit1, Edit2, Edit3 ) -- وظيفه if Edit1 and Edit2 and Edit3 then -- تحقق اذا كان بيانات في الايديت كامله executeSQLQuery( 'INSERT INTO `TEST`( Edit1,Edit2,Edit3 ) VALUES(?,?,?) ' , Edit1, Edit2, Edit3 ) -- زي م قال مستر -- وش وظيفتها الادخال في التيبل تبي تدخل قيم جديده triggerEvent( "Refresh", root ) -- تسوي تريقر من سرفر ل سرفر لتحديث القاعده -- عشان اذا انت ضفت طلب مب بيجي لازم تحديث للقاعده لو تبي يجي لازم ترستر المود -- فأ لازم تحط تحديث للقريد لست يعني القاعده end -- نهايه التحقق end -- نهايه الفكشن ) -- قوس addEvent ( "Refresh", true ) -- استقبال التريقر addEventHandler ( "Refresh", root, -- استقبال التريقر function ( ) -- وظيفه local SQLListe = executeSQLQuery ( "SELECT * FROM `TEST` " ) if #SQLListe ~= 0 then -- تححقق triggerClientEvent ( "Test1", root, SQLListe ) -- تريقر لكلنت end end)
-
أفترضنا , انا الان سويت لين يحدد سريال ويضعط علي زر يعطيه باند دائم او إلخ بتحصل مشاكل , ؟ لازم اسوي حفظ ؟ ولا البند بيفضل معاه ؟
-
سلأم عليكم ورحمه الله وبركاته .. كيفكم شباب ؟ انشاء الله بخير اليوم كنت ابي اسوي بلاك لست لين يحدد سريال من القريد لست.. ويدوس زر يعطيه بلاك لست من السرفر وم يقدر يخش السرفر و لما يحدد سريال ويضعط علي زر حذف يفك له البلاك لست ... شباب ابي الفكشنات بالترتيب