Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2014-08-22 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
August 22, 2014, 10:30:25 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://ownageclan.com/jenkins/job/War3Source-Default1/
WIKI page: http://ownageclan.com/wiki/index.php/Main_Page
War3Source GIT repo: https://github.com/War3Source/War3Source
War3Source servers: http://www.game-monitor.com/search.php?vars=a_war3_version=
War3Source Function Reference: http://ownageclan.com/war3source/functionreference/?search=player
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Test race - force other players to trigger abilities / ultimates?  (Read 227 times)
Remy Lebeau
Sr. Member
****
Posts: 425



View Profile WWW
« on: August 08, 2014, 05:43:18 PM »

Is there a way to force players to trigger their abilities / ultimates?

Can FakeClientCommand be used that way?

eg FakeClientCommand( victim, "+ability");  Should that work?

Any other ideas?
Logged

Necavi
Hero Member
*****
Posts: 501


View Profile
« Reply #1 on: August 08, 2014, 09:29:02 PM »

If I remember correctly, yes you can. Or try it
Logged

-El Diablo
Hero Member
*****
Posts: 521


View Profile
« Reply #2 on: August 11, 2014, 05:33:35 AM »

if that doesn't work, try

FakeClientCommandEx(victim, "say /ability");

Personally, I'd just either create a native to do it from War3Source_Engine_CommandHook.sp or use something I've already created in my private copy.



If all else fails, or you'd like to do this better...

Put the following into a includes file and include it in your commandhook and in your race file or any other file you want to do this with:

Maybe call the file:

War3Source_CommandHook_Forwards.inc

Code:
new Handle:g_OnUltimateCommandHandle;
new Handle:g_OnAbilityCommandHandle;

public bool:InitNativesForwards()
{
g_OnUltimateCommandHandle=CreateGlobalForward("OnUltimateCommand",ET_Ignore,Param_Cell,Param_Cell,Param_Cell,Param_Cell);
g_OnAbilityCommandHandle=CreateGlobalForward("OnAbilityCommand",ET_Ignore,Param_Cell,Param_Cell,Param_Cell);
return true;
}

stock TriggerAbility(client,num,pressed)
{
Call_StartForward(g_OnAbilityCommandHandle);
Call_PushCell(client);
Call_PushCell(num);
Call_PushCell(pressed);
new result;
Call_Finish(result);
}

stock TriggerUltimate(client,pressed)
{
 new race=War3_GetRace(client);
 if(race>0)
 {
    Call_StartForward(g_OnUltimateCommandHandle);
    Call_PushCell(client);
    Call_PushCell(race);
    Call_PushCell(pressed);
    new result;
    Call_Finish(result);
 }
}

^^ move that from the  War3Source / addons / sourcemod / scripting / War3Source_Engine_CommandHook.sp file into a War3Source_CommandHook_Forwards.inc file.

Then #includes "W3SIncs/War3Source_CommandHook_Forwards" in the War3Source_Engine_CommandHook.sp file and in your race file.


When you want to trigger a ability or ultimate event for a race, just use the stocks, but make sure you include that file into the race you want to use those for.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!