Raised This Month: $ Target: $400
 0% 

[REQ TF2] Medic Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
88Phoenix
Junior Member
Join Date: Feb 2009
Old 03-28-2009 , 04:42   [REQ TF2] Medic Plugin
Reply With Quote #1

working on a medic plugin, having some trouble and getting no where, novice at sourcepawn.

I would like a plugin that when a medic is healing someone, and gains an assist for a kill, they get 10% uber charge added.

If someone could write this, would be much appreciated.

Last edited by 88Phoenix; 03-28-2009 at 05:24.
88Phoenix is offline
Lord Max
Senior Member
Join Date: Aug 2008
Location: 127.0.0.1
Old 03-28-2009 , 06:37   Re: [REQ TF2] Medic Plugin
Reply With Quote #2

Take a look at these, they don't exactly match what you're looking for, but they might be a start.

http://forums.alliedmods.net/showthr...ght=ubercharge

http://forums.alliedmods.net/showthr...ght=ubercharge

Good luck,

-Lord Max
Lord Max is offline
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
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 18:57.


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