AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   LineGoesThroughSmoke (CSGO) (https://forums.alliedmods.net/showthread.php?t=314545)

SM9 02-24-2019 09:54

LineGoesThroughSmoke (CSGO)
 
1 Attachment(s)
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

SM9 01-28-2020 11:54

Re: LineGoesThroughSmoke (CSGO)
 
Gamedata updated.

manicogaming 03-23-2020 20:32

Re: LineGoesThroughSmoke (CSGO)
 
Hi, I think this might need an update because as of CS:GO version 1.37.4.5 this is stock is crashing my server.


All times are GMT -4. The time now is 00:23.

Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.