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

[req] Custom MVP Anthem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
popilas
Senior Member
Join Date: Apr 2017
Location: lituanica
Old 02-08-2019 , 13:50   [req] Custom MVP Anthem
Reply With Quote #1

Hello , maybe who have like [cs:go] Custom MVP Anthem
Plugin like player choose sounds from list , and then round end playing best player music..

Like cs:go

thx
popilas is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 02-08-2019 , 14:14   Re: [req] Custom MVP Anthem
Reply With Quote #2

find an mvp plugin you like, then I can add a menu
DjSoftero is offline
anasafridi2
Junior Member
Join Date: Mar 2018
Old 08-16-2019 , 04:26   Re: [req] Custom MVP Anthem
Reply With Quote #3

Quote:
Originally Posted by DjSoftero View Post
find an mvp plugin you like, then I can add a menu
Here is the code i want to use for mvp. Can you add menu to this code? Thanks

Code:
#include <amxmodx>  
#include <amxmisc>  
#include <hamsandwich>
#include <cstrike>

new g_iKills[33],
    g_iHS[33],
    Float:g_fDmg[33]  

public plugin_init()  
{  
    register_plugin("Player of the Round", "1.0", "OciXCrom")  
    RegisterHam(Ham_TakeDamage, "player", "OnTakeDamage")  
    register_event("DeathMsg", "OnPlayerKilled", "a")  
    register_logevent("OnRoundEnd", 2, "1=Round_End")  
}  

public client_disconnect(id)  
{  
    g_iKills[id] = 0 
    g_iHS[id] = 0
    g_fDmg[id] = 0.0
}

public OnTakeDamage(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits)  
{  
    if(is_user_connected(iAttacker) && iAttacker != iVictim && is_user_connected(iVictim))
    {
        if(cs_get_user_team(iAttacker) != cs_get_user_team(iVictim))  
            g_fDmg[iAttacker] += fDamage
        else
            g_fDmg[iAttacker] -= fDamage
    }
}

public OnPlayerKilled()
{  
    
    new iAttacker = read_data(1), iVictim = read_data(2)  
      
    if(get_user_flags(iAttacker) & ADMIN_LEVEL_G)
    {
    	
    if(is_user_connected(iAttacker) && iAttacker != iVictim && is_user_connected(iVictim))
    {
        if(cs_get_user_team(iAttacker) != cs_get_user_team(iVictim))
        {
            g_iKills[iAttacker]++
            
            if(read_data(3))
                g_iHS[iAttacker]++
        }
        else
        {
            g_iKills[iAttacker]--
            
            if(read_data(3))
                g_iHS[iAttacker]--
        }
    }
   }
}

public OnRoundEnd()
{
    new id = get_best_player()
    
    if(id == -1)
        return
        
    new szName[32]  
    get_user_name(id, szName, charsmax(szName)) 

    set_hudmessage(.holdtime = 5.0)
    show_hudmessage(0, "The best player of the round is %s with %i kills (%i HS | %.1f Damage)", szName, g_iKills[id], g_iHS[id], g_fDmg[id])
    
    //set_hudmessage(0, 255, 212, -1.0, 0.31, 0, 6.0, 12.0)
    //show_hudmessage(id, " The best player of the round is %s with %i kills ^n(%i HS | %.1f Damage)", szName, g_iKills[id], g_iHS[id], g_fDmg[id])
    
    arrayset(g_iKills, 0, sizeof(g_iKills))
    arrayset(g_iHS, 0, sizeof(g_iHS))
    
    for(new i; i < sizeof(g_fDmg); i++)
        g_fDmg[i] = 0.0
}

get_best_player()
{
    new iPlayers[32], iPnum, id
    get_players(iPlayers, iPnum)
    
    for(new i, iPlayer; i < iPnum; i++)
    {
        iPlayer = iPlayers[i]
        
        if(g_iKills[iPlayer] > g_iKills[id])
            id = iPlayer
        else if(g_iKills[iPlayer] == g_iKills[id])
        {
            if(g_fDmg[iPlayer] > g_fDmg[id])
                id = iPlayer
        }
    }
    
    return g_iKills[id] ? id : -1
}
anasafridi2 is offline
Reply



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 06:59.


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