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

Most Valuable Player (MVP) (1.0.3 - 22.03.2014)


Post New Thread Reply   
 
Thread Tools Display Modes
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-04-2015 , 11:17   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #41

Quote:
Originally Posted by mforce View Post
- code fixes
- removed hostage support
- money bonus for mvp
- kill count in mvp dhud
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <dhudmessage>
#include <csx>

#define PLUGIN "MVP"
#define VERSION "1.0.3"
#define AUTHOR "Kia"

#define MVP_MONEY 1000

new const PREFIX[] = "^4[ProKillers]^1"

#define NO_BOMB_PLANTED 9191
#define NO_BOMB_DEFUSED 1919
#define CHECK_DELAY 0.5


/* Integers */

new g_iEnemiesKilled[33]

new 
g_iBombPlanter
new g_iBombDefuser

/* Boolean */

new bool:g_bBombExploded

// ===============================================================================
//     plugin_init
// ===============================================================================

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Events */
    
    
register_event("HLTV""Event_NewRound""a""1=0""2=0"
    
    
register_event("SendAudio""Event_RoundWon_T" "a""2&%!MRAD_terwin"
    
register_event("SendAudio""Event_RoundWon_CT""a""2&%!MRAD_ctwin")
    
    
register_event("DeathMsg""Event_DeathMsg""a")
}

// ===============================================================================
//     Event_NewRound - Called when a new Round begins
// ===============================================================================

public Event_NewRound()
{
    
g_iBombPlanter NO_BOMB_PLANTED
    g_iBombDefuser 
NO_BOMB_DEFUSED
    
    g_bBombExploded 
false
    
    arrayset
(g_iEnemiesKilled0sizeof(g_iEnemiesKilled))
}

// ===============================================================================
//     Event_RoundWon_T - Called when the Counter-Terrorists when the Round
// ===============================================================================

public Event_RoundWon_T()
{
    
set_task(CHECK_DELAY"CheckTConditions")
}

public 
CheckTConditions()
{
    if(
g_iBombPlanter != NO_BOMB_PLANTED && g_bBombExploded == true)
    {
        
ShowMVPMessage(g_iBombPlanter3)
    }
    else
    {
        new 
iTopKiller GetTopKiller(1)
        
ShowMVPMessage(iTopKiller1)
    }
}

// ===============================================================================
//     Event_RoundWon_CT - Called when the Counter-Terrorists when the Round
// ===============================================================================

public Event_RoundWon_CT()
{
    
set_task(CHECK_DELAY"CheckCTConditions")
}

public 
CheckCTConditions()
{
    if(
g_iBombDefuser != NO_BOMB_DEFUSED)
    {
        
ShowMVPMessage(g_iBombDefuser2)
    }
    else
    {
        new 
iTopKiller GetTopKiller(2)
        
ShowMVPMessage(iTopKiller1)
    }
}

// ===============================================================================
//     Event_DeathMsg - Called when someone dies
// ===============================================================================

public Event_DeathMsg() {
    new 
killer read_data(1)
    new 
victim read_data(2)
    new 
kteam get_user_team(killer)
    new 
vteam get_user_team(victim)
    
    if(
killer != victim && kteam != vteam)
        
g_iEnemiesKilled[killer]++
}

// ===============================================================================
//     bomb_planted - Called when the Bomb was planted
// ===============================================================================

public bomb_planted(iPlanter)
    
g_iBombPlanter iPlanter
    
// ===============================================================================
//      bomb_explode - Called when the Bomb exploded
// ===============================================================================

public bomb_explode(iPlanteriDefuser)
    
g_bBombExploded true
    
// ===============================================================================
//     bomb_defused - Called when the Bomb was defused
// ===============================================================================

public bomb_defused(iDefuser)
    
g_iBombDefuser iDefuser
    
// ===============================================================================
//     GetTopKiller - Returns the id of the player who made the most kills
// ===============================================================================

GetTopKiller(iTeam// 1 : Terrorist - 2 : Counter-Terrorists
{
    new 
iPlayers[32], iPlayersnum;
    
    
get_players(iPlayersiPlayersnum"e"iTeam == "TERRORIST" "CT")
    
SortCustom1D(iPlayersiPlayersnum"SortByKills")
    
    return 
iPlayers[0]
}

public 
SortByKills(elem1elem2
{
    if ( 
g_iEnemiesKilled[elem1] > g_iEnemiesKilled[elem2] )
        return -
1
    
else
        return 
1
    
return 0
}

// ===============================================================================
//     ShowMVPMessage - Shows the Director HUD Message
// ===============================================================================

ShowMVPMessage(iMVPiReason// 1 : Kills - 2 : Bomb defused - 3 : Bomb exploded
{
    new 
szMVPName[32]
    
get_user_name(iMVPszMVPNamecharsmax(szMVPName))
    
    
cs_set_user_money(iMVPcs_get_user_money(iMVP)+MVP_MONEY)
    
ChatColor(iMVP"%s You received^3 %d$^1, because you are the best in this round."PREFIXMVP_MONEY)
    
    
set_dhudmessage(02550, -1.00.1506.012.0)
    
    switch(
iReason)
    {
        case 
1show_dhudmessage(0"MVP : %s for making the most kills (%d) in this round."szMVPNameg_iEnemiesKilled[iMVP])
        case 
2show_dhudmessage(0"MVP : %s for defusing the Bomb."szMVPName)
        case 
3show_dhudmessage(0"MVP : %s for planting the Bomb."szMVPName)
    }        
}

stock ChatColor(const id, const szMessage[], any:...) {
    static 
pnumplayers[32], szMsg[190], IdMsg
    
vformat(szMsgcharsmax(szMsg), szMessage3);
    
    if(!
IdMsgIdMsg get_user_msgid("SayText");
    
    if(
id) {
        if(!
is_user_connected(id)) return;
        
players[0] = id;
        
pnum 1
    } 
    else 
get_players(playerspnum"ch");
    
    for(new 
ipnumi++) {
        
message_begin(MSG_ONEIdMsg, .player players[i]);
        
write_byte(players[i]);
        
write_string(szMsg);
        
message_end();
    }

Neat that someone still looks after my plugin(s).
btw, remove that server in your signature, non-steam advertisment is not allowed.
__________________
Kia is offline
aEEk
Member
Join Date: May 2012
Location: Romania
Old 10-31-2016 , 11:41   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #42

Checking console with your MVP plugin:
Code:
SZ_GetSpace: overflow on netchan->message
WARNING: reliable overflow for aeek
Dropped aeek from server
Reason: Reliable channel overflowed
You should improve this plugin to be approved.
aEEk is offline
Send a message via Yahoo to aEEk Send a message via Skype™ to aEEk
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-02-2016 , 10:44   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #43

You could be an MVP a lot more than just for these achievements...

Suggestions you could add:
- MVP for rescueing a hostage.
- MVP for being VIP and getting to secure point
- MVP for killing 60% of the enemy team
- MVP for winning gun-game map/round. (Same as in cs:go. Just check if map is gungame map, if so, enable the availability of this MVP else disable).
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
kaxp3r
New Member
Join Date: Mar 2018
Old 03-13-2018 , 01:26   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #44

Compile failed!Please help!

Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textqj4KME.sma(3) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.

I have dhudmessage.inc in my addons/amxmodx/scripting/inculde dir
kaxp3r is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-17-2018 , 04:21   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #45

Quote:
Originally Posted by kaxp3r View Post
Compile failed!Please help!

Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textqj4KME.sma(3) : fatal error 100: cannot read from file: "dhudmessage"

Compilation aborted.
1 Error.

I have dhudmessage.inc in my addons/amxmodx/scripting/inculde dir
Download DHUDMESSAGE first : https://forums.alliedmods.net/attach...0&d=1297640630

Now compile Plugin Locally
instinctpt1 is offline
karimoo97
Member
Join Date: Apr 2018
Location: Tamazgha
Old 04-14-2018 , 12:16   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #46

Great plugin ! thank you for making it

is it possible to make a command for the players with most MVPs ?

/topmvp : top 15 players with most mvps

it would be great

Greetings
karimoo97 is offline
Gulden
New Member
Join Date: May 2020
Old 05-23-2020 , 10:46   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #47

I'm new here and I want to know if I can use it on a classic server too!
Gulden is offline
Gulden
New Member
Join Date: May 2020
Old 05-25-2020 , 11:13   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #48

someone !!! you can lend a helping hand !!
__________________
Gulden-Cs.Sladers.Ro !!

Last edited by Gulden; 05-25-2020 at 11:15.
Gulden is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 05-25-2020 , 12:52   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #49

Quote:
Originally Posted by Kia View Post
Requirements
  • Steam-only Server
So, no
__________________

Mordekay is offline
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 13:48.


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