Jorgito'Molina Posted April 8, 2013 Share Posted April 8, 2013 addEventHandler ( "onPlayerWasted", root, function ( totalAmmo, killer, killerWeapon, bodypart, stealth ) if ( killer ) then local account = getPlayerAccount ( killer ) if ( killer ~= source ) then setAccountData ( account, "Kills", tonumber ( getAccountData ( account, "Kills" ) or 0 ) +1 ) setElementData ( killer, "Kills", tonumber ( getAccountData ( account, "Kills" ) ) ) end end local accountSource = getPlayerAccount ( source ) setAccountData ( accountSource, "deaths", tonumber ( getAccountData ( accountSource, "deaths" ) or 0 ) +1 ) setElementData ( source, "deaths", tonumber ( getAccountData ( accountSource, "deaths" ) ) ) end ) addEventHandler("onPlayerLogout", root, function() local account = getPlayerAccount(source) setAccountData(source, "deathss", getElementData(account, "deaths")) end ) addEventHandler("onPlayerLogin", root, function() local account = getPlayerAccount(source) setElementData(source, "deaths", getAccountData(account, "deaths")) end ) to close the account, to close the account is the score Link to comment
Castillo Posted April 8, 2013 Share Posted April 8, 2013 I don't understand what is the problem. Link to comment
Jorgito'Molina Posted April 8, 2013 Author Share Posted April 8, 2013 the problem is that the score is close the account of the account. Link to comment
فاّرس Posted April 8, 2013 Share Posted April 8, 2013 You want onPlayerLogout save score ? Link to comment
codeluaeveryday Posted April 8, 2013 Share Posted April 8, 2013 I believe this is from my super bugged MTA:SA code, here you go buddy: addEventHandler("onPlayerWasted", root, function(totalAmmo, killer, killerWeapon, bodypart, stealth) if killer then if killer ~= source then setElementData(killer, "kills", (getElementData(killer, "kills") or 0) + 1) end end setElementData(source, "deaths", (getElementData(source, "deaths") or 0) + 1) end ) addEventHandler("onPlayerLogout", root, function(previousAcc, currentAcc) setAccountData(currentAcc, "deaths", getElementData(source, "deaths") or 0) setAccountData(currentAcc, "kills", getElementData(source, "kills") or 0) end ) addEventHandler("onPlayerQuit", root, function() currentAcc = getPlayerAccount(source) setAccountData(currentAcc, "deaths", getElementData(source, "deaths") or 0) setAccountData(currentAcc, "kills", getElementData(source, "kills") or 0) end ) addEventHandler("onPlayerLogin", root, function(previousAcc, currentAcc, _autoLogin_) setElementData(source, "deaths", getAccountData(currentAcc, "deaths") or 0) setElementData(source, "kills", getAccountData(currentAcc, "kills") or 0) end ) Link to comment
Jorgito'Molina Posted April 8, 2013 Author Share Posted April 8, 2013 running, thanks you csmit195. 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