View Single Post
Author Message
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 06-07-2018 , 12:57   Plugin Help: On Rage, Console Command
Reply With Quote #1

For my newest boss, I'd like to step into the world of making subplugins. In particular, I'd like to have a rage ability that allows me to specify a console input, with this case being forcertd. I was thinking something like this might work, but I'd like some pointers from anyone who knows more about this than I do:

Rage_RTD(const String:gambler_rolldice[], boss)
{
new Float:bossPosition[3], Float:targetPosition[3];
new Float:duration=FF2_GetAbilityArgumentFloat(bo ss, gambler_rolldice, roll_the_dice, 1, 5.0);
new client=GetClientOfUserId(FF2_GetBossUserId(bo ss));
new Float:distance=FF2_GetRageDist(boss, gambler_rolldice, roll_the_dice);
GetEntPropVector(client, Prop_Send, "m_vecOrigin", bossPosition);
for(new target=1; target<=MaxClients; target++)
{
if(IsClientInGame(target) && IsPlayerAlive(target) && GetClientTeam(target)!=BossTeam)
{
GetEntPropVector(target, Prop_Send, "m_vecOrigin", targetPosition);
if(!TF2_IsPlayerInCondition(target, TFCond_Ubercharged) && (GetVectorDistance(bossPosition, targetPosition)<=distance))
{
if(IsValidClient(client))
RollPerkForClient(client);
}
}
}
}

The specific plan I'm going for is for the boss to have a passive ability allowing him to use RTD at the cost of 30% rage. I know it's possible, but because I'm extremely new to this, it's all foreign to me, so I don't know what to do.




EDIT: With some help from Naydef, I was able to simplify the SP down to this:

//Includes

#include <sourcemod>

//Plugin

public void VSH_OnDoRage()
{
ServerCommand("sm_forcertd @blue random");
}


It looks like it should work, but at the same time, I feel I'm missing something. Is there anything I left out?
__________________
Professional retard. I might borrow some code, but I always try to give credit when I do! If you've noticed I've borrowed some of your code, and you have a problem with that, please add me on Steam and let me know so I can correct the problem as soon as possible!

Last edited by LordHotPocketHomicide; 06-07-2018 at 13:16.
LordHotPocketHomicide is offline