Raised This Month: $48 Target: $400
 12% 

Best Player MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Statistical       
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-18-2017 , 13:38   Best Player MOTD
Reply With Quote #1



Best Player MOTD


Description
  • In the end of every map the best player is shown in a MOTD window, along with his stats. The information shown in the MOTD, as well as the way in which the best player is determined, can both be changed very easily.

Cvars & Commands
  • bpm_formula "157" -- the formula for determining the best player (more info down below)
  • bpm_min_players "6" -- the minimum number of players required in the end of the map for the MOTD to show
  • bpm_motd_header "Best Player: $name$" -- the header for the best player MOTD window
  • bpm_motd_stats "Player Stats: $name$" -- the header for the personal stats MOTD window
  • bpm_obey_team "0" -- if enabled, the best player will be chosen from a specific team (0 = disabled; 1 = terrorists; 2 = CTs; 3 = winning team)
  • bpm_save_type "0" -- how to save the number of "wins" (0 = name; 1 = IP address; 2 = SteamID)
  • say /mystats -- shows your current stats

Placeholders
  • Placeholders in $dollar signs$ can be used in the MOTD files and the header cvars.
  • Placeholders in (brackets) can be used in the cvar "bpm_formula".
  • $map$ -- the name of the map
  • $name$ -- the name of the player
  • $wins$ -- the number of wins (0)
  • $kills$ -- the number of kills (1)
  • $kills_sb$ -- the number of wins according to the scoreboard (2)
  • $deaths$ -- the number of deaths (3)
  • $deaths_sb$ -- the number of deaths according to the scoreboard (4)
  • $headshots$ -- the number of headshots (5)
  • $hits$ -- the number of hits (6)
  • $damage$ -- the amount of damage (7)
  • $kdratio$ -- the ratio between the kills and deaths (8)
  • $kdratio_sb$ -- the ratio between the kills and deaths according to the scoreboard (9)
  • $hsratio$ -- the ratio between the headshots and kills (a)
  • $ctscore$ -- number of CT team wins
  • $tscore$ -- number of T team wins
  • $best_team$ -- the winning team (ct/t/draw)

Determining the best player
  • In order to find the best player, the plugin firstly checks the number of kills of all players and chooses the one who has the most. If there are multiple players with the highest amount of kills, the plugin will compare the number of headshots from those players. If it finds more than one player again, now it will compare the amount of damage they made, so the best player will be the one with most damage.
  • This whole procedure can be modified through the cvar "bpm_formula", which is set to "157" by default. As you can see from the list of placeholders, 1 is the number of kills, 5 is the number of headshots, and 7 is the amount of damage, so the plugin checks these 3 statistics one by one. If you want for example to make it check the damage first (7), then the deaths (3) and the headshot ratio (a), the cvar needs to be set to "73a".

Additional information and download link



__________________

Last edited by OciXCrom; 07-17-2018 at 09:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Relaxing
Veteran Member
Join Date: Jun 2016
Location: Catlands
Old 10-18-2017 , 14:03   Re: Best Player MOTD
Reply With Quote #2

How about removing these extra 0s at last digits of floats var?
__________________
Have A Relaxing Day | Wiki
aim_relaxing
Relaxing is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-18-2017 , 14:24   Re: Best Player MOTD
Reply With Quote #3

I'm open to suggestions on how to do that without any major changes.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 10-18-2017 , 15:50   Re: Best Player MOTD
Reply With Quote #4

You must include the best player of the month.
To be something competitions who will be first up to 31.10.2017 to receive some reward, I don't know slot, a steam game gift...For this is top15 but something more interesting at the end of month to see in MOTD some info with statistics and what can win.
At 1.11.2017 this statistics to reset automatically.

Last edited by smiley92; 10-18-2017 at 15:57.
smiley92 is offline
jay7
Senior Member
Join Date: Jun 2004
Old 10-18-2017 , 17:10   Re: Best Player MOTD
Reply With Quote #5

Cool stuff. Can you also add also a “winning team” function and cvar? So you can switch between best player or winning team (or draw) according to team scores.

Last edited by jay7; 10-18-2017 at 17:21.
jay7 is offline
Relaxing
Veteran Member
Join Date: Jun 2016
Location: Catlands
Old 10-19-2017 , 04:17   Re: Best Player MOTD
Reply With Quote #6

Closest
https://stackoverflow.com/questions/...roes-in-printf

Or use %g to format strings
__________________
Have A Relaxing Day | Wiki
aim_relaxing

Last edited by Relaxing; 10-19-2017 at 06:29.
Relaxing is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 10-19-2017 , 04:53   Re: Best Player MOTD
Reply With Quote #7

Fancy motd good job!
__________________
@Jailbreak API MODE 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !

@Arena Mod 90% done !

Donate
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2017 , 14:47   Re: Best Player MOTD
Reply With Quote #8

Quote:
Originally Posted by smiley92 View Post
You must include the best player of the month.
To be something competitions who will be first up to 31.10.2017 to receive some reward, I don't know slot, a steam game gift...For this is top15 but something more interesting at the end of month to see in MOTD some info with statistics and what can win.
At 1.11.2017 this statistics to reset automatically.
Making a top15 requires much work.

Quote:
Originally Posted by jay7 View Post
Cool stuff. Can you also add also a “winning team” function and cvar? So you can switch between best player or winning team (or draw) according to team scores.
Added.

Quote:
Originally Posted by Relaxing View Post
Closest
https://stackoverflow.com/questions/...roes-in-printf

Or use %g to format strings
There is no %g in PAWN.

Quote:
Originally Posted by Natsheh View Post
Fancy motd good job!
Thanks. Now it's even more fancier.


  • Added the winning team in the MOTD.
  • Added the cvar "bpm_obey_team".
  • Added new placeholders: $ctscore$, $tscore$, $best_team$.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 10-19-2017 , 15:00   Re: Best Player MOTD
Reply With Quote #9

Convert the floating point value to a string then cut off '0' characters from the end.
KliPPy is offline
Old 10-19-2017, 15:13
OciXCrom
This message has been deleted by OciXCrom.
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2017 , 15:15   Re: Best Player MOTD
Reply With Quote #10

Quote:
Originally Posted by KliPPy View Post
Convert the floating point value to a string then cut off '0' characters from the end.
PHP Code:
for(new strlen(szArg) - 10i--)
{
    if(
szArg[i] == '0')
        
szArg[i] = ' '
    
else break
}
    
trim(szArg
Any shorter way for doing it or a native I haven't noticed?
__________________

Last edited by OciXCrom; 10-19-2017 at 15:15.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:15.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode