iMr ~ MnHmAr Posted September 8, 2016 Share Posted September 8, 2016 (edited) لدي مشكله في السكا لما اطلع وادخل ماتحفظ الفل آلآكواد addEventHandler('onResourceStart',resourceRoot, function ( ) CreateTable = executeSQLQuery ('CREATE TABLE IF NOT EXISTS `Save LeveL System` (Account,Data1,Data2) ') end ) exports.scoreboard:addScoreboardColumn('KillS') exports.scoreboard:addScoreboardColumn('LeVeL') Tabel = {} addEventHandler ( "onPlayerJoin", root, function() setElementData(source, "KillS", 0) setElementData(source, "LeVeL", 0) end ) addEventHandler( 'onPlayerWasted', root, function(_,Kill) if Kill ~= source and getElementType(Kill) == 'player' then local Killer = getPlayerAccount(Kill) if (Killer) then setElementData(Kill, "KillS", (getElementData(Kill, "KillS") or 0) + 1) if (getElementData(Kill, "KillS") == 25 ) then setElementData(Kill, "LeVeL", (getElementData(Kill, "LeVeL") or 0) + 1) end end end end ) addEventHandler('onPlayerQuit',root, function ( ) local _LeveL = executeSQLQuery("SELECT * FROM `Save LeveL System` WHERE Account=?",getPlayerAccount(source) ) if ( type ( _LeveL) == "table" and #_LeveL == 0 or not _LeveL ) then executeSQLQuery ( "INSERT INTO `Save Position System` ( Account,Data1,Data2 ) VALUES(?,?,?)",getPlayerAccount(source),getElementData(Kill, "KillS") or 0,getElementData(Kill, "LeVeL") or 0 ) else executeSQLQuery('UPDATE `Save LeveL System` SET Data1 =?, Data2 =? WHERE Account =?',(getElementData(Kill, "KillS") or 0),(getElementData(Kill, "LeVeL") or 0),getPlayerAccount(source) ) end end ) addEventHandler('onPlayerLogin',root, function ( ) local _LeveL = executeSQLQuery("SELECT * FROM `Save LeveL System` WHERE Account=?",getPlayerAccount(source) ) if ( type ( _LeveL ) == "table" and #_LeveL == 0 or not _LeveL ) then return end setElementData(source, "KillS", Data1 or 0) setElementData(source, "LeVeL", Data2 or 0) end ) Edited September 8, 2016 by back!_ Link to comment
ALw7sH Posted September 8, 2016 Share Posted September 8, 2016 سطر 42 و 44 في getElementData الالمنت Kill ماهو معرف Link to comment
iMr ~ MnHmAr Posted September 8, 2016 Author Share Posted September 8, 2016 Just now, ALw7sH said: سطر 42 و 44 في getElementData الالمنت Kill ماهو معرف آبدله بي سورس؟ Link to comment
iMr ~ MnHmAr Posted September 9, 2016 Author Share Posted September 9, 2016 يب حطيت سورس الا االان مايحفظ وش السبب Link to comment
iMr ~ MnHmAr Posted September 9, 2016 Author Share Posted September 9, 2016 آرجوع آلرد ^^ 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