Raised This Month: $12 Target: $400
 3% 

FF2 Plugin Help: On Rage, Console Command


Post New Thread Reply   
 
Thread Tools Display Modes
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
Transit Of Venus
Senior Member
Join Date: May 2014
Location: Australia
Old 06-07-2018 , 15:33   Re: Plugin Help: On Rage, Console Command
Reply With Quote #2

You know you can just use this subplugin: https://forums.alliedmods.net/showthread.php?t=200411
__________________

Click on the banner to explore my servers and more
Transit Of Venus is offline
Send a message via ICQ to Transit Of Venus Send a message via Skype™ to Transit Of Venus
LordHotPocketHomicide
Member
Join Date: Aug 2016
Location: This Realm of Existence
Old 06-07-2018 , 20:14   Re: Plugin Help: On Rage, Console Command
Reply With Quote #3

Quote:
Originally Posted by Transit Of Venus View Post
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.
__________________
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!
LordHotPocketHomicide is offline
Reply


Thread Tools
Display Modes

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 08:23.


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