Raised This Month: $ Target: $400
 0% 

[REQ TF2] Medic Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 03-28-2009 , 20:27   Re: [REQ TF2] Medic Plugin
Reply With Quote #3

I have no idea if this works. I just wrote it real fast, but it might be something to at least go off of for now, or get you in the right direction. Worth a shot.
PHP Code:
#include <sourcemod>
#include <tf2>
#include <tf2_stocks>

new uberlevel 0;
public 
OnPluginStart()
{
    
HookEvent("player_death",  Event_PlayerDeath);
}

public 
Action:Event_PlayerDeath(Handle:event,  const String:name[], bool:dontBroadcast)
{
    new 
attacker GetClientOfUserId(GetEventInt(event"attacker"));
    new 
assister GetClientOfUserId(GetEventInt(event"assister"));
    if(
TF2_GetPlayerClass(assister) == TFClass_Medic)
        if(
GetEntProp(assisterProp_Send"m_hHealingTarget") == attacker){
            
uberlevel TF_GetUberLevel(assister);
            
TF_SetUberLevel(assister, (uberlevel 10))
    }
}

//Naris' code
stock TF_GetUberLevel(client)
{
    new 
index GetPlayerWeaponSlot(client1);
    if (
index 0)
        return 
RoundFloat(GetEntPropFloat(indexProp_Send"m_flChargeLevel")*100);
    else
        return 
0;
}

//Naris' code
stock TF_SetUberLevel(clientNewUberLevel)
{
    new 
index GetPlayerWeaponSlot(client1);
    if (
index 0)
        
SetEntPropFloat(indexProp_Send"m_flChargeLevel"NewUberLevel*0.01);

DeviusCreed is offline
 



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 18:14.


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