Raised This Month: $51 Target: $400
 12% 

Tricky SDK Call - Crash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-12-2010 , 07:28   Tricky SDK Call - Crash
Reply With Quote #1

Im having trouble getting this mighty SDK Call to work.

As of now, calling it causes the server to crash instantly.


The sig, build, and arguments:
PHP Code:
            /*
             * CTerrorPlayer::Fling(Vector  const&,PlayerAnimEvent_t,CBaseCombatCharacter *,float)
             *
             *    Vector: how target is supposed to fly, Animevent is "76" for chargerbounce, CBasePlayer is Fling cause, float is Incap Animation time
             *
             */
            
"CTerrorPlayer_Fling"
            
{
                
"library"    "server"
                "linux"    "@_ZN13CTerrorPlayer5FlingERK6Vector17PlayerAnimEvent_tP20CBaseCombatCharacterf"
                "windows" "\x81\xEC\x2A\x2A\x2A\x2A\x55\x57\x8B\xE9\x33\xFF\x57\x89\x2A\x2A\x2A\xE8"
                
/* 81 EC ? ? ? ? 55 57 8B E9 33 FF 57 89 ? ? ? E8 */
            

The SDKCall Prep (the error is most likely in here)
PHP Code:
    StartPrepSDKCall(SDKCall_Player);
    
DebugPrintToAll("Fling Call prepped");
    new 
bool:bFlingFuncLoaded PrepSDKCall_SetFromConf(gconfSDKConf_Signature"CTerrorPlayer_Fling");
    if(!
bFlingFuncLoaded)
    {
        
LogError("Could not load the Fling signature");
    }

    
PrepSDKCall_AddParameter(SDKType_VectorSDKPass_ByValue);
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
PrepSDKCall_AddParameter(SDKType_CBasePlayerSDKPass_Pointer);
    
PrepSDKCall_AddParameter(SDKType_FloatSDKPass_Plain);

    
DebugPrintToAll("Fling Signature prepped");
    
fFling EndPrepSDKCall();
    if(
fFling == INVALID_HANDLE)
    {
        
LogError("Could not prep the Fling function");
    } 
Calling

SDKCall(fFling, target, vector, 76, attacker, 3.0);

crashes the server.


Any ideas?



There are no other functions involved in sending a Player flying when a Charger crashes into them, and i had it forwarded to get those arguments.

Last edited by AtomicStryker; 03-12-2010 at 07:33.
AtomicStryker is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 03-12-2010 , 07:45   Re: Tricky SDK Call - Crash
Reply With Quote #2

The first parameter is being passed by reference, not by value.

Also, there's no datatype in sdktools for PlayerAnimEvent_t stuct, you probably have to use an extension to reverse it or send NULL.

Good luck!
pheadxdll is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 03-12-2010 , 09:06   Re: Tricky SDK Call - Crash
Reply With Quote #3

I did use an extension, its simply integer "76" And why is it by reference and not by value? The Source SDK looks like i could use either


EDIT: Works wonderful, thanks man

Last edited by AtomicStryker; 03-12-2010 at 09:11.
AtomicStryker is offline
Reply



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 08:47.


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