Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (checkalias curfrags) [] [ // Make stats collecting aliases if they do not already exist.
- curfrags = 0
- atfrags = 0
- curdeaths = 0
- atdeaths = 0
- curscore = 0
- atscore = 0
- curratio = 0
- atratio = 0
- cursniper = 0
- cursmg = 0
- curshot = 0
- curar = 0
- curcarb = 0
- curusp = 0
- curaki = 0
- clast = 0
- rvsfst = 0
- ]
- calc = [ // Function used for gathering and calculating stats
- curfrags = (at (pstat_score (findcn $curname)) 1)
- curdeaths = (at (pstat_score (findcn $curname)) 2)
- curscore = (at (pstat_score (findcn $curname)) 3)
- curratio = (divf $curfrags $curdeaths)
- cursniper = (at (pstat_weap (findcn $curname)) 10)
- cursmg = (at (pstat_weap (findcn $curname)) 8)
- curar = (at (pstat_weap (findcn $curname)) 12)
- curshot = (at (pstat_weap (findcn $curname)) 6)
- curcarb = (at (pstat_weap (findcn $curname)) 4)
- curusp = (at (pstat_weap (findcn $curname)) 2)
- curaki = (at (pstat_weap (findcn $curname)) 18)
- curnade = (at (pstat_weap (findcn $curname)) 16)
- curknife = (at (pstat_weap (findcn $curname)) 0)
- if (&& (<= $minutesremaining 0) (= $strst 0)) [ // Add current score to all-time totals during intermission.
- += atfrags $curfrags // TODO: Make it possible to add to these for on-the-fly all-time stats viewing.
- += atdeaths $curdeaths
- += atscore $curscore
- atratio = (divf $atfrags $atdeaths)
- if (= (curmodeattr team) 1) [ // Check if user is in a team mode.
- if (= (curteam) 1) [ // If playing for RVSF, +1 to it's stat.
- += rvsfst 1
- ] [
- += clast 1 // Else they are playing for CLA, +1 to it's stat.
- ]] []
- strst = 1 // In case if this function is called more than once during the intermission, mark this as 1 so the above if statement fails.
- ] []
- ]
- clrst = [ // Function used to clear temporary script flow aliases on every map start.
- strst = 0
- ]
- stats = [
- calc // Gather and calculate the stats.
- if (strcmp $arg1 "all") [ // If user entered "all" as the first argument display the all-time stats instead.
- echo All-Time Frags: $atfrags
- echo All-Time Deaths: $atdeaths
- echo All-Time Score: $atscore
- if (< $atdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
- echo All-Time Ratio: (concatword $atfrags .0)
- ] [
- echo All-Time Ratio: $atratio
- ]
- echo CLA: $clast
- echo RVSF: $rvsfst
- ] [ // Else show user the current round stats.
- echo Frags: $curfrags
- echo Deaths: $curdeaths
- if (= $connected 1) [ // Score is only calculated in multiplayer.
- echo Score: $curscore
- ] [
- echo Score: N/A
- ]
- if (< $curdeaths 2) [ // Ratio = # of kills until >= the 2nd death.
- echo Ratio: (concatword $curfrags .0)
- ] [
- echo Ratio: $curratio
- ]]]
- if (strstr $mapstartalways clrst) [] [ // Automate stuff :)
- add2alias mapstartalways [clrst]
- add2alias start_intermission [stats]
- ]
- newmenu "Current Round Statistics"
- menuinit [(calc)]
- menuitemtextinput "Frags: " "result $curfrags"
- menuitemtextinput "Deaths: " "result $curdeaths"
- menuitemtextinput "Score: " "result $curscore"
- menuitemtextinput "Ratio: " "result $curratio"
- menuitem "" -1
- menuitemtextinput "Sniper: " "result $cursniper"
- menuitemtextinput "SMG: " "result $cursmg"
- menuitemtextinput "AR: " "result $curar"
- menuitemtextinput "Shotgun: " "result $curshot"
- menuitemtextinput "Carbine: " "result $curcarb"
- menuitemtextinput "Pistol: " "result $curusp"
- menuitemtextinput "Akimbo: " "result $curaki"
- menuitemtextinput "Grenade: " "result $curnade"
- menuitemtextinput "Knife: " "result $curknife"
- bind BACKQUOTE [calc; showmenu "Current Round Statistics"; onrelease [closemenu "Current Round Statistics"]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement