Answer the question
In order to leave comments, you need to log in
MtaLUA. Why doesn't it work?
Hello. Why does getPlayerAccount() return nil etc.?
I tried to write both getPlayerAccount(source) and getPlayerAccount(player) and getPlayerAccount(thePlayer) but all in vain. I do everything according to the lesson and it works there. I also checked with the mta wiki and everything is correct there. Why doesn't it work?
function quitPlayer()
local acc = getPlayerAccount()
if acc and not isGuestAccount(acc) then
setAccountData(acc, 'money', getPlayerMoney(player))
setAccountData(acc, 'health', getElementHealth (player))
end
end
addEventHandler ( "onPlayerQuit", root, quitPlayer )
Answer the question
In order to leave comments, you need to log in
The parentheses do not specify the element for which we will check the account
In the onPlayerQuit inventory, the player is source
Replace getPlayerAccount() with getPlayerAccount( source )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question