function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin)
if not (isGuestAccount (getPlayerAccount(source))) then
local accountData = getAccountData (theCurrentAccount, "money")
if (accountData) then
local playerMoney = getAccountData(theCurrentAccount, "money")
setPlayerMoney(source, playerMoney)
else
setPlayerMoney(source, 0)
end
end
end
addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
function onQuit()
if not (isGuestAccount (getPlayerAccount (source))) then
account = getPlayerAccount (source)
if (account) then
setAccountData(account,"money", tostring(getPlayerMoney(source)))
end
end
end
addEventHandler("onPlayerQuit", getRootElement(), onQuit)
Memo = guiCreateMemo(70,10,10,50,"Account Name",false,WND)
triggerServerEvent ( "setMoney",localPlayer,guiGetText( Memo ))
addEvent ( " setMoney",true)
addEventHandler( "setMoney",getRootElement(),
function()
givePlayerMoney(account,1000) -- اسم الاعب من حسابهaccountابي محل
end)