Raised This Month: $ Target: $400
 0% 

[TF2] Ubercharge


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-05-2009 , 17:27   [TF2] Ubercharge
Reply With Quote #1

Hi, I'd like a plugin where an admin could ubercharge a player for a set amount of time without needing a Medic (for Gachl's credit plugin). For example, typing sm_ubercharge @me 20 would ubercharge me for 20 seconds.

Thanks in advance.
noodleboy347 is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 07-05-2009 , 18:06   Re: [TF2] Ubercharge
Reply With Quote #2

Pretty sure you need an extension for that.
__________________
MikeJS is offline
Gachl
BANNED
Join Date: Feb 2009
Old 07-05-2009 , 18:49   Re: [TF2] Ubercharge
Reply With Quote #3

pretty sure not really
noodleboy I did that already as you can see in the todo list of my credit plugin, here's the code:

PHP Code:
#include <tf2_stocks>

public OnPluginStart()
{
    
RegAdminCmd("sm_candy_buy_uber"cBuyUberADMFLAG_BAN"Get instant uber (medic)");
}

public 
Action:cBuyUber(cclientargs)
{
    new 
String:sErrStr[] = "[candypack] Usage: sm_candy_buy_uber <userid> <percent>";
    if (
args 2)
    {
        
PrintToServer(sErrStr);
        return 
Plugin_Handled;
    }
    new 
String:sclient[32];
    
GetCmdArg(1sclientsizeof(sclient));
    new 
client GetClientOfUserId(StringToInt(sclient));
    if (!
FullCheckClient(client))
    {
        
PrintToServer(sErrStr);
        return 
Plugin_Handled;
    }
    new 
String:sonoff[32];
    
GetCmdArg(2sonoffsizeof(sonoff));
    new 
onoff StringToInt(sonoff);
    
    if (
TF2_GetPlayerClass(client) == TF2_GetClass("medic"))
    {
        new 
iSlot GetPlayerWeaponSlot(client1);
        if (
iSlot 0)
        
SetEntPropFloat(iSlotProp_Send"m_flChargeLevel"onoff*0.01);
        new 
String:name[128];
        
GetClientName(clientnamesizeof(name));
        
PrintToChatAll("Gave %s %i\% ubercharge!"nameonoff);
    }
    return 
Plugin_Handled;
}

public 
bool:FullCheckClient(client)
{
    if (
client 1)
        return 
false;
    
    if (!
IsClientConnected(client))
        return 
false;
    
    if (!
IsClientInGame(client))
        return 
false;
    
    if (
IsFakeClient(client))
        return 
false;
    
    return 
true;


Last edited by Gachl; 07-05-2009 at 18:51.
Gachl is offline
FoxMulder
Senior Member
Join Date: Jan 2009
Location: Orlando, FL
Old 07-05-2009 , 18:58   Re: [TF2] Ubercharge
Reply With Quote #4

I don't know but it looks like he was asking to ubercharge a player without needing a medic.

That code that you just posted just sets the ubercharge level to a medic.
FoxMulder is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-05-2009 , 19:23   Re: [TF2] Ubercharge
Reply With Quote #5

Gachl, just a tip: if IsClientInGame() succeeds then IsClientConnected will succeed.

So
Code:
if (!IsClientConnected(client))
        return false;
    
    if (!IsClientInGame(client))
        return false;
Can be cut down, shorter code is always better
__________________
Greyscale is offline
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 07-05-2009 , 19:45   Re: [TF2] Ubercharge
Reply With Quote #6

I wonder if youre able to call the effect you see of an ubered player?

If you can, you could just give them godmode for a set duration with the uber effect applied. It would "look" the same id think. That may not be possible though. : / Anyhow, it is essentially godmode youre giving them anyways....
retsam is offline
Gachl
BANNED
Join Date: Feb 2009
Old 07-05-2009 , 20:34   Re: [TF2] Ubercharge
Reply With Quote #7

Oh whoops sorry I should read slower :>
Greyscale, sometimes isclientingame returns true but I can't use a specific command, so I wrote the FullCheckClient to be 100% sure I can do everything whith the client.

Yes retsam it's possible, you have to set the players model. I've seen that somewhere but I can't remember where :<
I coded for my credit plugin godmode (without the effect, you just don't take any damage) thats pretty much what an uber does too
Gachl is offline
Sexual Harassment Panda
Veteran Member
Join Date: Dec 2008
Location: San Diego, CA
Old 07-05-2009 , 20:35   Re: [TF2] Ubercharge
Reply With Quote #8

oh wow that would be great for rtd too, as it really rages people to get killed by a godmode that they can't see. It would be a huge bonus for this plugin to have the uber skin on godmode players.
__________________
Sexual Harassment Panda is offline
noodleboy347
AlliedModders Donor
Join Date: Mar 2009
Old 07-08-2009 , 15:35   Re: [TF2] Ubercharge
Reply With Quote #9

Quote:
Originally Posted by Sexual Harassment Panda View Post
oh wow that would be great for rtd too, as it really rages people to get killed by a godmode that they can't see. It would be a huge bonus for this plugin to have the uber skin on godmode players.
Agreed.
noodleboy347 is offline
onv
Senior Member
Join Date: Feb 2011
Old 01-18-2013 , 12:04   Re: [TF2] Ubercharge
Reply With Quote #10

Sorry for the huge bump , but I'm searching for the exact some thing , it would be amazing if someone could create a plugin like this.
onv 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 00:25.


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