Adham Posted June 26, 2017 Share Posted June 26, 2017 سلام عليكم اقدر اجيب اسم اللاعب عن طريق حسابه ؟ Link to comment
#kAsR Posted June 27, 2017 Share Posted June 27, 2017 نعم , 'onPlayerLogin' getPlayerName setAccountData getAccount getAccountData Link to comment
Abdul KariM Posted June 27, 2017 Share Posted June 27, 2017 getAccount getAccountPlayer getPlayerName Link to comment
^iiEcoo'x_) Posted June 27, 2017 Share Posted June 27, 2017 addEventHandler ( 'onResourceStart' , resourceRoot , function ( ) executeSQLQuery ( ' CREATE TABLE IF NOT EXISTS aSavedSystem_ ( aAcc_ , aName_ ) ' ) end ) function aSavedNick_ ( ) if ( not isGusetAccount ( getPlayerAccount ( source ) ) ) then local aResult_ = executeSQLQuery ( ' SELECT * FROM aSavedSystem_ WHERE aAcc_ = ? ' , getAccountName ( getPlayerAccount ( source ) ) ) if ( aResult_ ) then if ( type ( aResult_ ) == 'table' ) then if ( #aResult_ == 0 ) then executeSQLQuery ( ' INSERT INTO aSavedSystem_ ( aAcc_ , aName_ ) VALUES ( ? , ? ) ' , getAccountName ( getPlayerAccount ( source ) ) , getPlayerName ( source ) ) else executeSQLQuery ( ' UPDATE aSavedSystem_ SET aName_ = ? WHERE aAcc_ =?', getPlayerName ( source ) , getAccountName ( getPlayerAccount ( source ) ) ) end else error ( '* This is not a table ' ) end else error ( '* No results found ' ) end end end addEventHandler ( 'onPlayerLogin' , root , aSavedNick_ ) addEventHandler ( 'onPlayerQuit' , root , aSavedNick_ ) addEventHandler ( 'onPlayerChangeNick' , root , function ( _ , aNewNick_ ) local aResult_ = executeSQLQuery ( ' SELECT * FROM aSavedSystem_ WHERE aAcc_ = ? ' , getAccountName ( getPlayerAccount ( source ) ) ) if ( aResult_ ) then if ( type ( aResult_ ) == 'table' ) then if ( #aResult_ == 0 ) then executeSQLQuery ( ' INSERT INTO aSavedSystem_ ( aAcc_ , aName_ ) VALUES ( ? , ? ) ' , getAccountName ( getPlayerAccount ( source ) ) , aNewNick_ ) else executeSQLQuery ( ' UPDATE aSavedSystem_ SET aName_ = ? WHERE aAcc_ =?', aNewNick_ , getAccountName ( getPlayerAccount ( source ) ) ) end else error ( '* This is not a table ' ) end else error ( '* No results found ' ) end end ) Link to comment
Abdul KariM Posted June 27, 2017 Share Posted June 27, 2017 @#_iMr.[E]coo ترا مايحتاج كل هذا عشان اسم بس يستخدم الفنكشنات الي عطيته اياها وخلصنا Link to comment
^iiEcoo'x_) Posted June 27, 2017 Share Posted June 27, 2017 12 minutes ago, Abdul KariM said: @#_iMr.[E]coo ترا مايحتاج كل هذا عشان اسم بس يستخدم الفنكشنات الي عطيته اياها وخلصنا يزبط اذا كان خارج السيرفر بالفنكشنا الي اعطيته اياهن ؟ Link to comment
#kAsR Posted June 27, 2017 Share Posted June 27, 2017 @#_iMr.[E]coo سطر 8 مو كاتب اسم الوظيفة عدل 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