+Source|> Posted June 5, 2018 Share Posted June 5, 2018 هنا ابي اسوي لما اللاعب يسجل يجي حسابه بالجريد ليست بس المشكله انه لما يسجل اكثر من مره اسمه يجي كثيير ابيه يجي مره بس بالجريد ليست -- 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
Doffy Posted June 5, 2018 Share Posted June 5, 2018 (edited) Deleted Edited June 5, 2018 by #DesTroeyR Link to comment
Ram, Posted June 5, 2018 Share Posted June 5, 2018 41 minutes ago, +Source|> said: addEventHandler("onPlayerLogin", root, حاطها ب كلنت !؟ تقول فوق --client ? Link to comment
Doffy Posted June 5, 2018 Share Posted June 5, 2018 Just now, AbU - W6N said: حاطها ب كلنت !؟ تقول فوق --client ? هو يقصد سيرفر لانه اصلا لو حاطها بكلنت ما كان اشتغل -.- 2 Link to comment
+Source|> Posted June 5, 2018 Author Share Posted June 5, 2018 Just now, AbU - W6N said: حاطها ب كلنت !؟ تقول فوق --client ? لالا العكس بالسيرفر Link to comment
Doffy Posted June 5, 2018 Share Posted June 5, 2018 (edited) عندي فكرة لك افضل ليش م تسوي تحقق من اسم الحساب الموجود باللوحة عن طريقة string.find guiGridListRemoveRow وبعدين تسوي حذف لاسم الحساب المكرر من السكل Edited June 5, 2018 by #DesTroeyR 1 Link to comment
#\_oskar_/# Posted June 5, 2018 Share Posted June 5, 2018 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) جرب 1 1 Link to comment
+Source|> Posted June 5, 2018 Author Share Posted June 5, 2018 (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 June 5, 2018 by +Source|> Link to comment
MrBiG Posted June 5, 2018 Share Posted June 5, 2018 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now