First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))
It seems most sources I've come across either use C++ and are internal or don't include the part about finding the bones, which is where my trouble lies. I don't have any bit of the aimbot done yet since I'm still on the first step, which as far as I can tell is getting the BoneID for the head, and doing stuff with that. Along with view angles. Though I'm pretty lost. I promise I didn't just google for 10 minutes and give up. I've actually been at this for longer than I'd like to admit.
First of all i'd recommend you doing a function which picks a target (You can do it by Player Distance or nearest Player to Crosshair what i'd recommend or with a Visibility Check which is quite hard if you're external(dont use bSpotted))
External visibility checks aren't hard, people just keep copy and pasting code without coding their own stuff.
BSP parsing is pretty easy once you read the documentation by valve about the BSP file format.
Once you've read it, you should easily be able to build your visibility check around that.
The only problem about BSP parsing is that it only contains the map, not the entities that are used on the map, for instance crates or silos. These are entities and would have to be parsed by parsing the entitylist, checking if the position + mins and maxs are within the line of sight. But even that isn't hard.
Oh i didn't even know there was a documentation by Valve, im defenetly gonna check that out
Update: You are actually right. I just finished my BSP Parsing and this article is really useful: https://developer.valvesoftware.com/...SP_File_Format
I thought its pretty hard but it actually isn't.
Last edited by Hunter; 06-26-2016 at 04:36 AM.
Code:DWORD GetBoneMatrixAddr(DWORD BaseAddr) { return Memory.Read<DWORD>(BaseAddr + m_dwBoneMatrix); } Vector3 GetBonePos(DWORD BoneMatrixAddr, int TargetBone) { Vector3 temp; temp.x = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x0C); temp.y = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x1C); temp.z = Memory.Read<float>(BoneMatrixAddr + 0x30 * TargetBone + 0x2C); return temp; }
m_bSpotted is used for the radar and indicates whether you know about the position of an entity or not. This means that the entity is also displayed when a teammate of yours sees the enemy. You would rather want to use m_bSpottedByMask, which is a bitmask. You can mask out your own player to know whether your player sees the entity or not. You can also query the bitmask to ask if your teammates saw the entity.
The radar is not as important as the gameplay, so the radar isn't instantly updated nor is it accurate. If you can clearly see his back, it doesn't mean your radar shows the entity as visible.
The following video shows you how detecting an entity works in csgo.
It's slowly updating and not really accurate.
Last edited by WasserEsser; 06-24-2016 at 10:12 AM.
AbsoluteMadman (06-24-2016),Hunter (06-24-2016)
Ok, well I'll use it in the beginning just to get everything working since I assume it's easier than setting up BSP Parsing. How do I find my current view angle and then use that method Graaff posted to set my view angle to the head of the entity closest to my crosshair? I don't really get anything about how aimbots work, tbh. I've searched google and the forums, and it's only made some things more confusing.
Right now I'm just trying to get my Eye Position since I assume this is the first thing I have to do. Though I can't figure out how to read Vectors from memory in c#. I'm using Zat's vector3 class, since m_vecOrigin + m_vecViewOffset returns a Vector3.
My ReadInt method would look like this
I can't do the same thing and just try to pass in a Vector3 because I have to somehow convert the byte array (buffer) to a Vector3. Tried using anonymous types, but the same problem arises.Code:public int ReadInt(int address) { byte[] buffer = new byte[4]; ReadProcessMemory(handle, address, buffer, 4, 0); return BitConverter.ToInt32(buffer, 0); }
EDIT: Got reading a vector working, however, as for getting the eye position in order to calculate the angles. I'm reading LocalPlayer + m_vecOrigin as a Vector3. Is the Z here my Eye Position? So now would I go on to find the position of the head bone of the entity I want to shoot at and subtract that from the vector I just read?
Last edited by AbsoluteMadman; 06-26-2016 at 04:01 PM.
I'm sorry to say this, but if you don't even know how to use ReadProcessMemory properly to read a vector, you shouldn't try to make an aimbot. You'll end up copy pasting everything you see, which is not the point of programming. I'd suggest learning the basics first, practice with easier stuff, then learn the proper math for an aimbot and eventually move onto making an aimbot.
I've been programming for a few years. Made a bunch of generic bhop/triggerbot/glow cheats, etc. Never had to deal with vectors in C# though. I didn't think i could just use a float array to represent the x/y/z, but i realized today i could. I copy pasted stuff in the beginning, but messed with stuff immediately and came to understand it, which is pretty much what i'm trying to do with the aimbot, just without the copy paste.