Jump to content

ساعده لو سمحتوا


Recommended Posts

function gridRe()
guiGridListClear( grid )
for i, v in ipairs( Ques ) do
local row = guiGridListAddRow( grid )
guiGridListSetItemText( grid, row, 1, i .. ' -', false, false )
guiGridListSetItemText( grid, row, 2, tostring( v[1] ), false, false )
guiGridListSetItemColor( grid, row, 1, 255, 230, 58, 255 )
guiGridListSetItemColor( grid, row, 2, math.random( 255 ), math.random( 255 ), math.random( 255 ) )
end
end

function wnd_W( Rank, Owners )
local ee = guiGridListGetItemText( grid, guiGridListGetSelectedItem( grid ), 2 )
	if ee == 'كيف أحصل على رتبة ؟' then
		guiSetText( ansrmemo, Rank )
	elseif ee == 'من هم أصحـاب السـيرفـر ؟' then
		guiSetText( ansrmemo, Owners )
	end
end
addEventHandler('onClientGUIClick', root, wnd_W )


Rank = xmlLoadFile( "Rank.xml" )
Rank1 = xmlNodeGetValue( Rank )
Owners = xmlLoadFile( "Owners.xml" )
Owners1 = xmlNodeGetValue( Owners )
wnd_W ( Rank1, Owners1 )	

وش الخطأ؟؟

Link to comment
4 minutes ago, Source|> said:

function gridRe()
guiGridListClear( grid )
for i, v in ipairs( Ques ) do
local row = guiGridListAddRow( grid )
guiGridListSetItemText( grid, row, 1, i .. ' -', false, false )
guiGridListSetItemText( grid, row, 2, tostring( v[1] ), false, false )
guiGridListSetItemColor( grid, row, 1, 255, 230, 58, 255 )
guiGridListSetItemColor( grid, row, 2, math.random( 255 ), math.random( 255 ), math.random( 255 ) )
end
end

function wnd_W( Rank, Owners )
local ee = guiGridListGetItemText( grid, guiGridListGetSelectedItem( grid ), 2 )
	if ee == 'كيف أحصل على رتبة ؟' then
		guiSetText( ansrmemo, Rank )
	elseif ee == 'من هم أصحـاب السـيرفـر ؟' then
		guiSetText( ansrmemo, Owners )
	end
end
addEventHandler('onClientGUIClick', root, wnd_W )


Rank = xmlLoadFile( "Rank.xml" )
Rank1 = xmlNodeGetValue( Rank )
Owners = xmlLoadFile( "Owners.xml" )
Owners1 = xmlNodeGetValue( Owners )
wnd_W ( Rank1, Owners1 )	

وش الخطأ؟؟

الحين ايش تبي تسوي بلضبط ؟

لو تبي تسويه هيك سوي افضل شئ جدول  مش لازم xml

Link to comment
5 minutes ago, Source|> said:

طيب الحين لو ابي اكتب بالميمو كلام كثير

كيف؟

 تسوي n/والكلام لو تبي تسوي انتر
 

ثوان بعطيك مثال

help = {
{"من هم صحاب السيرفر ؟","+Source|> - Mr.6rB"},
{"من هم صحاب السيرفر ؟","+Source|> - Mr.6rB"}, -- إلخ
{"من هم صحاب السيرفر ؟","+Source|> - Mr.6rB"}, -- إلخ
}

for i,k in ipairs (help) do
cff = guiGridListAddRow (grid)
guiGridListSetItemText (grid,cff,1,k[1],false,false)
guiGridListSetItemData (grid,cff,1,k[2])
guiGridListSetItemColor(grid,cff,1,math.random(255),math.random(255),math.random(255))
end

addEventHandler("onClientGUIClick",grid,
function()
local seld = guiGridListGetSelectedItem(grid)
if seld ~= -1 then
local data = guiGridListGetItemData(grid,guiGridListGetSelectedItem (grid) ,2)
guiSetText(ansrmemo, data)
end
end,false)

 

Edited by #_'Lu[F]Fy
Link to comment
function gridRe()
guiGridListClear( grid )
for i, v in ipairs( Ques ) do
local row = guiGridListAddRow( grid )
guiGridListSetItemText( grid, row, 1, i .. ' -', false, false )
guiGridListSetItemText( grid, row, 2, tostring( v[1] ), false, false )
guiGridListSetItemColor( grid, row, 1, 255, 230, 58, 255 )
guiGridListSetItemColor( grid, row, 2, math.random( 255 ), math.random( 255 ), math.random( 255 ) )
end
end

-- code
function getNameAdmin (file,str,numberss,types,numbertypes) 
if type(file) == "string" and type(str) == "string" and type(numberss) == "number" then 
local root = xmlLoadFile (file)
local node = xmlFindChild (root,str,numberss)
local inte = xmlFindChild (node,types,numbertypes)
local info = xmlNodeGetValue ( inte )
return info 
end
end 

function wnd_W( )
local ee = guiGridListGetItemText( grid, guiGridListGetSelectedItem( grid ), 2 )
	if ee == 'من هم أصحـاب السـيرفـر ؟' then
	for i = 0,1 do 
	m = getNameAdmin("namexml.xml","Admins",0,"Admin",i)
   guiSetText( ansrmemo,""..m.."")
	       end
	end
end
addEventHandler('onClientGUIClick', root, wnd_W )
<root>
      <Admins>
        <Admin>Source</Admin>
		<Admin>Mr.6rB</Admin>
      </Admins>
</root>

 

Link to comment

وعليكم السلام ! 9_9

Xml File (questions.xml) :

<questions>
	<question question="من هم اصحاب السيرفر">
		<answer>Source</answer>
		<answer>Anotherone</answer>
	</question>
</questions>

Client :
 

local gridlist = gridlist -- put  your gridlist here
local memo = memo -- put your memo here
local xml = xmlLoadFile("questions.xml")
for index, node in pairs ( xmlNodeGetChildren ( xml ) ) do
	local question = xmlNodeGetAttribute ( node, "question" )
  	local answers = { }
	for key, answer in pairs ( xmlNodeGetChildren ( node ) ) do
		table.insert ( answers, xmlNodeGetValue( answer ) )
	end
  	local row = guiGridListAddRow ( gridlist )
	guiGridListSetItemText ( gridlist, row, 1, question .."?", false, false )
	guiGridListSetItemData ( gridlist, row, 1,  answers )
end
xmlUnloadFile(xml) 
addEventHandler ( "onClientGUIClick", root,
  	function ( )
		if source == gridlist then
			local selected = guiGridListGetSelectedItem ( gridlist )
			if selected ~= -1 then
				guiSetText ( memo, table.concat( guiGridListGetItemData ( gridlist, selected ), '\n' ) )
			end
		end
    end
)

 

Edited by iMr.WiFi..!
  • Like 2
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...