i meant no offence but if you can't make it work with that much given code, it only means that you have no idea of what you are doing. stop copy pasting codes.
you must understand how it works. It all revolves to one vital declaration or data type which is "coordinates" (x and y)
ESP works based on X and Y so does Aimbot, mouse event, pitch and yaw.
You need to perfectly get the 3D (x, y, z) bones of each player then convert it to screen coords using world2screen (2D hence, x and y) which will give you the X and Y.
Check if the Screen coords are on the screen if yes then proceed to draw, else, don't draw.
Same as aimbot, gather every screen coords of the one significant bone (the bone you want to target) then index it to which mode you wanna trigger the aimbot (distance, crosshair, etc.)
Code:
//declare localplayer, get local player structure (CPLAYER)
var localplayer = getlocalplayer();
for (size_t i = 0; i < MAXPLAYER; i++) {
//get entity structure by index
var entity = getentitybyindex(i);
//match if entity pointer is == localplayer, if it does, skip the current loop.
if(localplayer == entity) continue;
//get coords, this time im gonna use the E0 of modelinstance which is position.
3DVECTOR POSITION = Localplayer->LTObject->Position;
//transform the 3 dimensional coords to screen coords.
2DVector OUT;
//if world to screen converter return false, it means that the 2D coords is not in front of your camera or is not on screen,
you don't want to include those coords behind you as it will draw in front of your screen.
if (!w2s(&position,OUT)) continue;
//if everything checks out, then draw.
drawline(Screen.x, Screen.y, OUT.x, OUT.y);
}
I hope you get the idea of what im trying to explain, have fun and goodluck ^_^
as of aimbot, i use mouseevent because it's easier to use than pitch and yaw, pitch and yaw has 4 offsets
pitch_0, yaw_0, pitch_1, yaw_1
same as semi no recoil. you'll need to get the pitch and yaw of 2 game modes, hence 4 offsets.