Mhmd.z Posted January 5, 2016 Share Posted January 5, 2016 السلام عليكم ورحمة الله وبركاته ابي تصحيح كود لحفظ الالمنت , انا مسوي انه يعطي الاعب المنت لما ياخذ الوظيفه كذه: local account = getPlayerAccount ( source ) setElementData( source, "Job", "playerInJob", true ) setAccountData( account,"Job",tostring( getElementData( source, "Job", true ))) ذي بس ياخذ الوظيفه الحين لو الاعب دخل وخرج ما تحفظ, انا جربت احفظها بالاكونت وكذه طلع معي function onPlayerQuit() local playerAccount = getPlayerAccount(source) if (playerAccount) then local jobPlayer = getElementData( source, "Job" ) setAccountData(playerAccount, "playerJob", jobPlayer) end end addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) -- add an event handler function onPlayerLogin() local playerAccount = getPlayerAccount(source) if (playerAccount) then local jobPlayer = getAccountData(playerAccount, "playerJob") if (jobPlayer) then setAccountData( source,"Job") end end end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) Link to comment
SycroX Posted January 5, 2016 Share Posted January 5, 2016 (edited) function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount(source))) then local accountData = getAccountData (theCurrentAccount, "Job") if (accountData) then local playerData = getAccountData(theCurrentAccount, "Job") setElementData(source, "Job", playerData) end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) function onQuit() if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData(account,"Job", getElementData(source, "Job")) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) مشكلتك فسطر 15 مسوي يحط الأكونت داتا Job بس مو مسوي بقا true ولا false Edited January 5, 2016 by Guest Link to comment
Me[Z]oO Posted January 5, 2016 Share Posted January 5, 2016 function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount(source))) then local accountData = getAccountData (theCurrentAccount, "Job") if (accountData) then local playerData = getAccountData(theCurrentAccount, "Job") setElementData(source, "Job", playerData) end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) function onQuit() if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then setAccountData(account,"Job", getElementData(source, "Job")) end end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) مشكلتك فسطر 15 مسوي يحط الأكونت جاتا Job بس مو مسوي بقا true ولا false في كلب يجري وراك ذذ اكتب براحة ض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