AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [TF2] Ubercharge (https://forums.alliedmods.net/showthread.php?t=96493)

noodleboy347 07-05-2009 17:27

[TF2] Ubercharge
 
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.

MikeJS 07-05-2009 18:06

Re: [TF2] Ubercharge
 
Pretty sure you need an extension for that.

Gachl 07-05-2009 18:49

Re: [TF2] Ubercharge
 
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;



FoxMulder 07-05-2009 18:58

Re: [TF2] Ubercharge
 
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. :shock:

Greyscale 07-05-2009 19:23

Re: [TF2] Ubercharge
 
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 :)

retsam 07-05-2009 19:45

Re: [TF2] Ubercharge
 
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....

Gachl 07-05-2009 20:34

Re: [TF2] Ubercharge
 
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

Sexual Harassment Panda 07-05-2009 20:35

Re: [TF2] Ubercharge
 
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.

noodleboy347 07-08-2009 15:35

Re: [TF2] Ubercharge
 
Quote:

Originally Posted by Sexual Harassment Panda (Post 865304)
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.

onv 01-18-2013 12:04

Re: [TF2] Ubercharge
 
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.


All times are GMT -4. The time now is 22:55.

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