Jump to content

مشكلة كود pairs


Recommended Posts

السلام عليكم

مشكله بسيطه , الصاق التاب باللوحه , الخطا  السطر 4

Bad argument #1 to 'pairs' (table expected, got number)

شكراا مقدما ..

local factionTable = getElementData(getLocalPlayer(), "faction")
		local organizedTable = {}
		
		for i, k in pairs(factionTable) do													
		 organizedTable[k] = i
		end
		
		--#Hulk
		for k, id in ipairs(organizedTable) do
			if id ~= factionID then
				ftab[id] = guiCreateTab(getFactionName(id), ftabs)
				setElementData(ftab[id], "factionID", id)
				addEventHandler("onClientGUITabSwitched", ftab[id], loadFaction, false)	
		end
	end	

 

Link to comment
23 minutes ago, #Hulk said:

السلام عليكم

مشكله بسيطه , الصاق التاب باللوحه , الخطا  السطر 4

Bad argument #1 to 'pairs' (table expected, got number)

شكراا مقدما ..


local factionTable = getElementData(getLocalPlayer(), "faction")
		local organizedTable = {}
		
		for i, k in pairs(factionTable) do													
		 organizedTable[k] = i
		end
		
		--#Hulk
		for k, id in ipairs(organizedTable) do
			if id ~= factionID then
				ftab[id] = guiCreateTab(getFactionName(id), ftabs)
				setElementData(ftab[id], "factionID", id)
				addEventHandler("onClientGUITabSwitched", ftab[id], loadFaction, false)	
		end
	end	

 

 

2 minutes ago, Master_MTA said:

وريني تعريفها

ايه المشكله ف اللوب بتاع FactionTable ?

Link to comment
7 minutes ago, Master_MTA said:

Bad argument #1 to 'pairs' (table expected, got number)

بيقول التيبل المتوقع رجع برقم مش بتيبل

طيب اللوب الي تحت شغال تمام , ! حل ؟

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