Advertisement
Guest User

Untitled

a guest
Jul 25th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. failure = {}
  2. failure.failures = {}
  3.  
  4. function failure.logPlayerData( charid)
  5. local kills = 0
  6. local deaths = 0
  7. local pks = 0
  8. kills, deaths, pks = GetCharacterKillDeaths(charid)
  9. if(failure.failures == nil) then
  10. failure.failures = {}
  11. end
  12. if(failure.failures[charid] == nil and charid ~= nil) then
  13. failure.failures[charid] = {}
  14. failure.failures[charid]["name"] = GetPlayerName(charid)
  15. failure.failures[charid].originalKills = kills
  16. failure.failures[charid].originalDeaths = deaths
  17. failure.failures[charid].originalPKs = pks
  18. end
  19. failure.failures[charid].latestKills = kills
  20. failure.failures[charid].latestDeaths = deaths
  21. failure.failures[charid].latestPKs = pks
  22. end
  23.  
  24. function failure.logAll()
  25. ForEachPlayer(function (id) failure.logPlayerData( id) end)
  26. end
  27.  
  28. function failure.printAll()
  29. for k,v in pairs(failure.failures) do
  30. print(v.name .. ": " ..
  31. v.latestKills - v.originalKills .. " kills, " ..
  32. v.latestDeaths - v.originalDeaths .. " deaths, " ..
  33. v.latestPKs - v.originalPKs .. " PKs")
  34. end
  35. end
  36.  
  37. RegisterUserCommand("logFailure", failure.logAll)
  38. RegisterUserCommand("printFailure", failure.printAll)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement