Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- failure = {}
- failure.failures = {}
- function failure.logPlayerData( charid)
- local kills = 0
- local deaths = 0
- local pks = 0
- kills, deaths, pks = GetCharacterKillDeaths(charid)
- if(failure.failures == nil) then
- failure.failures = {}
- end
- if(failure.failures[charid] == nil and charid ~= nil) then
- failure.failures[charid] = {}
- failure.failures[charid]["name"] = GetPlayerName(charid)
- failure.failures[charid].originalKills = kills
- failure.failures[charid].originalDeaths = deaths
- failure.failures[charid].originalPKs = pks
- end
- failure.failures[charid].latestKills = kills
- failure.failures[charid].latestDeaths = deaths
- failure.failures[charid].latestPKs = pks
- end
- function failure.logAll()
- ForEachPlayer(function (id) failure.logPlayerData( id) end)
- end
- function failure.printAll()
- for k,v in pairs(failure.failures) do
- print(v.name .. ": " ..
- v.latestKills - v.originalKills .. " kills, " ..
- v.latestDeaths - v.originalDeaths .. " deaths, " ..
- v.latestPKs - v.originalPKs .. " PKs")
- end
- end
- RegisterUserCommand("logFailure", failure.logAll)
- RegisterUserCommand("printFailure", failure.printAll)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement