I_Mr.[T]he[P]rInCe Posted April 20, 2015 Share Posted April 20, 2015 السلام عليكم ورحمة الله ابي اعرف كيف استخدم ملف الاكس ام ال مثلا لو ابي احفظ الكلام اللي في guiEdit مع مثال لو تكرمتم والسلام خير ختام لا اله الا الله محمد رسول الله Link to comment
The Killer Posted April 20, 2015 Share Posted April 20, 2015 الاكس ام ل , انا اشوف انه ماهو بذيك الصعوبه لاكن بعض الناس يحط بعقله ذا الشي , لاكن مهي مشكله راح اعطيك مثال صغير عن حفظ الكلام في ايديت او جلبه edit = guiCreateEdit (....) save = guiCreateButton (....) addEventHandler ("onClientResourceStart", resourceRoot, function () -- اول ما يشتغل local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف if not xml then return end -- اذا ما كان موجود يوقف الوظيفه local child = xmlFindChild (xml, "TheText", 0 ) -- نجيب مكان الكتابه if (child) then -- اذا مكان الكتابه موجود local text = xmlNodeGetValue (child) -- نجيب الكلام guiSetText (edit, text) -- نكتبه end end ) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == save) then -- اذا كان الزر زر الحفظ local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف local child = xmlFindChild (xml, "TheText", 0 ) or xmlCreateChild (xml, "TheText") -- نجيب مكان الكتابه xmlNodeSetValue (child, guiGetText (edit)) -- نكتب الكلام في مكان الكتابه xmlSaveFile (xml) -- نحفظ الملف xmlUnloadFile (xml) -- نقفل الملف end end ) Link to comment
I_Mr.[T]he[P]rInCe Posted April 20, 2015 Author Share Posted April 20, 2015 الاكس ام ل , انا اشوف انه ماهو بذيك الصعوبهلاكن بعض الناس يحط بعقله ذا الشي , لاكن مهي مشكله راح اعطيك مثال صغير عن حفظ الكلام في ايديت او جلبه edit = guiCreateEdit (....) save = guiCreateButton (....) addEventHandler ("onClientResourceStart", resourceRoot, function () -- اول ما يشتغل local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف if not xml then return end -- اذا ما كان موجود يوقف الوظيفه local child = xmlFindChild (xml, "TheText", 0 ) -- نجيب مكان الكتابه if (child) then -- اذا مكان الكتابه موجود local text = xmlNodeGetValue (child) -- نجيب الكلام guiSetText (edit, text) -- نكتبه end end ) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == save) then -- اذا كان الزر زر الحفظ local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف local child = xmlFindChild (xml, "TheText", 0 ) or xmlCreateChild (xml, "TheText") -- نجيب مكان الكتابه xmlNodeSetValue (child, guiGetText (edit)) -- نكتب الكلام في مكان الكتابه xmlSaveFile (xml) -- نحفظ الملف xmlUnloadFile (xml) -- نقفل الملف end end ) ممكن توضح اكثر لو سمحت ايش Text و TheText ومشكور Link to comment
yazan Posted April 20, 2015 Share Posted April 20, 2015 text ;rootNodeName: the name of the root node in the XML document. TheText tagName: This is the name of the child node you wish to find (case-sensitive). Link to comment
I_Mr.[T]he[P]rInCe Posted April 25, 2015 Author Share Posted April 25, 2015 الاكس ام ل , انا اشوف انه ماهو بذيك الصعوبهلاكن بعض الناس يحط بعقله ذا الشي , لاكن مهي مشكله راح اعطيك مثال صغير عن حفظ الكلام في ايديت او جلبه edit = guiCreateEdit (....) save = guiCreateButton (....) addEventHandler ("onClientResourceStart", resourceRoot, function () -- اول ما يشتغل local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف if not xml then return end -- اذا ما كان موجود يوقف الوظيفه local child = xmlFindChild (xml, "TheText", 0 ) -- نجيب مكان الكتابه if (child) then -- اذا مكان الكتابه موجود local text = xmlNodeGetValue (child) -- نجيب الكلام guiSetText (edit, text) -- نكتبه end end ) addEventHandler ("onClientGUIClick", resourceRoot, function () if (source == save) then -- اذا كان الزر زر الحفظ local xml = xmlLoadFile ("Save.xml") or xmlCreateFile ("Save.xml", "Text") -- نفتح الملف local child = xmlFindChild (xml, "TheText", 0 ) or xmlCreateChild (xml, "TheText") -- نجيب مكان الكتابه xmlNodeSetValue (child, guiGetText (edit)) -- نكتب الكلام في مكان الكتابه xmlSaveFile (xml) -- نحفظ الملف xmlUnloadFile (xml) -- نقفل الملف end end ) وضح اكتر لاهنت Link to comment
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