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

[CS:GO]Medkit for MVP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Thommen
Member
Join Date: May 2019
Old 05-11-2019 , 07:36   [CS:GO]Medkit for MVP
Reply With Quote #1

Hello again ;)
I also need another simple plugin...
The player who gets the MVP also gets a free medkit in next round.
Simple as that, isn't it? xd
Can anybody try to do this please?

Regards,
Thommen
Thommen is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 05-11-2019 , 09:41   Re: [CS:GO]Medkit for MVP
Reply With Quote #2

PHP Code:

int g_MostValuatedPlayer
;

public 
void OnPluginStart()
{
    
HookEvent("round_mvp"Event_RoundMVP);
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
void OnMapStart()
{
    
g_MostValuatedPlayer 0;
}

public 
void Event_RoundMVP(Event event, const char[] namebool dontBroadcast)
{
    
g_MostValuatedPlayer event.GetInt("userid");
}

public 
void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int userId event.GetInt("userid");
    
    if (
g_MostValuatedPlayer == userId)
    {
        
int client GetClientOfUserId(userId);
        
        if (
client)
        {
            
// write here the code to give a medikit
            
            
g_MostValuatedPlayer 0;
        }
    }

__________________
Ilusion9 is offline
Thommen
Member
Join Date: May 2019
Old 05-11-2019 , 16:58   Re: [CS:GO]Medkit for MVP
Reply With Quote #3

Thanks a lot ;)
Regards.
Thommen is offline
mysticsoul55
New Member
Join Date: Oct 2021
Old 10-11-2021 , 13:00   Re: [CS:GO]Medkit for MVP
Reply With Quote #4

Quote:
Originally Posted by Ilusion9 View Post
PHP Code:

int g_MostValuatedPlayer
;

public 
void OnPluginStart()
{
    
HookEvent("round_mvp"Event_RoundMVP);
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
void OnMapStart()
{
    
g_MostValuatedPlayer 0;
}

public 
void Event_RoundMVP(Event event, const char[] namebool dontBroadcast)
{
    
g_MostValuatedPlayer event.GetInt("userid");
}

public 
void Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int userId event.GetInt("userid");
    
    if (
g_MostValuatedPlayer == userId)
    {
        
int client GetClientOfUserId(userId);
        
        if (
client)
        {
            
            
g_MostValuatedPlayer 0;
        }
    }

mysticsoul55 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 17:25.


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