View Single Post
Author Message
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 02-24-2019 , 09:54   LineGoesThroughSmoke (CSGO)
Reply With Quote #1

Posting on behalf of my friend who is banned but wants to help others

PHP Code:
#include sdktools

stock bool LineGoesThroughSmoke(float from[3], float to[3])
{
    static 
Address TheBots;
    static 
Handle CBotManager_IsLineBlockedBySmoke;
    static 
int OS;
    
    if(
OS == 0)
    {
        
Handle hGameConf LoadGameConfigFile("LineGoesThroughSmoke.games");
        if(!
hGameConf)
        {
            
SetFailState("Could not read LineGoesThroughSmoke.games.txt");
            return 
false;
        }
        
        
OS GameConfGetOffset(hGameConf"OS");
        
        
TheBots GameConfGetAddress(hGameConf"TheBots");
        if(!
TheBots)
        {
            
CloseHandle(hGameConf);
            
SetFailState("TheBots == null");
            return 
false;
        }
        
        
StartPrepSDKCall(SDKCall_Raw);
        
PrepSDKCall_SetFromConf(hGameConfSDKConf_Signature"CBotManager::IsLineBlockedBySmoke");
        
PrepSDKCall_AddParameter(SDKType_VectorSDKPass_Pointer);
        
PrepSDKCall_AddParameter(SDKType_VectorSDKPass_Pointer);
        if(
OS == 1PrepSDKCall_AddParameter(SDKType_FloatSDKPass_Plain);
        
PrepSDKCall_SetReturnInfo(SDKType_BoolSDKPass_Plain);
        if(!(
CBotManager_IsLineBlockedBySmoke EndPrepSDKCall()))
        {
            
CloseHandle(hGameConf);
            
SetFailState("Failed to get CBotManager::IsLineBlockedBySmoke function");
            return 
false;
        }
        
        
CloseHandle(hGameConf);
    }
    
    if(
OS == 1) return SDKCall(CBotManager_IsLineBlockedBySmokeTheBotsfromto1.0);
    return 
SDKCall(CBotManager_IsLineBlockedBySmokeTheBotsfromto);

Anyone that knows how to use this code will know that loading the game data should be separated, this was written for a quick test.

Credits to
komashchenko
Attached Files
File Type: txt LineGoesThroughSmoke.games.txt (956 Bytes, 112 views)

Last edited by SM9; 01-28-2020 at 11:54. Reason: Updated Gamedata
SM9 is offline