Jump to content

طلب تعديل


Recommended Posts

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

 

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

 

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

 

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

 

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

 

Link to comment
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|>
Link to comment
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
)

 

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