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? |
Re: Plugin Help: On Rage, Console Command
You know you can just use this subplugin: https://forums.alliedmods.net/showthread.php?t=200411
|
Re: Plugin Help: On Rage, Console Command
Quote:
|
All times are GMT -4. The time now is 20:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.