About:
This extension simply provides a forward that allows complete manipulation over the m_nSequence netprop for any survivor or special infected.
This extension does nothing of its own other than provide a forward for other plugins to use.
Installation: Download the zip located at the bottom of the post and extract the contents of the DCExt folder into /left4dead2/addons/sourcemod/
Description:
Provides a forward for the manipulation of the m_nSequence netprop.
Forwards:
PHP Code:
/**
* @brief Called when CBaseAnimating::SelectWeightedSequence(int Activity) is invoked for a survivor or si
* @remarks Called every frame to update a client's m_nSequence netprop
*
* @param client the client that is playing as a survivor or special infected
* @param sequence current selected sequence m_nSequence, option to override the return value with it
*
* @return Pl_Handled to override return value, Pl_Continue otherwise.
*/
forward Action:L4D2_OnSelectWSequence(client, &sequence);
Here's an example plugin of what can be done:
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <dcext>
public Action:L4D2_OnSelectWSequence(client, &sequence)
{
if (client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && IsPlayerAlive(client))
{
decl String:model[64];
GetEntPropString(client, Prop_Data, "m_ModelName", model, sizeof(model));
if (StrContains(model, "coach", false) != -1 && sequence == 202 //coach_run_pistol)
{
sequence = 227; //Run_SMG
return Plugin_Handled;
}
}
return Plugin_Continue;
}
This plugin for example, replaces Coach's buggy and glitchy Single Pistol/Magnum running animation, with his SMG running animation, which looks good enough while also not being buggy.
Thanks to:
Machine - For helping and compiling this extension for me!
Changelog -
Initial Release (09-06-2015)
NOTE:
As of now, this is a windows only release, since I have no real way of compiling extensions for Linux, if someone could help with that it'd be really appreciated (source is included in the zip)
DOWNLOAD THE EXTENSION (AND SOURCE) HERE
__________________