AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Best Player MOTD (https://forums.alliedmods.net/showthread.php?t=302153)

OciXCrom 10-18-2017 13:38

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 kills 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

https://raw.githubusercontent.com/Oc...using_this.png
https://raw.githubusercontent.com/Oc...plugin_lab.png
https://raw.githubusercontent.com/Oc...ad_default.png

Relaxing 10-18-2017 14:03

Re: Best Player MOTD
 
How about removing these extra 0s at last digits of floats var?

OciXCrom 10-18-2017 14:24

Re: Best Player MOTD
 
I'm open to suggestions on how to do that without any major changes.

smiley92 10-18-2017 15:50

Re: Best Player MOTD
 
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.

jay7 10-18-2017 17:10

Re: Best Player MOTD
 
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.

Relaxing 10-19-2017 04:17

Re: Best Player MOTD
 
Closest
https://stackoverflow.com/questions/...roes-in-printf

Or use %g to format strings

Natsheh 10-19-2017 04:53

Re: Best Player MOTD
 
Fancy motd good job!

OciXCrom 10-19-2017 14:47

Re: Best Player MOTD
 
Quote:

Originally Posted by smiley92 (Post 2555267)
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 (Post 2555285)
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 (Post 2555366)
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 (Post 2555372)
Fancy motd good job!

Thanks. Now it's even more fancier. :crab:

https://img.shields.io/badge/update-...2017-green.svg
  • Added the winning team in the MOTD.
  • Added the cvar "bpm_obey_team".
  • Added new placeholders: $ctscore$, $tscore$, $best_team$.

klippy 10-19-2017 15:00

Re: Best Player MOTD
 
Convert the floating point value to a string then cut off '0' characters from the end.

OciXCrom 10-19-2017 15:15

Re: Best Player MOTD
 
Quote:

Originally Posted by KliPPy (Post 2555466)
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?


All times are GMT -4. The time now is 04:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.