Jorgito'Molina Posted April 8, 2013 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
Castillo Posted April 8, 2013 Posted April 8, 2013 I don't understand what is the problem. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jorgito'Molina Posted April 8, 2013 Author Posted April 8, 2013 the problem is that the score is close the account of the account.
codeluaeveryday Posted April 8, 2013 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 ) Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
codeluaeveryday Posted April 9, 2013 Posted April 9, 2013 Your welcome Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
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