Results 1 to 10 of 21

Thread: isTouching()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts

    isUseTouching()

    I have made a method for detecting if a player is touching a weapon/turret/bombsite. Basically in any situation where the "Press (F) to use" dialog shows up.

    Use example:
    PHP Code:
    if ( player isUseTouching() ) ... 
    Install

    Open gsc.cpp, CTRL + F and search for "resetNextReliableTime". Then add the following on a new line;
    PHP Code:
    {"isusetouching"         gsc_player_isusetouching      0}, 
    Open gsc_player.hpp, CTRL + F and search for "void gsc_player_resetNextReliableTime(int id);". Then add the following on a new line;
    PHP Code:
    void gsc_player_isusetouching(int id); 
    Open gsc_player.cpp, CTRL + F and search for "// entity functions". Then add the following on a new line;
    PHP Code:
    void gsc_player_isusetouching(int id) {
        
    #if COD_VERSION == COD2_1_0
            
    int info_use_offset 0x0811F004;
        
    #elif COD_VERSION == COD2_1_2
            
    int info_use_offset 0x08121338;
        
    #elif COD_VERSION == COD2_1_3
            
    int info_use_offset 0x08121494;
        
    #endif
        
        
    int entity gentities id gentities_size;
        
    int base[2050];
        
    int res 0;
        
        
    int (*isUseHover)(int a1void *d);
        *(
    int *)&isUseHover info_use_offset;
        
        
    res isUseHover(entitybase);
        
    stackPushInt(res);

    Compile your version and you are done.
    Last edited by filthy_freak_; 15th June 2015 at 15:28. Reason: isTouching() to isUseTouching()

  2. The Following 2 Users Say Thank You to filthy_freak_ For This Useful Post:

    kung foo man (15th June 2015),serthy (15th June 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •