Jump to content

مساعده


Recommended Posts

السلام عليكم شباب 

 

 على حسب خبرتي فـ كيف اسويه بالمود ذا  xml معي مود انتقالات بس بغيت اقسم الاماكن لــ :  الاماكن الرئيسيه , الشوارع الخخ وهذا يتطلب ملف 

 

GUIEditor = {
    label = {},
    window = {},
}
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "# الانتقالات / Warp ~ !", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFF")

grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
guiGridListAddColumn(grid, "Positions", 0.9)
edit = guiCreateEdit(9, 25, 261, 24, "البحث / Search :", false, GUIEditor.window[1])
guiSetFont(edit,FontSearch)
move = guiCreateButton(53, 335, 166, 29, "[ انتقال / Warp ] !", false, GUIEditor.window[1])
label = guiCreateLabel(209, 366, 85, 24, "  ", false, GUIEditor.window[1])
guiLabelSetColor(label, 255, 0, 0)   

addEventHandler ("onClientGUIClick", root,
        function()
        if (source == ff) then
         guiSetVisible(GUIEditor.window[1], false)
         showCursor(false)
         guiSetInputEnabled(false)
        end
    end
)

  • Confused 1
Link to comment
  On 23/02/2019 at 08:39, MoHaMeD_Dz said:

 على حسب خبرتي فـ كيف اسويه بالمود ذا  xml معي مود انتقالات بس بغيت اقسم الاماكن لــ :  الاماكن الرئيسيه , الشوارع الخخ وهذا يتطلب ملف 

Expand  

شوف يغالي

اولا يبيلك تعرف فنكشنات الاكس ام ال

xmlCreateFile ; xmlLoadFile
xmlFindChild
xmlNodeGetValue

وبعد كدا تحطهم في جريد ليست او شيك بوكس المهم براحتك

يالتوفيق

  • Thanks 1
Link to comment
  On 23/02/2019 at 08:39, MoHaMeD_Dz said:

السلام عليكم شباب 

 

 على حسب خبرتي فـ كيف اسويه بالمود ذا  xml معي مود انتقالات بس بغيت اقسم الاماكن لــ :  الاماكن الرئيسيه , الشوارع الخخ وهذا يتطلب ملف 

 

GUIEditor = {
    label = {},
    window = {},
}
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "# الانتقالات / Warp ~ !", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFF")

grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
guiGridListAddColumn(grid, "Positions", 0.9)
edit = guiCreateEdit(9, 25, 261, 24, "البحث / Search :", false, GUIEditor.window[1])
guiSetFont(edit,FontSearch)
move = guiCreateButton(53, 335, 166, 29, "[ انتقال / Warp ] !", false, GUIEditor.window[1])
label = guiCreateLabel(209, 366, 85, 24, "  ", false, GUIEditor.window[1])
guiLabelSetColor(label, 255, 0, 0)   

addEventHandler ("onClientGUIClick", root,
        function()
        if (source == ff) then
         guiSetVisible(GUIEditor.window[1], false)
         showCursor(false)
         guiSetInputEnabled(false)
        end
    end
)

Expand  

انا اقدر اعطيك المود جاهز بدون تعب وبدون ملف xml

بس حاول بعمل اكواد وانشالله تزبط معك ^_^

Link to comment
  On 23/02/2019 at 08:39, MoHaMeD_Dz said:

السلام عليكم شباب 

 

 على حسب خبرتي فـ كيف اسويه بالمود ذا  xml معي مود انتقالات بس بغيت اقسم الاماكن لــ :  الاماكن الرئيسيه , الشوارع الخخ وهذا يتطلب ملف 

 

GUIEditor = {
    label = {},
    window = {},
}
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "# الانتقالات / Warp ~ !", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFF")

grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
guiGridListAddColumn(grid, "Positions", 0.9)
edit = guiCreateEdit(9, 25, 261, 24, "البحث / Search :", false, GUIEditor.window[1])
guiSetFont(edit,FontSearch)
move = guiCreateButton(53, 335, 166, 29, "[ انتقال / Warp ] !", false, GUIEditor.window[1])
label = guiCreateLabel(209, 366, 85, 24, "  ", false, GUIEditor.window[1])
guiLabelSetColor(label, 255, 0, 0)   

addEventHandler ("onClientGUIClick", root,
        function()
        if (source == ff) then
         guiSetVisible(GUIEditor.window[1], false)
         showCursor(false)
         guiSetInputEnabled(false)
        end
    end
)

Expand  

xml صعبة ع شخص مبتدئ ..

لا يعني أنها صعبة جداً..

فـ من الأفضل ان تستعمل الجدول ..

 

Link to comment
  On 23/02/2019 at 08:39, MoHaMeD_Dz said:

السلام عليكم شباب 

 

 على حسب خبرتي فـ كيف اسويه بالمود ذا  xml معي مود انتقالات بس بغيت اقسم الاماكن لــ :  الاماكن الرئيسيه , الشوارع الخخ وهذا يتطلب ملف 

 

GUIEditor = {
    label = {},
    window = {},
}
GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "# الانتقالات / Warp ~ !", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFF")

grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
guiGridListAddColumn(grid, "Positions", 0.9)
edit = guiCreateEdit(9, 25, 261, 24, "البحث / Search :", false, GUIEditor.window[1])
guiSetFont(edit,FontSearch)
move = guiCreateButton(53, 335, 166, 29, "[ انتقال / Warp ] !", false, GUIEditor.window[1])
label = guiCreateLabel(209, 366, 85, 24, "  ", false, GUIEditor.window[1])
guiLabelSetColor(label, 255, 0, 0)   

addEventHandler ("onClientGUIClick", root,
        function()
        if (source == ff) then
         guiSetVisible(GUIEditor.window[1], false)
         showCursor(false)
         guiSetInputEnabled(false)
        end
    end
)

Expand  

لو تستعمل الجداول تكون اسهل لك

مثال :

-- #EXAMPLE

x,y,z=2003.22,212.33,14

locations = {
	{ "Streets", { "First street", x, y, z }, { "Second street", x, y, z }, { "Third street", x, y, z } },
	{ "Main Locations", { "First location", x, y, z }, { "Second location", x, y, z }, { "Third location", x, y, z } },
	{ "Server Cities", { "First city", x, y, z }, { "Second city", x, y, z }, { "Third city", x, y, z } },
}


for i = 1, #locations do
	print ("Name : "..locations[i][1].. " & : "..locations[i][2][1].." & x, y, z = : "..locations[i][2][2]..","..locations[i][2][3]..","..locations[i][2][3])
	print ("Name : "..locations[i][1].. " & : "..locations[i][3][1].." & x, y, z = : "..locations[i][3][2]..","..locations[i][3][3]..","..locations[i][3][3])
	print ("Name : "..locations[i][1].. " & : "..locations[i][4][1].." & x, y, z = : "..locations[i][4][2]..","..locations[i][4][3]..","..locations[i][4][3])
end

 

Link to comment
  On 26/02/2019 at 15:42, NX_CI said:

لو تستعمل الجداول تكون اسهل لك

مثال :


-- #EXAMPLE

x,y,z=2003.22,212.33,14

locations = {
	{ "Streets", { "First street", x, y, z }, { "Second street", x, y, z }, { "Third street", x, y, z } },
	{ "Main Locations", { "First location", x, y, z }, { "Second location", x, y, z }, { "Third location", x, y, z } },
	{ "Server Cities", { "First city", x, y, z }, { "Second city", x, y, z }, { "Third city", x, y, z } },
}


for i = 1, #locations do
	print ("Name : "..locations[i][1].. " & : "..locations[i][2][1].." & x, y, z = : "..locations[i][2][2]..","..locations[i][2][3]..","..locations[i][2][3])
	print ("Name : "..locations[i][1].. " & : "..locations[i][3][1].." & x, y, z = : "..locations[i][3][2]..","..locations[i][3][3]..","..locations[i][3][3])
	print ("Name : "..locations[i][1].. " & : "..locations[i][4][1].." & x, y, z = : "..locations[i][4][2]..","..locations[i][4][3]..","..locations[i][4][3])
end

 

Expand  

احسك خوفتوا و تقدر تستخدم متغيرات داخل جدول واحد بس ويخففلك الاق

+

ما اشوف اي صعوبة في الاكس ام ال

كل السالفة

يفتح الملف

يجيب القيمة

يقفل الملف

Link to comment
  On 26/02/2019 at 20:36, MaStFa said:

الشخص الي يبي المود يقول لزم احصل ملف xml

يقصد meta.xml?

Expand  

لا يقصد ملف اكس ام ال من صنعوا هو

فية اسامي الاماكن واحداثيتها

وهو يبي يعرف ازاي يجيب اسامي الاماكن واحداثيتها من الملف

والحل يستخدم فنكشنات الاكس ام ال

 

  • Like 1
Link to comment
  On 26/02/2019 at 19:42, KillerX said:

مش مصدق ان هيا سهلة صح ؟؟

خلاص استخدم هريسة الجداول يا مستر تعقيد

:)

Expand  

سهله بالنسبة لك حبيبي بس هو ما يشوفها سهله , لو يشوفها سهله مانزل موضوع

ثاني شي , الإكس ام ال لها وظائف كثيرة في الويكي

xmlCopyFile
xmlCreateChild
xmlCreateFile
xmlDestroyNode
xmlFindChild
xmlLoadFile
xmlNodeGetAttribute
xmlNodeGetAttributes
xmlNodeGetChildren
xmlNodeGetName
xmlNodeGetParent
xmlNodeGetValue
xmlNodeSetAttribute
xmlNodeSetName
xmlNodeSetValue
xmlSaveFile
xmlUnloadFile

انت كاتب خطوات الحل و مو كاتب ايش يستخدم بالضبط

,,,

والجداول اسهل بالنسبة لطلبه

( أما سالفة اللاق و ما اللاق , هذي كلها ( كلام فاضي 

لا لاق ولا هم يحزنون .

Edited by NX_CI
  • Haha 1
Link to comment
-- #EXAMPLE

x,y,z=2003.22,212.33,14

locations = {
	{ "Streets", { { "First street", x, y, z }, { "Second street", x, y, z }, { "Third street", x, y, z } } },
	{ "Main Locations", { { "First location", x, y, z }, { "Second location", x, y, z }, { "Third location", x, y, z } } },
	{ "Server Cities", { { "First city", x, y, z }, { "Second city", x, y, z }, { "Third city", x, y, z } } },
};


GUIEditor = {
    label = {},
    window = {},
}

mainRow=nil

addEventHandler('onClientResourceStart',resourceRoot,
	function()
		GUIEditor.window[1] = guiCreateWindow(90, 86, 280, 390, "# الانتقالات / Warp ~ !", false)
		guiWindowSetSizable(GUIEditor.window[1], false)
		guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFFFFFFF")

		grid = guiCreateGridList(10, 53, 260, 272, false, GUIEditor.window[1])
		guiGridListAddColumn(grid, "Positions", 0.9)
		edit = guiCreateEdit(9, 25, 261, 24, "البحث / Search :", false, GUIEditor.window[1])
		guiSetFont(edit,FontSearch)
		move = guiCreateButton(53, 335, 166, 29, "[ انتقال / Warp ] !", false, GUIEditor.window[1])
		label = guiCreateLabel(209, 366, 85, 24, "  ", false, GUIEditor.window[1])
		guiLabelSetColor(label, 255, 0, 0)
		
		[[
			INSERT POSITION NAMES 
		]]

		for _, pos in ipairs (locations) do
			mainRow = guiGridListAddRow(grid);
			guiGridListSetItemText(grid,mainRow,1,pos[1],false,false);
			guiGridListSetItemData(grid,mainRow,1,pos[2])
		end
		addEventHandler('onClientGUIDoubleClick', root,
			function()
				if source == grid then
					local row, col = guiGridListGetSelectedItem(grid);
					if row ~= -1 and guiGridListGetItemText(grid,row,1) ~= ".." then
						local positionsData = guiGridListGetItemData(grid, row, 1);
						if positionsData then
							if type(positionsData) == "table" then
								clearMainRows();
								backRow = guiGridListAddRow(grid);
								guiGridListSetItemText(grid,backRow,1,"..",false,false)
								addEventHandler("onClientGUIDoubleClick", root, aBackFunc)
								for index=1, #positionsData do
									secondRow=guiGridListAddRow(grid);
									guiGridListSetItemText(grid,secondRow,1,positionsData[index][1],false,false);
									guiGridListSetItemData(grid,secondRow,1,{ positionsData[index][2],positionsData[index][3],positionsData[index][4] });
								end
							end
						end
					end
				end
			end
		)
	end
);


aBackFunc=function()
	return addMainRows();
end

function clearMainRows()
	local count = guiGridListGetRowCount(grid);
	if count == #locations then
		for i = 1, count do
			guiGridListRemoveRow(grid,i)
		end
		return true
	end
	return false
end


function addMainRows()
	local selectedRow, selectedColumn = guiGridListGetSelectedItem(grid);
	if selectedRow ~= -1 then
		local text=guiGridListGetItemText(grid,selectedRow,1);
		if text == '..' then
			guiGridListClear(grid);
			for k, pos in ipairs (locations) do
				mainRow = guiGridListAddRow(grid);
				guiGridListSetItemText(grid,mainRow,1,pos[1],false,false);
				guiGridListSetItemData(grid,mainRow,1,pos[2])
			end
			return true
		end
	end
	return false
end


addEventHandler ("onClientGUIClick", root,
        function()
        if (source == ff) then
			guiSetVisible(GUIEditor.window[1], false)
			showCursor(false)
			guiSetInputEnabled(false)
        end
    end
)



addEventHandler("onClientGUIDoubleClick", root,
	function()
		if source == grid then
			local row,col = guiGridListGetSelectedItem(grid);
			if row ~= -1 then
				if guiGridListGetItemText(grid,1,1) == ".." then
					if row > 1 then
						local pos = guiGridListGetItemData(grid,row-1,1);
						local x, y, z = pos[2],pos[3],pos[4]
						setElementPosition(localPlayer,x,y,z);
					end
				end
			end
		end
	end
);

 

Edited by NX_CI
Link to comment
  On 26/02/2019 at 21:59, NX_CI said:

سهله بالنسبة لك حبيبي بس هو ما يشوفها سهله , لو يشوفها سهله مانزل موضوع

ثاني شي , الإكس ام ال لها وظائف كثيرة في الويكي

xmlCopyFile
xmlCreateChild
xmlCreateFile
xmlDestroyNode
xmlFindChild
xmlLoadFile
xmlNodeGetAttribute
xmlNodeGetAttributes
xmlNodeGetChildren
xmlNodeGetName
xmlNodeGetParent
xmlNodeGetValue
xmlNodeSetAttribute
xmlNodeSetName
xmlNodeSetValue
xmlSaveFile
xmlUnloadFile

انت كاتب خطوات الحل و مو كاتب ايش يستخدم بالضبط

,,,

والجداول اسهل بالنسبة لطلبه

( أما سالفة اللاق و ما اللاق , هذي كلها ( كلام فاضي 

لا لاق ولا هم يحزنون .

Expand  

حلو اوي

اختار4  وظايف بس من الوظايف اللي انتا حاطتها

xmlLoadFile
xmlFindChild
xmlNodeGetValue
xmlUnloadFile

+

هو يبيها xml

:|

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...