Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEventHandler ( "onPlayerWasted", root,
- function( totalAmmo, killer, killerWeapon, bodypart, stealth )
- if killer then
- local account = getPlayerAccount ( killer )
- if killer ~= source then
- setAccountData( account,"murders_total",tonumber( getAccountData( account,"murders_total" ) or 0 ) +1 )
- setElementData( killer, "T/K", tonumber( getAccountData( account,"murders_total" ) ) )
- setElementData( killer, "K/D/R", tonumber(getElementData( killer, "T/K" )/getElementData( source, "T/D") ) )
- end
- else
- local accountSource = getPlayerAccount ( source )
- setAccountData( accountSource,"deaths_total",tonumber( getAccountData(accountSource,"deaths_total") or 0 ) +1 )
- setElementData( source, "T/D", tonumber( getAccountData( accountSource,"deaths_total" ) ) )
- setElementData( source, "K/D/R", getElementData( killer, "T/K" )/getElementData( source, "T/D") )
- end
- end
- )
- addEventHandler( "onPlayerLogin",root,
- function( thePreviousAccount, theCurrentAccount, autoLogin )
- local account = getPlayerAccount ( source )
- if not getAccountData( account,"murders_total" ) and not getAccountData( account,"deaths_total" ) then
- setAccountData( account,"murders_total",0 )
- setAccountData( account,"deaths_total",0 )
- end
- setElementData( source,"T/D",tonumber( getAccountData( account,"deaths_total" ) or 0 ) )
- setElementData( source,"T/K",tonumber( getAccountData( account,"murders_total" ) or 0 ) )
- setElementData( source, "K/D/R", getElementData( source, "T/K" )/getElementData( source, "T/D") )
- end
- )
- addEventHandler( "onResourceStart",resourceRoot,
- function( )
- outputDebugString( "add Total Kills to scoreboard Return: "..tostring(
- call( getResourceFromName("scoreboard"), "scoreboardColumns", "T/K",root,2, 0.032 )
- ) )
- outputDebugString( "add K/D R to scoreboard Return: "..tostring(
- call( getResourceFromName("scoreboard"), "scoreboardColumns", "K/D/R",root,4, 0.047 )
- ) )
- outputDebugString( "add Total Deaths to scoreboard Return: "..tostring(
- call( getResourceFromName("scoreboard"), "scoreboardColumns", "T/D",root,3, 0.032 )
- ) )
- end
- )
Advertisement
Add Comment
Please, Sign In to add comment