AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   VSH / Freak Fortress (https://forums.alliedmods.net/forumdisplay.php?f=154)
-   -   FF2 Plugin Help: On Rage, Console Command (https://forums.alliedmods.net/showthread.php?t=308121)

LordHotPocketHomicide 06-07-2018 12:57

Plugin Help: On Rage, Console Command
 
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?

Transit Of Venus 06-07-2018 15:33

Re: Plugin Help: On Rage, Console Command
 
You know you can just use this subplugin: https://forums.alliedmods.net/showthread.php?t=200411

LordHotPocketHomicide 06-07-2018 20:14

Re: Plugin Help: On Rage, Console Command
 
Quote:

Originally Posted by Transit Of Venus (Post 2595751)
You know you can just use this subplugin: https://forums.alliedmods.net/showthread.php?t=200411

I discovered that minutes after posting this and felt like an idiot, but I can't delete this thread, so it's kind of just stuck here. Sorry.


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

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