Jump to content

طلب تعديل


Recommended Posts

Posted

هنا ابي اسوي لما اللاعب يسجل يجي حسابه بالجريد ليست

 

بس المشكله انه لما يسجل اكثر من مره

 

اسمه يجي كثيير

 

ابيه يجي مره بس بالجريد ليست

 

-- client

addEvent ( 'AddInGrid2' , true )
addEventHandler ( 'AddInGrid2' , root ,
	function( Table )
		guiGridListClear( allAccountsGrid )
		for i, v in ipairs( Table ) do
		local Rowgg = guiGridListAddRow( allAccountsGrid )
		guiGridListSetItemText( allAccountsGrid, Rowgg, 1, v.accountP , false, false )
		guiGridListSetItemColor( allAccountsGrid, Rowgg, 1, 0, 255, 255 )
		end
	end
)

-- client

addEvent ( 'Refresh_2' , true )
addEventHandler ( 'Refresh_2' , root , 
	function ()
	local aSQL2c = executeSQLQuery ( 'SELECT * FROM AccountPlayers' )
		if ( #aSQL2c ~= 0 ) then 
			triggerClientEvent ( root, 'AddInGrid2' , root , aSQL2c )
		end 
	end 
)

addEventHandler("onPlayerLogin", root,
	function()
	local accountP = getAccountName( getPlayerAccount( source ) )
		triggerEvent ( 'Refresh_2' , root )
		executeSQLQuery( "INSERT INTO AccountPlayers ( accountP ) VALUES( ? )", accountP )
	end
)

 

Posted
Just now, AbU - W6N said:

حاطها ب كلنت !؟ 
تقول فوق 
--client ?

هو يقصد سيرفر

لانه اصلا لو حاطها بكلنت ما كان اشتغل -.-

  • Like 2
Posted (edited)

عندي فكرة لك افضل

ليش م تسوي تحقق من اسم الحساب الموجود باللوحة عن طريقة
string.find

guiGridListRemoveRow

وبعدين تسوي حذف لاسم الحساب المكرر من السكل

Edited by #DesTroeyR
  • Like 1
Posted
addEventHandler("onPlayerLogin", root,function()
local accountP = getAccountName( getPlayerAccount( source ) )
local aSQL2c = executeSQLQuery ( 'SELECT * FROM AccountPlayers WHERE accountP=?' ,accountP)
if ( #aSQL2c > 0 ) then return triggerEvent ( 'Refresh_2' , root ) end
executeSQLQuery( "INSERT INTO AccountPlayers ( accountP ) VALUES( ? )", accountP )
end)

جرب

  • Thanks 1
  • Confused 1

TehLMGN.png?1

 

سبحان الله وبحمده سبحان الله العظيم

Posted (edited)
14 minutes ago, #\_oskar_/# said:

addEventHandler("onPlayerLogin", root,function()
local accountP = getAccountName( getPlayerAccount( source ) )
local aSQL2c = executeSQLQuery ( 'SELECT * FROM AccountPlayers WHERE accountP=?' ,accountP)
if ( #aSQL2c > 0 ) then return triggerEvent ( 'Refresh_2' , root ) end
executeSQLQuery( "INSERT INTO AccountPlayers ( accountP ) VALUES( ? )", accountP )
end)

جرب

ظبط

شكراً

 

Edited by +Source|>
Posted
4 minutes ago, +Source|> said:

 

-- client

addEvent ( 'AddInGrid2' , true )
addEventHandler ( 'AddInGrid2' , root ,
	function( Table )
		guiGridListClear( allAccountsGrid )
		for i, v in ipairs( Table ) do
		local Rowgg = guiGridListAddRow( allAccountsGrid )
		guiGridListSetItemText( allAccountsGrid, Rowgg, 1, v.accountP , false, false )
		guiGridListSetItemColor( allAccountsGrid, Rowgg, 1, 0, 255, 255 )
		end
	end
)

-- client

addEvent ( 'Refresh_2' , true )
addEventHandler ( 'Refresh_2' , root , 
	function ()
	local aSQL2c = executeSQLQuery ( 'SELECT * FROM AccountPlayers' )
		if ( #aSQL2c ~= 0 ) then 
			triggerClientEvent ( root, 'AddInGrid2' , root , aSQL2c )
		end 
	end 
)

addEventHandler("onPlayerLogin", root,
	function()
		local accountP = getAccountName( getPlayerAccount( source ) )
		if ( not getAccountData ( getPlayerAccount ( source ) , 'inGrid' ) ) then 
			setAccountData ( getPlayerAccount ( source ) , 'inGrid' , true )
			executeSQLQuery ( "INSERT INTO AccountPlayers ( accountP ) VALUES( ? )" , accountP )
			triggerEvent ( 'Refresh_2' , root )
		else 
			triggerEvent ( 'Refresh_2' , root ) -- تستطيع الغاء عدم تحقق الشرط 
		end
	end
)

 

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