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(hGameConf, SDKConf_Signature, "CBotManager::IsLineBlockedBySmoke");
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_Pointer);
if(OS == 1) PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain);
PrepSDKCall_SetReturnInfo(SDKType_Bool, SDKPass_Plain);
if(!(CBotManager_IsLineBlockedBySmoke = EndPrepSDKCall()))
{
CloseHandle(hGameConf);
SetFailState("Failed to get CBotManager::IsLineBlockedBySmoke function");
return false;
}
CloseHandle(hGameConf);
}
if(OS == 1) return SDKCall(CBotManager_IsLineBlockedBySmoke, TheBots, from, to, 1.0);
return SDKCall(CBotManager_IsLineBlockedBySmoke, TheBots, from, to);
}
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