AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   [MVP] MVP Of the Round + Custom Sounds (reAPI Support) (https://forums.alliedmods.net/showthread.php?t=327690)

Shadows Adi 10-04-2020 05:27

[MVP] MVP Of the Round + Custom Sounds (reAPI Support)
 
5 Attachment(s)
Most Valuable Player Of the Round
https://img.shields.io/badge/Author-Shadows%20Adi-green https://img.shields.io/badge/Version-2.8-green

Informations
Description
This script can detect the best killer or the planter ( if the bomb exploded ) or the defuser ( if the planted bomb is defused ), also it allows players to choose one of tracks uploaded by server owners ( Tracks can be for Privileged Users ( VIPs ) / Normal Players )
After the event is detected, it is showing a message in CHAT/ HUD / DHUD to all conected players.
Also, this script is supporting reHLDS's ReAPI, you can uncomment line 4 #define USE_REAPI to use ReAPI instead of HamSandwich and some events.
Servers using this script: Click Here
Requirements
  • AmxModX 1.8.2+
  • Hamsandwich module
  • ReAPI Module ( reHLDS Needed )
Installation
  • Download the archive from down below.
  • Compile most_valuable_player.sma using a local compiler or a web compiler which supports custom includes.
  • Put most_valuable_player.amxx in amxmodx/plugins folder
  • Go to amxmodx/configs/plugins.ini, open the file and write on the last line most_valuable_player.amxx.
  • Open MVPTracks.ini
    • Insert your database credentials ( optional )
    • Add your custom tracks ( optional )
  • Restart your server or change the map.
API
What mean API ? API is an abbreviation from Application Programming Interface and it's used to make external scripts which are for compatibility purpose.
INC File:
PHP Code:

/* Sublime AMXX Editor v4.2 */

#if defined _most_valuable_player_included
    #endinput
#endif
#define _most_valuable_player_included

#pragma reqlib most_valuable_player
#if !defined AMXMODX_NOAUTOLOAD
    #pragma loadlib most_valuable_player
#endif

enum WinScenario
{
    
NO_SCENARIO = -1,
    
TERO_MVP 0,
    
CT_MVP,
    
KILLER_MVP_TERO,
    
KILLER_MVP_CT,
    
KILLER_MVP /* Just for default: case in PlayTrack(), unusable */
}

/**
 * @description         Multiforward called when a round end.
 *
 * @param scenario      Scenario index. See WinScenario enum
 * @return              Scenario index.
 */
forward mvp_scenario(WinScenario:scenario);

/**
 * Returns player's MVP kills.
 *
 * @param id        Player index.
 * @return          Amount of kills. -1 on error.
 */
native get_user_mvp_kills(id);

/**
 * Returns top killer's index.
 *
 * @param id        Top killer index.
 * @return          Top killer's index. -1 on error.
 */
native get_user_mvp_topkiller(id);

/**
 * Returns player's MVP damage.
 *
 * @param id        Player index.
 * @return          Player index. -1 on error.
 */
native get_user_mvp_damage(id);

/**
 * Returns player's MVP damage made with headshot.
 *
 * @param id        Player index.
 * @return          Player index. -1 on error.
 */
native get_user_mvp_hs_damage(id);

/**
 * Returns Player's MVPs.
 *
 * @param id        Player index.
 * @return          Player index. -1 on error.
 */
native get_user_mvps(id); 

Credits

OciXCrom for providing CromChat
Amxx-BG for providing API for ReAPI
Destro- for his Sublime AMXX-Editor
fysiks For providing help for code compilation through GitHub
To Do List
  • Making a global variable to store players name. DONE
  • Add soundtracks which can be selected by every player, played when the player is MVP Of the Round. Proposed by @OciXCrom here. DONE
  • Add CS:GO like hud round end style. Proposed by DJEarthQuake here. DONE
Issues
  • No issues
ChangeLog

FULL Changelog can be found HERE
Code:

  • Version 1.0:
    • Initial Release


  • Version 1.3:
    • Added SoundTracks. Players can choose their own soundtrack.

    • Added SQL / nVault saving. This is used for remember each player's selected soundtrack.

    • Added HUD & DHUD message support.

    • Fixed a bug when no player were MVP, a empty message was shown.


  • Version 1.4:
    • Added SQLite Support.


  • Version 1.5:
    • Fixed a bug when no tracks were loaded from file.

    • Fixed a bug to tracklist handler.

    • Added Romanian Translation + a new entry in ML File.


  • Version 1.6:
    • Fixed multiple SQL connections.

    • Added Disable tracks option to saving / loading data.

    • Improved nVault save / load data.


  • Version 1.7:
    • Added the possibility to load / save data on Name or SteamID

    • Added the possibility to track player's MVPs.

    • Added a new native get_user_mvps() returning Player's MVPs.

    • Added a check for connected players.

    • Improved Load / Save checks against bots or hltv proxies.

    • Improved SQL Queries.

    • Less HardCoded SQL Queries.

    • Optimized Chat messages.

    • Fixed the Chat Prefix.


  • Version 1.8:
    • Added support for colored menus from Tracks Array

    • Cleaned and Improved pieces of code


  • Version 1.9:
    • Added a new feature: VIP Only Tracks

    • Fixed a bug reported in #42

    • Optimized code


  • Version 2.0:
    • Now name of the tracks are showing along with the MVP of the round

    • Added a check for ASCII alphabet character in FindCharPos() stock

    • Added a check for is_user_vip() stock if the flag is not an ASCII character

    • Optimized the code


  • Version 2.1:
    • Fixed a small bug when playing a track.

    • Implemented plugin compilation through GitHub. Thanks fysiks


  • Version 2.2:
    • Fixed a bug when displaying a message to all players using ML thanks lexzor

    • Implemented automatically connect to SqLite database if the MySQL database connection fails

    • Code style improvements


  • Version 2.3:
    • Multiple code improvements

    • Implemented support for AmxModX 1.8.2


  • Version 2.4:
    • Added full support for AmxModX 1.8.2

    • Improved PlayTrack() function

    • Fixed a bug in loading settings

    • Added support for changing name

    • Improved code

    • Thanks to HamletEagle


  • Version 2.5:
    • Fixed a bug when getting players from Terrorist team

    • Fixed detection when player is changing his name

    • Fixed a bug in showing menu ( it didn't show the MVP_VIP_ONLY in player's selected language

    • Fixed a bug in PlayTrack() function

    • Modified Load / Save Data code

    • Modified functions name


  • Version 2.6:
    • Fixed reading non-vips tracks even if they not exists

    • Inside plugin_precache, declared needed variables outside the while() loop

    • Fixed copying database credentials if not exists

    • Added a check for one or more missing data field in DataBase connection

    • Code style improvements

    • Added new natives: get_user_mvp_track(); get_mvp_track_info()


  • Version 2.7:
    • Stop any sound playing before playing MVP sound


  • Version 2.8:
    • Added player's MVP count in MVP Menu.

    • Added instant save for player's data after being MVP if the INSTANT_SAVE setting is 1.



Downloads
  • v. 1.0: 43 downloads
  • v. 1.3: 28 downloads
  • v. 1.4+: Moved on GitHub
GitHub Project

DOWNLOAD SOURCE CODE

DOWNLOAD COMPILED PLUGIN

DJEarthQuake 10-07-2020 03:45

Re: MVP Of the Round v1.0
 
Nice CS:GO port. It's remarkable. The parallel of style. Emp`s, 3D 'Vote Map' interactive map changer to Counter-Strike:Global Offensive Most Valuable Player. End game MVP token graphics. Food for thought.

OciXCrom 10-07-2020 06:37

Re: MVP Of the Round v1.0
 
It would be great if you also included music to go along with it, just like in CS:GO. Let the users choose their own soundtrack, probably leave an option to include custom soundtracks if porting them from CS:GO isn't allowed.

Shadows Adi 10-07-2020 09:19

Re: MVP Of the Round v1.0
 
Quote:

Originally Posted by DJEarthQuake (Post 2720523)
Nice CS:GO port. It's remarkable. The parallel of style. Emp`s, 3D 'Vote Map' interactive map changer to Counter-Strike:Global Offensive Most Valuable Player.

Thanks.
Quote:

Originally Posted by DJEarthQuake (Post 2720523)
End game MVP token graphics. Food for thought.

You want to refer to make it like a credits system, which will be used for @OciXCrom idea from down below?

Quote:

Originally Posted by OciXCrom (Post 2720530)
It would be great if you also included music to go along with it, just like in CS:GO. Let the users choose their own soundtrack, probably leave an option to include custom soundtracks if porting them from CS:GO isn't allowed.

Maybe I will work to something like this. If it's requested I will do it until then it remains only in the planning phase.

DJEarthQuake 10-07-2020 10:09

Re: MVP Of the Round v1.0
 
Copyrighted materials. Get written permission first. It is safer to let the users pick tunes. Credits to achieve what? Play the songs? That's a good one and funny too.

Shadows Adi 10-07-2020 10:22

Re: MVP Of the Round v1.0
 
Quote:

Originally Posted by DJEarthQuake (Post 2720547)
Copyrighted materials. Get written permission first. It is safer to let the users pick tunes. Credits to achieve what? Play the songs? That's a good one and funny too.

Yea, there are a lot of copyrighted materials, but @NoCopyrightSounds it's providing "free to use music to the content creator community". But I can make request a Commercial License Form for music acording to their Usage Policy and of course I will credit the artists and songs used.

Added on to To Do List

DJEarthQuake 10-08-2020 06:52

Re: MVP Of the Round v1.0
 
Music, I type mpg123 and a website CLI. As far as making the end game graphics to finish port matching it to CS:GO that was all I was referring to. DHUD would make a large badge to keep it low overhead and simple.

Shadows Adi 10-29-2020 18:52

Re: MVP Of the Round v1.0
 
I need a feedback from you guys:

I want to save player's data ( for soundtrack selection, to remember players selected soundtrack ).

What would be more comfortable? MySQL / Vault saving, or both of them?

I would go on vault 'cuz there are only the player's steamid and the soundtrack id.

iclassdon 10-29-2020 20:56

Re: MVP Of the Round v1.0
 
Add support for deathmatch please.

prefer vault saving as well

Napoleon_be 10-29-2020 21:11

Re: MVP Of the Round v1.0
 
Quote:

Originally Posted by Shadows Adi (Post 2723055)
I need a feedback from you guys:

I want to save player's data ( for soundtrack selection, to remember players selected soundtrack ).

What would be more comfortable? MySQL / Vault saving, or both of them?

I would go on vault 'cuz there are only the player's steamid and the soundtrack id.

Depends on what the user wants to be honest. I'd just make them both if you can, so that part's covered in the future aswell.


All times are GMT -4. The time now is 03:36.

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