Jump to content

x[استفسار]xبخصوص xml2


Recommended Posts

 addEventHandler ( "onClientGUIDoubleClick", root,
	function ( )
		local Selected = guiGridListGetSelectedItem ( GUIEditor.gridlist[7] )
		local GetText = guiGridListGetItemText( GUIEditor.gridlist[7], Selected, 2 )
		if source == GUIEditor.gridlist[7] then
			for Index, Node in ipairs ( xmlNodeGetChildren ( xml2 ) ) do
				if GetText == xmlNodeGetAttribute ( Node, "name" ) then
					guiGridListClear ( GUIEditor.gridlist[7] )
					for Index, Node in ipairs ( xmlNodeGetChildren ( Node ) ) do
					local mk=Node or xmlNodeGetChildren ( Node )
						local Row = guiGridListAddRow ( GUIEditor.gridlist[7] )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 1, "#" .. Index, false, false )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( mk, "name" ), false, false )
						guiGridListSetItemData ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( mk, "id" )) 

						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 1, 0, 191, 253 )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 2, 0, 191, 253 )
					end
				elseif GetText == "..." then
					guiGridListClear ( GUIEditor.gridlist[7] )
					for Index, Node in ipairs ( xmlNodeGetChildren ( xml2 ) ) do
						local Row = guiGridListAddRow ( GUIEditor.gridlist[7] )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 1, "#" .. Index, false, false )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( Node, "name" ), false, false )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 1, 0, 191, 253 )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 2, 0, 191, 253 )

					end
					else
if guiGridListGetItemData(GUIEditor.gridlist[7], Selected, 2) then

local x,y,z=getElementPosition(lpl)
local veh = createVehicle ( guiGridListGetItemData(GUIEditor.gridlist[7], Selected, 2), x+1.5, y+1.5, z+1.5, 0, 0, 0 )
					end
				end
			end
		end
	end
)

ما بطول عليكم الكود شغال لكن يجيب اكثر من سياره هل اقدر اعرف السبب

 

Link to comment

سوي جدول 

وعند السطر 33

خله يدخل السيارة في الجدول

وتحقق انه الجدول يساوي صفر

ودخل السيارة في الجدول 

وسوي else 

وتختار انت بنفسك 

يحذف السيارة الي قبل ولا يقول ما يقبل لانه في سيارة موجودة 

Link to comment
4 minutes ago, iMr.WiFi..! said:

سوي جدول 

وعند السطر 33

خله يدخل السيارة في الجدول

وتحقق انه الجدول يساوي صفر

ودخل السيارة في الجدول 

وسوي else 

وتختار انت بنفسك 

يحذف السيارة الي قبل ولا يقول ما يقبل لانه في سيارة موجودة 

سويت طريقه اسهل بكثير اخوي

 addEventHandler ( "onClientGUIDoubleClick", root,
	function ( )
		local Selected = guiGridListGetSelectedItem ( GUIEditor.gridlist[7] )
		local GetText = guiGridListGetItemText( GUIEditor.gridlist[7], Selected, 2 )
		if source == GUIEditor.gridlist[7] then
			for Index, Node in ipairs ( xmlNodeGetChildren ( xml2 ) ) do
				if GetText == xmlNodeGetAttribute ( Node, "name" ) then
					guiGridListClear ( GUIEditor.gridlist[7] )
					for Index, Node in ipairs ( xmlNodeGetChildren ( Node ) ) do
					local mk=Node or xmlNodeGetChildren ( Node )
						local Row = guiGridListAddRow ( GUIEditor.gridlist[7] )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 1, "#" .. Index, false, false )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( mk, "name" ), false, false )
						guiGridListSetItemData ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( mk, "id" )) 

						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 1, 0, 191, 253 )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 2, 0, 191, 253 )
					end
				elseif GetText == "..." then
					guiGridListClear ( GUIEditor.gridlist[7] )
					for Index, Node in ipairs ( xmlNodeGetChildren ( xml2 ) ) do
						local Row = guiGridListAddRow ( GUIEditor.gridlist[7] )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 1, "#" .. Index, false, false )
						guiGridListSetItemText ( GUIEditor.gridlist[7], Row, 2, xmlNodeGetAttribute ( Node, "name" ), false, false )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 1, 0, 191, 253 )
						guiGridListSetItemColor ( GUIEditor.gridlist[7], Row, 2, 0, 191, 253 )
						guiGridListSetItemData ( GUIEditor.gridlist[7], Row, 2, false) 

					end
					

				end
			end
		end
	end
)
 addEventHandler ( "onClientGUIDoubleClick", root,
	function ( )
		local Selected = guiGridListGetSelectedItem ( GUIEditor.gridlist[7] )
		local GetText = guiGridListGetItemText( GUIEditor.gridlist[7], Selected, 2 )
		if source == GUIEditor.gridlist[7] then
if guiGridListGetItemData(GUIEditor.gridlist[7], Selected, 2) then
ev("giveveh",lpl,guiGridListGetItemData(GUIEditor.gridlist[7], Selected, 2))

					end
					end
					end)

هذا الكلنت

اما السيرفر

addEvent("giveveh",true)
addEventHandler("giveveh",root,function(id)
if source then
local x,y,z=getElementPosition(source)
local veh = createVehicle ( id, x+1.5, y+1.5, z+1.5 )
if veh then
warpPedIntoVehicle(source,veh)
end
end
end
)

@iMr.WiFi..!

حتى طريقتك اخوي الغالي جربتها لكن للاسف يقولي ما يصلح لانها يوزر داتا 

على العموم يعطيك العافيه

Edited by Master_MTA
Link to comment
3 minutes ago, iMr.WiFi..! said:

سطر 43 

ماكتبت ترايقر .. 

في السيرفر 

السطر الثالث ماله داعي 

 

هذا فري روم كامل مسويه من الصفر

فاكيد بختصر ذذ

lpl=localPlayer
 

مثلا

function ev(evname,pp,m1,m2,m3,m4)
triggerServerEvent(evname,pp,m1,m2,m3,m4)
end

@iMr.WiFi..!

Edited by Master_MTA
Link to comment

+للي يبي يستفيد

addEvent("giveveh",true)
addEventHandler("giveveh",root,function(id,text)
if source then
local mastercar=getElementData ( source,'playercar' )

	if  theVehicle then 
	if  getElementType(mastercar ) == "vehicle" then
	
	destroyElement(mastercar)
	end
end
local x,y,z=getElementPosition(source)
local veh = createVehicle ( id, x+1.5, y+1.5, z+1.5 )
			setElementData(source, "playercar", veh)

if veh and text=="true" then
warpPedIntoVehicle(source,veh)
end
end
end
)

هذي طريقه كويسه لسحب السياره بدل الجداول

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...