iMr.SFA7 Posted July 2, 2015 Share Posted July 2, 2015 السلام عليكم ورحمه الله وبركاته آحببت اليوم آن آتعلم ال SQLite قرأت بعض الشروحات عنهآ وقلت آسوي سكربت حفظ فلوس اللاعب ع السيريال بأستخدام SQLite لاكن ماضبط addEventHandler ("onResourceStart",resourceRoot, function ( ) local Create = executeSQLQuery("CREATE TABLE IF NOT EXISTS `SAVE_MONEY` (PlayerMoney,PlayerSerial)") if ( Create ) then outputDebugString ("Create [ SAVE_MONEY ] Started") end end ) addEventHandler ("onPlayerQuit",root, function ( ) local TheMoney = getPlayerMoney ( source ) local Select = executeSQLQuery("SELECT * FROM `SAVE_MONEY` WHERE PlayerSerial=?",getPlayerSerial ( source )) if ( type ( Select ) == "table" and #Select == 0 or not Select ) then executeSQLQuery("INSERT INTO `SAVE_MONEY`(PlayerSerial,PlayerMoney) VALUES(?,?,?)",getPlayerSerial ( source ) , TheMoney) else executeSQLQuery("UPDATE `SAVE_MONEY` SET PlayerMoney = ? WHERE PlayerSerial=?", TheMoney,getPlayerSerial ( source )) end end ) addEventHandler ("onPlayerLogin",root, function ( ) local Select = executeSQLQuery("SELECT * FROM `SAVE_MONEY` WHERE PlayerSerial=?",getPlayerSerial ( source )) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end setPlayerMoney (source,Select[1]["PlayerMoney"]) end ) لا شيء بالدي بق غير الملاحظة التي وضعتها عند أنشاء التيبل outputDebugString ("Create [ SAVE_MONEY ] Started") ^ Link to comment
</Mr.Tn6eL> Posted July 2, 2015 Share Posted July 2, 2015 executeSQLQuery("INSERT INTO `SAVE_MONEY`(PlayerSerial,PlayerMoney) VALUES(?,?,?)",getPlayerSerial ( source ) , TheMoney) الى executeSQLQuery("INSERT INTO `SAVE_MONEY`(PlayerSerial,PlayerMoney) VALUES(?,?)",getPlayerSerial ( source ) , TheMoney) + انت حاطه اذ سجل دخوله يعطيه الفلوس Link to comment
iMr.SFA7 Posted July 2, 2015 Author Share Posted July 2, 2015 executeSQLQuery("INSERT INTO `SAVE_MONEY`(PlayerSerial,PlayerMoney) VALUES(?,?,?)",getPlayerSerial ( source ) , TheMoney) الى executeSQLQuery("INSERT INTO `SAVE_MONEY`(PlayerSerial,PlayerMoney) VALUES(?,?)",getPlayerSerial ( source ) , TheMoney) ما ضبط انت حاطه اذ سجل دخوله يعطيه الفلوس هذا المطلوب Link to comment
iMr.SFA7 Posted July 2, 2015 Author Share Posted July 2, 2015 Select المفروض Results سطر 26 حاط مششكور أشتغل Link to comment
I_Mr.[T]he[P]rInCe Posted July 8, 2015 Share Posted July 8, 2015 انت ممكن تحفظ الفلوس في أكونت اللاعب أسهل بكثير من Sqlite Link to comment
iMr.SFA7 Posted July 8, 2015 Author Share Posted July 8, 2015 انت ممكن تحفظ الفلوس في أكونت اللاعب أسهل بكثير من Sqlite حفظ الفلوس حطيته كـ مثال فقط هدفي هو تعلم الـ SQLite .. ! 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