Raised This Month: $1944 Target: $400
 486% 

Most Valuable Player (MVP) (1.0.3 - 22.03.2014)


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-24-2014 , 13:30   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #31

Quote:
Originally Posted by mistrymehul133 View Post
It's not compiling :@
It's compiling, you need to compile locally with dhud include.

Btw, you don't need to include fakemeta_util
__________________
HamletEagle is offline
Rickho
New Member
Join Date: Nov 2014
Old 11-30-2014 , 17:25   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #32

One could do something like for ctf, flag counter recovered, taken and captured. Thank you.
Rickho is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-01-2014 , 08:52   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #33

Quote:
Originally Posted by Rickho View Post
One could do something like for ctf, flag counter recovered, taken and captured. Thank you.
I do not support custom mods, you have to do that yourself or ask someone else to do it (in the requests section).
__________________
Kia is offline
Kosidone
Member
Join Date: Aug 2014
Old 07-11-2015 , 17:24   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #34

Still have error I can't Download Any help ?
Kosidone is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 07-12-2015 , 04:45   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #35

What error do you have?
__________________
Kia is offline
Kosidone
Member
Join Date: Aug 2014
Old 07-13-2015 , 22:29   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #36

i try to compile it on Webcompiler and Local Compile and it Says ~~~
error 013: no entry point (no public functions) - fatal error 100: cannot read from file: "dhudmessage"

By the Way my server is only for Steamers

Last edited by Kosidone; 07-13-2015 at 22:37.
Kosidone is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 07-14-2015 , 03:36   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #37

Compile it locally.
__________________
Kia is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-31-2015 , 13:57   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #38

I hate CS GO but such features may be nice in CS 1.6, but this plugin has some flaws.

1.First thing you should do is to check map type and register the forwards only if you are running the needed map. For example, there is no point to register the hostage rescue event in a bomb map.
2.Returning PLUGIN_HANDLED in the task is pointless, you can make an if else if statement or use simply return. But I am asking myself why do you even need the task.
3.At this point, a tero can become MVP only if he planted the bomb but it not exploded by kills. This does not seem a nice ideea. Even if there is a planter or not the most kills should be taken into account. In bomb_explode you make a mvp if he planted the bomb and exploded, so this should be fine. I would move the code from bomb_explode into the SendAudio event, so you will have all MVP checks at the same place, it will be more readable and will make more sense.
4.In Event_AllHostagesRescued it is pointless to get the top rescuer, you do it anyway in the CT win event.
5.In Event_HostageRescued, drop the static keyword and use new.
6.In Event_DeathMsg, you should filter suicide, team kill etc.
7.Drop the public keyword in front of GetTopRescuer, GetTopKiller and ShowMVPMessage. public means this function could be called from outside of your plugin(for example tasks, menu handlers), but here is not the case.
8.In SortByKills and SortByHostages don't evaluate the same condition twice, if the first failed else is enough.
9.szMVPName should be 32 and not 33.
10.ML could be welcomed too.

HLTV event is not called in the very first round if there are not at least two players or if they are in the same team, so your variables won't get the NO_BOMB_PLANTED and NO_BOMB_DEFUSED values. You could state that this plugin requiere at least two players to prevent idiots from reporting bugs.

Basically, you need better handling. I would check firstly if the main map objective(bomb explode/defuse/hostage rescue) is fulfilled, if no I will start to sort by kills.

You should also edit your thread, you tell nothing about the hostage mvp, also you have misinformations like "Also, the plugin checks if they are any bomb spots on the map, if not, the plugin disables itself.". Also fix your images -.-

You could go on and add support for the vip objective.
__________________

Last edited by HamletEagle; 09-15-2015 at 13:13.
HamletEagle is offline
Old 08-31-2015, 22:03
Freezo Begin
This message has been deleted by Freezo Begin.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-17-2015 , 09:12   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #39

More than 15 days have passed and I dont see any changes from the author. Since section needs to be cleaned I'll unapprove this for now, but don't worry, your plugin can be reviewed at any time. PM a plugin approver after you made the changes.
__________________
HamletEagle is offline
mforce
Member
Join Date: Jan 2015
Old 12-01-2015 , 14:55   Re: Most Valuable Player (MVP) (1.0.3 - 22.03.2014)
Reply With Quote #40

- 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();
    }

__________________
mforce @ hlmod.hu

Last edited by mforce; 12-01-2015 at 14:56.
mforce 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 10:51.


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