Quote:
Originally Posted by NightlyRaine
I can't get the result name.
|
Thanks for report. Fixed.
Quote:
Originally Posted by NightlyRaine
And side question, would it be possible to change actions to other existing exactions?
Like when SurvivorLegsMoveOn Suspends_For SurvivorLegsBattleStations, would it be possible to get it to suspend for L4D1SurvivorLegsBattlesStations? Or SurvivorLegsWait? Asking so I know what all is possible.
|
Yep, but you need to create SDKCall for SurvivorLegsBattleStations constructor
Spoiler
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#include <actions>
public void OnActionCreated( BehaviorAction action, int actor, const char[] name )
{
if ( strcmp(name, "SurvivorLegsMoveOn") == 0 )
{
action.OnUpdatePost = SurvivorLegsStayClose_OnUpdatePost;
}
}
/* ----------------------------------------------------------------------------------------------------*/
/* SurvivorLegsStayClose */
/* ----------------------------------------------------------------------------------------------------*/
public Action SurvivorLegsStayClose_OnUpdatePost( BehaviorAction action, float interval, ActionResult result )
{
if ( result.type == SUSPEND_FOR && result.action != INVALID_ACTION )
{
char name[ACTION_NAME_LENGTH];
result.action.GetName(name, sizeof name);
if ( strcmp(name, "SurvivorLegsBattleStations") != 0 )
return Plugin_Continue;
BehaviorAction.Deallocate(result.action);
result.action = L4D1BattleStationAction();
result.type = SUSPEND_FOR;
return Plugin_Changed;
}
return Plugin_Continue;
}
BehaviorAction L4D1BattleStationAction()
{
static Handle call;
if ( !call )
{
StartPrepSDKCall(SDKCall_Raw);
PrepSDKCall_SetSignature(...);
call = EndPrepSDKCall();
}
BehaviorAction action = BehaviorAction.Allocate(0x483C);
SDKCall(call, action);
return action;
}
__________________