Jump to content

تصحيح كود


Mhmd.z

Recommended Posts

السلام عليكم ورحمة الله وبركاته

ابي تصحيح كود لحفظ الالمنت , انا مسوي انه يعطي الاعب المنت لما ياخذ الوظيفه كذه:

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
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 by Guest
Link to comment
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

امزح :D

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...