max-mohammed Posted January 5, 2014 Posted January 5, 2014 شباب كيفكم انا مسوي نافذة شراء بيوت الزبدة في ايديت بتاع الحساب وايديت لرقم البطاقة ابيهم يتنسخو لملف اسمه list.xml الكود كلنت لو يلزم تريقر سيرفر قولولي Client function open() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) else guiSetVisible ( wnd, true ) showCursor(true) end end bindKey("F7", "down", open) -------------------------------- local wnd = guiCreateStaticImage(185, 131, 657, 513, "1.png", false) local rsl = guiCreateButton(306, 375, 97, 49, "ارسل", false, GUIEditor.staticimage[1]) local asm = guiCreateEdit(197, 209, 304, 48, "", false, GUIEditor.staticimage[1]) local rkm = guiCreateEdit(197, 298, 304, 48, "", false, GUIEditor.staticimage[1]) guiCreateLabel(419, 183, 193, 68, "اسم الحساب:", false, GUIEditor.staticimage[1]) guiCreateLabel(419, 271, 261, 75, "رقم البطاقة:", false, GUIEditor.staticimage[1]) guiCreateLabel(221, 45, 355, 97, "نظام شراء البيوت لمدة شهر ب10 ريال", false, GUIEditor.staticimage[1]) guiCreateLabel(217, 74, 301, 51, "ستحصل على بيت في اقل من 24 ساعة!", false, GUIEditor.staticimage[1]) guiCreateLabel(287, 97, 131, 38, "طريقة الدفع:", false, GUIEditor.staticimage[1]) guiCreateLabel(189, 115, 310, 54, "تضع اسم الحساب ورقم بطاقة سوا stc ثم تضغط ارسل", false, GUIEditor.staticimage[1]) -------------------------------------------- function addtoxml () local asmm = guiGetText(asm) local rkmm = guiGetText(rkm) هنا ابي الوظائف التي تنسخ في ملف xml end addEventHandler ( "onClientGUIClick", rsl, addtoxml )
max-mohammed Posted January 5, 2014 Author Posted January 5, 2014 مو لازم xmlCreateFile لأن الملف موجود انا ابيه ينسخ المعلومات وابي مثال عليه
al-Kobra Posted January 5, 2014 Posted January 5, 2014 مو لازم xmlCreateFile لأن الملف موجود انا ابيه ينسخ المعلومات وابي مثال عليه xmlLoadFile اضغط عليه وبتشوف مثال من الويكي
max-mohammed Posted January 5, 2014 Author Posted January 5, 2014 طيب هذا الفنكشن صح؟ function addtoxml () local asmm = guiGetText(asm),guiGetText(rkm) xmlLoadFile ("list.xml",asmm ) end addEventHandler ( "onClientGUIClick", rsl, addtoxml)
max-mohammed Posted January 5, 2014 Author Posted January 5, 2014 وممكن لو احد ما كتب فيه شيء ما يصير الفنكشن اذا تقدر مو ضروري
#DRAGON!FIRE Posted January 5, 2014 Posted January 5, 2014 طيب هذا الفنكشن صح؟ function addtoxml () local asmm = guiGetText(asm),guiGetText(rkm) xmlLoadFile ("list.xml",rkmm ) end addEventHandler ( "onClientGUIClick", rsl, addtoxml) لأ الفنكشنات اللي تحتاجها xmlCreateChild xmlSaveFile xmlNodeSetAttribute xmlSaveFile xmlUnloadFile xmlFindChild xmlLoadFile الاكس ام ال , معقد ومشوار
max-mohammed Posted January 5, 2014 Author Posted January 5, 2014 طيب تقدر تعطيني عليها كلها مثال واحد لو سمحت
فاّرس Posted January 5, 2014 Posted January 5, 2014 شوف ذا الموضوع, viewtopic.php?f=160&t=58750&hilit=XML&start=15
max-mohammed Posted January 6, 2014 Author Posted January 6, 2014 شباب فهمت شوي بس ذا الكود صح؟ سيرفر addEvent( "xarsl", true ) addEventHandler( "xarsl", root, function () local asmm = guiGetText(asm),guiGetText(rkm) local XMLFile = xmlLoadFile ( "list.xml" ) or xmlCreateFile ( "list.xml", "list" ) if ( XMLFile ) then xmlNodeSetValue(xmlCreateChild(XMLFile,"asmm"),list) xmlSaveFile ( XMLFile ) xmlUnloadFile ( XMLFile ) outputChatBox("لقد تم وضع الاسم") end end,false ) كلنت function open() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) else guiSetVisible ( wnd, true ) showCursor(true) end end bindKey("F7", "down", open) -------------------------------- local wnd = guiCreateStaticImage(185, 131, 657, 513, ":freeroam/FAHAD.png", false) local rsl = guiCreateButton(306, 375, 97, 49, "ارسل", false, GUIEditor.staticimage[1]) local asm = guiCreateEdit(197, 209, 304, 48, "", false, GUIEditor.staticimage[1]) local rkm = guiCreateEdit(197, 298, 304, 48, "", false, GUIEditor.staticimage[1]) guiCreateLabel(419, 183, 193, 68, "اسم الحساب:", false, GUIEditor.staticimage[1]) GUIEditor.label[2] = guiCreateLabel(419, 271, 261, 75, "رقم البطاقة:", false, GUIEditor.staticimage[1]) guiCreateLabel(221, 45, 355, 97, "نظام شراء البيوت لمدة شهر ب10 ريال", false, GUIEditor.staticimage[1]) guiCreateLabel(217, 74, 301, 51, "ستحصل على بيت في اقل من 24 ساعة!", false, GUIEditor.staticimage[1]) guiCreateLabel(287, 97, 131, 38, "طريقة الدفع:", false, GUIEditor.staticimage[1]) guiCreateLabel(189, 115, 310, 54, "تضع اسم الحساب ورقم بطاقة سوا stc ثم تضغط ارسل", false, GUIEditor.staticimage[1]) -------------------------------------------- function addtoxml () triggerServerEvent ( "xarsl", localPlayer) end addEventHandler ( "onClientGUIClick", rsl, addtoxml ) -------------------------------
فاّرس Posted January 6, 2014 Posted January 6, 2014 -- Client Side # local wnd = guiCreateStaticImage(185, 131, 657, 513, ":freeroam/FAHAD.png", false) local rsl = guiCreateButton(306, 375, 97, 49, "ارسل", false, wnd) local asm = guiCreateEdit(197, 209, 304, 48, "", false, wnd) local rkm = guiCreateEdit(197, 298, 304, 48, "", false, wnd) guiCreateLabel(419, 183, 193, 68, "اسم الحساب:", false, wnd) guiCreateLabel(419, 271, 261, 75, "رقم البطاقة:", false, wnd) guiCreateLabel(221, 45, 355, 97, "نظام شراء البيوت لمدة شهر ب10 ريال", false, wnd) guiCreateLabel(217, 74, 301, 51, "ستحصل على بيت في اقل من 24 ساعة!", false, wnd) guiCreateLabel(287, 97, 131, 38, "طريقة الدفع:", false, wnd) guiCreateLabel(189, 115, 310, 54, "تضع اسم الحساب ورقم بطاقة سوا stc ثم تضغط ارسل", false, wnd) addEventHandler ( 'onClientGUIClick', rsl,function () local eName = guiGetText(asm) local eNumber = guiGetText(rkm) if tostring(eName) and eName ~= '' and tostring(eNumber) and eNumber ~= '' then triggerServerEvent ( 'SaveInfo', localPlayer,eName,eNumber) end end,false ) bindKey('F7','down',function() guiSetVisible(wnd , not guiGetVisible(wnd)) showCursor(not isCursorShowing()) end ) -- Server Side # addEventHandler('onResourceStart',resourceRoot,function() local file = xmlCreateFile ( 'info.xml', "information" ) xmlSaveFile ( file ) end ) addEvent('SaveInfo',true) addEventHandler('SaveInfo',root,function(name,number) local gFile = xmlLoadFile ( 'info.xml' ) if ( gFile ) then xmlNodeSetValue(xmlCreateChild(gFile,'Name'),tostring(name)) xmlNodeSetValue(xmlCreateChild(gFile,'Number'),tostring(number)) xmlSaveFile ( gFile ) xmlUnloadFile ( gFile ) end end )
max-mohammed Posted January 6, 2014 Author Posted January 6, 2014 -- Client Side # local wnd = guiCreateStaticImage(185, 131, 657, 513, ":freeroam/FAHAD.png", false) local rsl = guiCreateButton(306, 375, 97, 49, "ارسل", false, wnd) local asm = guiCreateEdit(197, 209, 304, 48, "", false, wnd) local rkm = guiCreateEdit(197, 298, 304, 48, "", false, wnd) guiCreateLabel(419, 183, 193, 68, "اسم الحساب:", false, wnd) guiCreateLabel(419, 271, 261, 75, "رقم البطاقة:", false, wnd) guiCreateLabel(221, 45, 355, 97, "نظام شراء البيوت لمدة شهر ب10 ريال", false, wnd) guiCreateLabel(217, 74, 301, 51, "ستحصل على بيت في اقل من 24 ساعة!", false, wnd) guiCreateLabel(287, 97, 131, 38, "طريقة الدفع:", false, wnd) guiCreateLabel(189, 115, 310, 54, "تضع اسم الحساب ورقم بطاقة سوا stc ثم تضغط ارسل", false, wnd) addEventHandler ( 'onClientGUIClick', rsl,function () local eName = guiGetText(asm) local eNumber = guiGetText(rkm) if tostring(eName) and eName ~= '' and tostring(eNumber) and eNumber ~= '' then triggerServerEvent ( 'SaveInfo', localPlayer,eName,eNumber) end end,false ) bindKey('F7','down',function() guiSetVisible(wnd , not guiGetVisible(wnd)) showCursor(not isCursorShowing()) end ) -- Server Side # addEventHandler('onResourceStart',resourceRoot,function() local file = xmlCreateFile ( 'info.xml', "information" ) xmlSaveFile ( file ) end ) addEvent('SaveInfo',true) addEventHandler('SaveInfo',root,function(name,number) local gFile = xmlLoadFile ( 'info.xml' ) if ( gFile ) then xmlNodeSetValue(xmlCreateChild(gFile,'Name'),tostring(name)) xmlNodeSetValue(xmlCreateChild(gFile,'Number'),tostring(number)) xmlSaveFile ( gFile ) xmlUnloadFile ( gFile ) end end ) يعطيك العافية الكود شغال 100% شكراااااا فديتك
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now