Raised This Month: $ Target: $400
 0% 

[TF2] Play unused Shortstop shove anim


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 01-17-2017 , 16:02   [TF2] Play unused Shortstop shove anim
Reply With Quote #1

PHP Code:
#include <sdktools>
#include <sdkhooks>
#include <dhooks>

#pragma newdecls required

//DHook
Handle g_hGetSecondaryAttackActivity

//SDKCall
Handle g_hSDKPlayGesture;

public 
Plugin myinfo 
{
    
name "[TF2] ",
    
author "Pelipoika",
    
description "",
    
version "1.0",
    
url "http://www.sourcemod.net/plugins.php?author=Pelipoika&search=1"
};

//tf_weapon_handgun_scout_primary 
//ACT_MP_PUSH_STAND_SECONDARY  1817
//ACT_MP_PUSH_CROUCH_SECONDARY 1818
//ACT_MP_PUSH_SWIM_SECONDARY   1819
//CTFPlayer::PlayGesture "mp_playgesture: unknown sequence or act"

public void OnPluginStart()
{
    
//CTFPistol_ScoutPrimary::SecondaryAttack
    
g_hGetSecondaryAttackActivity DHookCreate(279HookType_EntityReturnType_IntThisPointer_CBaseEntityCTFPistol_ScoutPrimary__SecondaryAttack);
    
DHookAddParam(g_hGetSecondaryAttackActivityHookParamType_CBaseEntity);
    
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetSignature(SDKLibrary_Server"\x55\x8B\xEC\x83\xEC\x30\x53\x56\x8B\x75\x08\x57\x56\x8B\xF9\xE8\x2A\x2A\x2A\x2A\x8B\xD8\x83\xFB\xFF\x74\x2A\x8B\x35\x2A\x2A\x2A\x2A\x8B\xCE\x8B\x16\xFF\x52\x64\x8B\x8F\xF0\x1F\x00\x00\x53\x6A\x14"49);
    
PrepSDKCall_AddParameter(SDKType_StringSDKPass_Pointer);
    if ((
g_hSDKPlayGesture EndPrepSDKCall()) == INVALID_HANDLESetFailState("Failed to create SDKCall for CTFPlayer::PlayGesture offset!");
}

public 
void OnEntityCreated(int ent, const char[] classname)
{
    if(
StrEqual(classname"tf_weapon_handgun_scout_primary"))
    {
        
SDKHook(entSDKHook_SpawnOnCTFPistol_ScoutPrimarySpawn);
    }
}

public 
void OnCTFPistol_ScoutPrimarySpawn(int wep)
{
    
DHookEntity(g_hGetSecondaryAttackActivitytruewep);
}

public 
MRESReturn CTFPistol_ScoutPrimary__SecondaryAttack(int pThisHandle hReturnHandle hParams)
{
    
int client GetEntPropEnt(pThisProp_Data"m_hOwnerEntity");
    if(
client 0)
    {
        if(
GetEntProp(clientProp_Send"m_nWaterLevel") >= 2)
        {
            
SDKCall(g_hSDKPlayGestureclient"ACT_MP_PUSH_SWIM_SECONDARY");
        }
        else if(
GetEntProp(clientProp_Send"m_bDucked")) 
        {
            
SDKCall(g_hSDKPlayGestureclient"ACT_MP_PUSH_CROUCH_SECONDARY");
        }
        else         
        {
            
SDKCall(g_hSDKPlayGestureclient"ACT_MP_PUSH_STAND_SECONDARY");
        }
    }
    
    return 
MRES_Ignored;

DHooks and stuff, if you're gonna release this or something put the gamedata in a config
__________________

Last edited by Pelipoika; 01-17-2017 at 16:03.
Pelipoika is offline
 



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 18:54.


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