Raised This Month: $ Target: $400
 0% 

[TF2] Faster charger for medic and spy for a specific client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ywa*NL
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 04-04-2009 , 07:46   [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #1

Hello everyone,

Is it possible to set the regeneration time higher for a specific client, when being a medic (übercharge) or spy (cloakmeter)? If yes, how can I do that?

Thanks in advance.

Regards,
Ywa
__________________
Ywa*NL is offline
Send a message via MSN to Ywa*NL
NeoDement
Member
Join Date: Mar 2009
Old 04-05-2009 , 09:22   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #2

I suppose something like this (pseudo code)

Every game frame
Iterate through every player
Check if that player has the priviledges (and is alive, and isn't cloaked, and is healing etc)
Set their cloak to be cloak + 2 or something, seeing as it's every frame it will look like it's going up faster
If you need to know how to do that there's cloak syphon plugin you can search for and a medipacks plugin you can search for, which set uber and cloak
__________________
I'm not being funny but guys, I'm a bit fit, y'know?
NeoDement is offline
Ywa*NL
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 04-05-2009 , 16:03   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #3

I haven't thought of that yet. Thanks!

Yeah, I know already how to write to both values.
__________________
Ywa*NL is offline
Send a message via MSN to Ywa*NL
Ywa*NL
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 04-06-2009 , 10:29   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #4

I got a question though. How can I see if the player isn't cloaked or übercharging?
__________________
Ywa*NL is offline
Send a message via MSN to Ywa*NL
DeviusCreed
Junior Member
Join Date: Dec 2006
Old 04-06-2009 , 12:54   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #5

PHP Code:
//pluginstart
g_condOffset FindSendPropInfo("CTFPlayer","m_nPlayerCond");

//wherever
new cond GetEntData(clientg_condOffset);
if(
cond != 16 && cond != 20 && cond != 24//16 cloaked: 20 cloaked/disguising 24 cloaked/disguised.

    
SetEntDataFloat(clientg_cloakOffsetcloakAmount[client]);

You can check the playercond for an ubercharge too. Forgot what value(32 it think).
DeviusCreed is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 04-06-2009 , 13:54   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #6

Code:
#define PLAYERCOND_DISGUISING (1<<2) //4
#define PLAYERCOND_DISGUISED  (1<<3) //8
#define PLAYERCOND_SPYCLOAK   (1<<4) //16
#define PLAYERCOND_UBERED     (1<<5) //32
bl4nk is offline
Ywa*NL
Senior Member
Join Date: Apr 2005
Location: The Netherlands
Old 04-08-2009 , 13:27   Re: [TF2] Faster charger for medic and spy for a specific client
Reply With Quote #7

Ok. Both meter things work now . Thanks guys!

Edit
Somehow, the counter still adds charge when the medic is übercharging someone. So I suppose the condition is wrong? Where can I see the right one?
PHP Code:
    g_condOffset FindSendPropInfo("CTFPlayer","m_nPlayerCond"); 
PHP Code:
    else if (class == TFClass_Medic)
{
    new 
index GetPlayerWeaponSlot(client1);
    new 
cond GetEntData(clientg_condOffset);
    if(
cond != 32 && index 0//32:ubering
    
{
        new 
Float:currentvalue GetEntPropFloat(indexProp_Send"m_flChargeLevel");
        
currentvalue += 0.05;
        if (
currentvalue >= 1.0)
            
SetEntPropFloat(indexProp_Send"m_flChargeLevel"1.0);
        else
            
SetEntPropFloat(indexProp_Send"m_flChargeLevel"currentvalue);
        }

__________________

Last edited by Ywa*NL; 04-08-2009 at 14:18.
Ywa*NL is offline
Send a message via MSN to Ywa*NL
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 00:11.


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