jakson Posted June 25, 2019 Share Posted June 25, 2019 (edited) هلا شباب كيفكم اليوم عندي مشكله في الكود حقي مسوين مود ليفل و عندي مشكله فيه المشكله هي بل سيف يعني الكود شغال تمام و بيجي بي بعض الاحيان بيلخبط يعني مثلا لو لاعب طلع ليفل 20 و فضل يزيد اكثر بيفضل شغال معاه تمام لاحد لما يجي يوم بدون اي اسباب او اي شيئ اليفل شتمسح و يرجع الاعب ليفل 1 تاني فا لو حد عنده حل ياريت ما يبخل علي او لو فيه طريقه اخري للحفظ علي مستوي الاعبب في اليفل ما يبخل علي و يقول الكود function saveInfo() local account = getPlayerAccount(source) local killLevel = getElementData(source,"kill.level") local Level = getElementData(source,"Level") local kills = getElementData(source,"Kills") local deaths = getElementData(source,"Deaths") local walking = getElementData(source,"walks") setAccountData(account,"kill.level",killLevel) setAccountData(account,"Level",Level) setAccountData(account,"walks",walking) setAccountData(account,"Kills",kills) setAccountData(account,"Deaths",deaths) end addEventHandler("onPlayerQuit",root,saveInfo) function getInfo(per,cur) local killLevel = getAccountData(cur,"kill.level") local walking = getAccountData(cur,"walks") local Level = getAccountData(cur,"Level") local kills = getAccountData(cur,"Kills") local deaths = getAccountData(cur,"Deaths") setElementData(source,"kill.level",killLevel) setElementData(source,"Level",Level) setElementData(source,"Kills",kills) setElementData(source,"walks",walking) setElementData(source,"Deaths",deaths) setElementData(source,"loggedin",true) end addEventHandler("onPlayerLogin",root,getInfo) و مشكورين Edited June 25, 2019 by jakson Link to comment
+Source|> Posted June 25, 2019 Share Posted June 25, 2019 27 minutes ago, jakson said: هلا شباب كيفكم اليوم عندي مشكله في الكود حقي مسوين مود ليفل و عندي مشكله فيه المشكله هي بل سيف يعني الكود شغال تمام و بيجي بي بعض الاحيان بيلخبط يعني مثلا لو لاعب طلع ليفل 20 و فضل يزيد اكثر بيفضل شغال معاه تمام لاحد لما يجي يوم بدون اي اسباب او اي شيئ اليفل شتمسح و يرجع الاعب ليفل 1 تاني فا لو حد عنده حل ياريت ما يبخل علي او لو فيه طريقه اخري للحفظ علي مستوي الاعبب في اليفل ما يبخل علي و يقول الكود function saveInfo() local account = getPlayerAccount(source) local killLevel = getElementData(source,"kill.level") local Level = getElementData(source,"Level") local kills = getElementData(source,"Kills") local deaths = getElementData(source,"Deaths") local walking = getElementData(source,"walks") setAccountData(account,"kill.level",killLevel) setAccountData(account,"Level",Level) setAccountData(account,"walks",walking) setAccountData(account,"Kills",kills) setAccountData(account,"Deaths",deaths) end addEventHandler("onPlayerQuit",root,saveInfo) function getInfo(per,cur) local killLevel = getAccountData(cur,"kill.level") local walking = getAccountData(cur,"walks") local Level = getAccountData(cur,"Level") local kills = getAccountData(cur,"Kills") local deaths = getAccountData(cur,"Deaths") setElementData(source,"kill.level",killLevel) setElementData(source,"Level",Level) setElementData(source,"Kills",kills) setElementData(source,"walks",walking) setElementData(source,"Deaths",deaths) setElementData(source,"loggedin",true) end addEventHandler("onPlayerLogin",root,getInfo) و مشكورين جربت تستخدم السكل 1 Link to comment
N3xT Posted June 25, 2019 Share Posted June 25, 2019 (edited) local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" }, function eventsHandler ( _, account ) if ( eventName == "onPlayerLogin" ) then for _, v in ipairs ( dataNames ) do local dataValue = getAccountData ( account, v ) if ( dataValue ) then setElementData ( source, v, dataValue ) end end setElementData ( source, "loggedin", true ) elseif ( eventName == "onPlayerQuit" ) then local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) then for _, v in ipairs ( dataNames ) do local dataValue = getElementData ( source, v ) if ( dataValue ) then setAccountData ( playerAccount, v, dataValue ) end end end end end addEventHandler ( "onPlayerLogin", root, eventsHandler ) addEventHandler ( "onPlayerQuit", root, eventsHandler ) Edited June 25, 2019 by N3xT 1 Link to comment
jakson Posted June 25, 2019 Author Share Posted June 25, 2019 2 hours ago, N3xT said: local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" }, function eventsHandler ( _, account ) if ( eventName == "onPlayerLogin" ) then for _, v in ipairs ( dataNames ) do local dataValue = getAccountData ( account, v ) if ( dataValue ) then setElementData ( source, v, dataValue ) end end setElementData ( source, "loggedin", true ) elseif ( eventName == "onPlayerQuit" ) then local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) then for _, v in ipairs ( dataNames ) do local dataValue = getElementData ( source, v ) if ( dataValue ) then setAccountData ( playerAccount, v, dataValue ) end end end end end addEventHandler ( "onPlayerLogin", root, eventsHandler ) addEventHandler ( "onPlayerQuit", root, eventsHandler ) يجيني ارور في "(" expected near "eventsHandler" Link to comment
nxFairlywell Posted June 26, 2019 Share Posted June 26, 2019 فيه فاصله في السطر الثاني من الكود اخر شي وخرها 1 Link to comment
+Source|> Posted June 26, 2019 Share Posted June 26, 2019 9 hours ago, jakson said: يجيني ارور في "(" expected near "eventsHandler" الخطأ local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" }, الصح local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" } 1 Link to comment
jakson Posted June 26, 2019 Author Share Posted June 26, 2019 15 hours ago, N3xT said: local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" }, function eventsHandler ( _, account ) if ( eventName == "onPlayerLogin" ) then for _, v in ipairs ( dataNames ) do local dataValue = getAccountData ( account, v ) if ( dataValue ) then setElementData ( source, v, dataValue ) end end setElementData ( source, "loggedin", true ) elseif ( eventName == "onPlayerQuit" ) then local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) then for _, v in ipairs ( dataNames ) do local dataValue = getElementData ( source, v ) if ( dataValue ) then setAccountData ( playerAccount, v, dataValue ) end end end end end addEventHandler ( "onPlayerLogin", root, eventsHandler ) addEventHandler ( "onPlayerQuit", root, eventsHandler ) للاسف جربته من الغد لليوم و بيه نفس المشكله Link to comment
N3xT Posted June 26, 2019 Share Posted June 26, 2019 شيل الفاصلة اللي بآخر السطر الأول زي ما قالوا لك الأخوان فوق Link to comment
jakson Posted June 26, 2019 Author Share Posted June 26, 2019 47 minutes ago, N3xT said: شيل الفاصلة اللي بآخر السطر الأول زي ما قالوا لك الأخوان فوق شلتها و شغلتها ولاكن بتواجهني نفس المشكله الي بل فنكشن القديم انا مشغلها من امبارح اكتشفت الخطئ من قبل ما يقولو عليه ولاكن فيه نفس الخطئ يعني كان اليفل بتاعي 25 من الغد و اليوم رجع 1 تاني Link to comment
SycroX Posted June 26, 2019 Share Posted June 26, 2019 3 hours ago, jakson said: شلتها و شغلتها ولاكن بتواجهني نفس المشكله الي بل فنكشن القديم انا مشغلها من امبارح اكتشفت الخطئ من قبل ما يقولو عليه ولاكن فيه نفس الخطئ يعني كان اليفل بتاعي 25 من الغد و اليوم رجع 1 تاني في وظيفه اخري تمسح اللفل , استعمل addDebugHook عشان تعرف في اي سطر او اي مود الي يخرب عليك الحفظ function onPreFunction ( sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ... ) local args = { ... } if functionName == "setElementData" and args [ 2 ] == "kill.level" then outputDebugString ( "DEBUG-HOOK : ' "..functionName.." ' [ ".. getResourceName ( sourceResource ) .."/"..luaFilename.."/"..luaLineNumber.." ]" ) end end addDebugHook ( "preFunction" , onPreFunction ) Link to comment
iMr.WiFi..! Posted June 27, 2019 Share Posted June 27, 2019 (edited) زي ماقال احمد, وبعد الكشف تخلص من المود لأنه بيأثر على اداء السيرفر بشكل عام Edited June 27, 2019 by iMr.WiFi..! Link to comment
#[K]iLLeR<3 Posted June 28, 2019 Share Posted June 28, 2019 (edited) المشكلة هي انك تعيد تشغيل السكربت و الناس مسجلة دخول ف لازم تعمل حدث لما يشتغل السكربت و لما يطفي ياخذ المعلومات للموجودين و يحفظها و تنحل Edited June 28, 2019 by #[K]iLLeR<3 1 Link to comment
jakson Posted June 28, 2019 Author Share Posted June 28, 2019 4 hours ago, #[K]iLLeR<3 said: المشكلة هي انك تعيد تشغيل السكربت و الناس مسجلة دخول ف لازم تعمل حدث لما يشتغل السكربت و لما يطفي ياخذ المعلومات للموجودين و يحفظها و تنحل اتفق معك و احيك علي زكائك بس كيف اسوي لما يطفي ياخذ المعلومات Link to comment
Hakan Posted June 28, 2019 Share Posted June 28, 2019 local dataNames = { "kill.level", "Level", "Kills", "Death", "walks" }, function eventsHandler ( _, account ) if ( eventName == "onPlayerLogin" ) then for _, v in ipairs ( dataNames ) do local dataValue = getAccountData ( account, v ) if ( dataValue ) then setElementData ( source, v, dataValue ) end end setElementData ( source, "loggedin", true ) elseif ( eventName == "onPlayerQuit" ) then local playerAccount = getPlayerAccount ( source ) if ( playerAccount ) then for _, v in ipairs ( dataNames ) do local dataValue = getElementData ( source, v ) if ( dataValue ) then setAccountData ( playerAccount, v, dataValue ) end end end elseif ( eventName == "onResourceStop" ) then for k,v in ipairs ( getElementsByType ( "player" ) ) do if ( not isGuestAccount ( getPlayerAccount ( v ) ) ) then for _,data in ipairs ( dataNames ) do if ( getElementData ( v , data ) ) then setAccountData ( getPlayerAccount ( v ) , data , getElementData ( v , data ) ) end end end end elseif ( eventName == "onResourceStart" ) then for k,v in ipairs ( getElementsByType ( "player" ) ) do if ( not isGuestAccount ( getPlayerAccount ( v ) ) ) then for _,data in ipairs ( dataNames ) do if ( getAccountData ( getPlayerAccount(v) , data ) ) then setElementData ( v , data , getAccountData ( getPlayerAccount ( v ) , data ) ) end end end end end end addEventHandler ( "onPlayerLogin", root, eventsHandler ) addEventHandler ( "onPlayerQuit", root, eventsHandler ) addEventHandler ( "onResourceStart", root, eventsHandler ) addEventHandler ( "onResourceStop", root, eventsHandler ) جرب هذا 1 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