Thread: Fake touch
View Single Post
eyal282
Veteran Member
Join Date: Aug 2011
Old 01-16-2018 , 18:59   Re: Fake touch
Reply With Quote #6

Quote:
Originally Posted by hmmmmm View Post
You can try creating an SDKCall for CBaseEntity::Touch( CBaseEntity* pOther ) which (I think) gets called when 2 entities touch each other.

Here is some code that should do that:

PHP Code:
Handle g_hSDK_Touch;

public 
void OnPluginStart()
{
    
Handle hGameConf LoadGameConfigFile("sdkhooks.games");
    if(
hGameConf == INVALID_HANDLE)
    {
        
SetFailState("GameConfigFile sdkhooks.games was not found");
        return;
    }
    
    
StartPrepSDKCall(SDKCall_Entity);
    
PrepSDKCall_SetFromConf(hGameConfSDKConf_Virtual"Touch");
    
PrepSDKCall_AddParameter(SDKType_CBaseEntitySDKPass_Pointer);
    
g_hSDK_Touch EndPrepSDKCall();
    
CloseHandle(hGameConf);

    if(
g_hSDK_Touch == INVALID_HANDLE)
    {
        
SetFailState("Unable to prepare virtual function CBaseEntity::Touch");
        return;
    }
}

// later when you want to call it
SDKCall(g_hSDK_Touchentity1entity2); 
This will just call the Touch function for the 2 entities which should simulate them "touching" (or at least the code that runs when they do), but it might not necessarily work the way you expect to or give you the effect you're looking for.
Doesn't work... Any method to trick the game further? Combine touch with think ETC? I don't understand the core of how these things work.
eyal282 is offline