Werbung | |
|
--
|
23.09.2003, 11:39 | - 10 |
Neuer Benutzer Registriert seit: 05.02.2003
Beiträge: 0
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
|
änderunge3n bei X-Con:-) Aimbot.cpp /* FiLe NaMe: AIMBOT.CPP Credits: - SniPiTy ( NoSpread + Awall ) - Elbek ( Great Great Help, You Own ) - w00t - P4tr!ck - Ret4rT - StreetMedic ( Helped Alot, This Guy OwnZ ) - LTFX : Hack: WeeD X Next Genaration Version: WeeD X NG - BeTa 2 Dll Name: WeeD X NG.dll TiMe & DaTe: 3:56 13-07-2003 Made By: TuP4c Source's Used: TuP4c Hook, SnIpItY HooK, BiOhAzArD Original Source: TuP4c HooK Beta 1 */ #define WIN32_LEAN_AND_MEAN #pragma warning (disable:4786) #include <windows.h> #include <stdlib.h> #include <math.h> #undef NDEBUG #include <assert.h> #include <memory.h> #include <map> #include <vector> #include <fstream> #include "engine/wrect.h" #include "engine/cl_dll.h" #include "engine/cdll_int.h" #include "engine/util_vector.h" #include "engine/cl_entity.h" #include "common/com_model.h" #include "common/event_api.h" #include "engine/pmtrace.h" #include "engine/pm_defs.h" #include "aimbot.h" #include "wx_cmd.h" #include "client.h" #include "interpreter.h" #include "trace.h" #include "attack.h" #include "misc/defs.h" #include "playeritems.h" #include "perfectwall.h" #pragma optimize("gtp",on) #define BOUND_VALUE(var,min,max) if((var)>(max)){(var)=(max);};if((var)<(min)){(var )=(min);} #define X_PI 3.14159 using namespace std; OriginAimbot gAimbot; #define gAimbot This define is to prevent usage of gAimbot in this file. extern float mainViewOrigin[3],mainViewAngles[3]; //================================================== ================================= void VectorAngles( const float *forward, float *angles ) { float tmp,yaw,pitch; if (forward[1] == 0 && forward[0] == 0) { yaw = 0; if (forward[2] > 0) pitch = 90.0; else pitch = 270.0; } else { if (wx_cmd.weedx_pi) { yaw = (float)(atan2(forward[1], forward[0]) * 180.0 / 3.141592653589793238462643383279502884197169399375 10582097494459230781640628620899862803482534211706 79821480865132823066f); } else { yaw = (float)(atan2(forward[1], forward[0]) * 180.0 / X_PI); } if (yaw < 0) yaw += 360.0; tmp = (float)sqrt (forward[0]*forward[0] + forward[1]*forward[1]); if (wx_cmd.weedx_pi) { pitch = (float)(atan2(forward[2], tmp) * 180 / 3.141592653589793238462643383279502884197169399375 10582097494459230781640628620899862803482534211706 79821480865132823066f); } else { pitch = (float)(atan2(forward[2], tmp) * 180 / X_PI); } if (wx_cmd.weedx_pi == 2) { yaw = (float)(atan2(forward[1], forward[0]) * 57.30659); if (yaw < 0) yaw += 360.0; tmp = (float)sqrt (forward[0]*forward[0] + forward[1]*forward[1]); pitch = (float)(atan2(forward[2], tmp) * 57.30659); } } angles[0] = pitch; angles[1] = yaw; angles[2] = 0; } //================================================== ================================== int CanPenetrate( float *start, float *end, int power ) { static pmtrace_t* tr = (pmtrace_t*)0x02252DF0; float view[3]; float dir[3]; view[0] = end[0] - start[0]; view[1] = end[1] - start[1]; view[2] = end[2] - start[2]; float length = VectorLength(view); dir[0] = view[0] / length; dir[1] = view[1] / length; dir[2] = view[2] / length; float position[3]; position[0] = start[0]; position[1] = start[1]; position[2] = start[2]; tr->startsolid = true; while( power ) { if( !tr->startsolid ) power--; tr = gEngfuncs.PM_TraceLine( position, end, PM_TRACELINE_PHYSENTSONLY, 2, -1); if( tr->fraction==1.0f ) return 1; if( tr->allsolid ) return 0; position[0] = tr->endpos[0] + dir[0] * 8.0f; position[1] = tr->endpos[1] + dir[1] * 8.0f; position[2] = tr->endpos[2] + dir[2] * 8.0f; } return 0; } //================================================== int CorrectGunX() { if (currentWeaponID == WEAPON_SG550 || currentWeaponID == WEAPON_G3SG1 || currentWeaponID == WEAPON_SCOUT || currentWeaponID == WEAPON_AWP) { return 3; } if (currentWeaponID == WEAPON_AUG || currentWeaponID == WEAPON_PARA || currentWeaponID == WEAPON_COLT || currentWeaponID == WEAPON_DEAGLE || currentWeaponID == WEAPON_SIG || currentWeaponID == WEAPON_AK) { return 2; } { return 0; } } //================================================== ================================== int PathFree(float* from,float* to) { int pathtest; pmtrace_t tr; gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); gEngfuncs.pEventAPI->EV_PlayerTrace( from, to, PM_GLASS_IGNORE, me.ent->index, &tr ); pathtest = (tr.fraction == 1.0); if (!pathtest && wx_cmd.autowall && CorrectGunX()) { pathtest = CanPenetrate(from, to, CorrectGunX()); } return pathtest; } //================================================== ================================= static void PredictTarget(int index,float *pred) { VectorCopy(vPlayers[index].getEnt()->origin,pred); } //================================================== ================================= float OriginAimbot::GetAimingFov(int ax) { float vec[3], view[3]; float dot; float* origin = vPlayers[ax].getEnt()->origin; view[0] = origin[0] - me.pmEyePos[0]; view[1] = origin[1] - me.pmEyePos[1]; view[2] = origin[2] - me.pmEyePos[2]; dot = sqrt(view[0] * view[0] + view[1] * view[1] + view[2] * view[2]); dot = 1/dot; vec[0] = view[0] * dot; vec[1] = view[1] * dot; vec[2] = view[2] * dot; { view[0] = sin((me.viewAngles[1] + 90) * 0.01745); view[1] = -cos((me.viewAngles[1] + 90) * 0.01745); view[2] = -sin(me.viewAngles[0] * 0.01745); } if (wx_cmd.weedx_pi) { view[0] = sin((me.viewAngles[1] + 90) * (3.14159265358979323846264338327950288419716939937 51058209749445923078164062862089986280348253421170 679821480865132823066f / 180)); view[1] = -cos((me.viewAngles[1] + 90) * (3.14159265358979323846264338327950288419716939937 51058209749445923078164062862089986280348253421170 679821480865132823066f / 180)); view[2] = -sin( me.viewAngles[0] * (3.14159265358979323846264338327950288419716939937 51058209749445923078164062862089986280348253421170 679821480865132823066f / 180)); } else { view[0] = sin((me.viewAngles[1] + 90) * (X_PI / 180)); view[1] = -cos((me.viewAngles[1] + 90) * (X_PI / 180)); view[2] = -sin( me.viewAngles[0] * (X_PI / 180)); } dot = view[0] * vec[0] + view[1] * vec[1] + view[2] * vec[2]; return dot; } //================================================== ================================= void OriginAimbot::CalcFovangleAndVisibility(int ax) { int damage; float targetspot[3]; PlayerInfo& r = vPlayers[ax]; r.fovangle = ((1.0-GetAimingFov(ax))*360.0); if (!GetAimingTeam(ax)) { r.visible = 0; r.damage = 0; r.damagespot[0] = 0; r.damagespot[1] = 0; r.damagespot[2] = 0; } else { damage = GetDamageVec(ax, targetspot, true); if (damage) { r.visible = 2; } else { damage = GetDamageVec(ax, targetspot, false); if (damage) r.visible = 1; else r.visible = 0; } r.damage = damage; r.damagespot[0] = targetspot[0]; r.damagespot[1] = targetspot[1]; r.damagespot[2] = targetspot[2]; } } void OriginAimbot::FindTarget() { // target locking if( wx_cmd.lock && target!=-1 && vPlayers[target].getPVS() && GetPlayerVisX(target) ) { return; } // scan for a new target target=-1; for (int ax=0;ax<vPlayers.size();ax++) if ( vPlayers[ax].getAlive() && vPlayers[ax].getPVS() && GetPlayerVisX(ax) && GetAimingTeam(ax) && vPlayers[ax].fovangle<wx_cmd.fov) { if( target == -1 ) { target = ax; continue; } switch(wx_cmd.mode) { default: case 0: // distance based if( vPlayers[ax].visible && !vPlayers[target].visible ) { target = ax; break; } if( vPlayers[ax].distance < vPlayers[target].distance ) { target = ax; break; } break; case 1: // fov based if( vPlayers[ax].visible && !vPlayers[target].visible ) { target = ax; break; } if( GetAimingFov(ax) > GetAimingFov(target) ) { target = ax; break; } break; } } } //================================================== ============================ void OriginAimbot:raw() { for (int ax=0;ax<vPlayers.size();ax++) if (vPlayers[ax].getPVS() ) Draw_Player_Vecs(ax); } //================================================== ============================ void OriginAimbot:raw_Player_Vecs(int ax) { vec3_t aim_location, target_origin; vec3_t up, right, forward, playerAngles; vector<aimvec>::iterator pos, end; if (vPlayers[ax].getEnt()->curstate.usehull == 0) { pos = AimVecsS.begin(); end = AimVecsS.end(); } else { pos = AimVecsD.begin(); end = AimVecsD.end(); } PredictTarget(ax,target_origin); playerAngles[0]=0; playerAngles[1]=vPlayers[ax].getEnt()->angles[1]; playerAngles[2]=0; gEngfuncs.pfnAngleVectors (playerAngles, forward, right, up); forward[2] = -forward[2]; register DWORD color = 0xFF1111FF; for (;pos!=end;++pos) { VectorCopy(target_origin,aim_location); aim_location = aim_location + forward * pos->f; aim_location = aim_location + up * pos->h; aim_location = aim_location + right * pos->r; gDrawFilledBoxAtLocation(aim_location,color,1); color = 0xFFFFFFFF; } } aimvec* OriginAimbot::TargetRegion(int ax) { vec3_t vecEnd, up, right, forward, EntViewOrg,PredOrg, playerAngles; static struct aimvec temp = {0,0,0}; PredictTarget(ax,PredOrg); vector<aimvec>::iterator si, end; if (vPlayers[ax].getEnt()->curstate.usehull == 0) { if (AimVecsD.size() > 0) { si = AimVecsS.begin(); end = AimVecsS.end(); } else return &temp; } else { if (AimVecsD.size() > 0) { si = AimVecsD.begin(); end = AimVecsD.end(); } else return &temp; } playerAngles[0]=0; playerAngles[1]=vPlayers[ax].getEnt()->angles[1]; playerAngles[2]=0; gEngfuncs.pfnAngleVectors (playerAngles, forward, right, up); forward[2] = -forward[2]; for (;si!=end;++si) { VectorCopy(PredOrg,EntViewOrg); EntViewOrg = EntViewOrg + forward * si->f; EntViewOrg = EntViewOrg + up * si->h; EntViewOrg = EntViewOrg + right * si->r; if(PathFree(me.pmEyePos,EntViewOrg)) return &(*si); } return NULL; } int OriginAimbot::GetDamageVec(int ax, float *targetspot, bool onlyvis) { int hitdamage, penetration = WALL_PEN0, bullettype, damage; vec3_t vecEnd, up, right, forward, EntViewOrg, PlayerOrigin, playerAngles; float distance, wallpierce, defaultvec[3] = {0,0,0}; vector<aimvec>::iterator si, end; PredictTarget(ax,PlayerOrigin); if (vPlayers[ax].getEnt()->curstate.usehull == 0) { if (AimVecsS.size() > 0) { si = AimVecsS.begin(); end = AimVecsS.end(); defaultvec[0] = AimVecsS[0].h; defaultvec[1] = AimVecsS[0].f; defaultvec[2] = AimVecsS[0].r; } } else { if (AimVecsD.size() > 0) { si = AimVecsD.begin(); end = AimVecsD.end(); defaultvec[0] = AimVecsD[0].h; defaultvec[1] = AimVecsD[0].f; defaultvec[2] = AimVecsD[0].r; } } playerAngles[0]=0; playerAngles[1]=vPlayers[ax].getEnt()->angles[1]; playerAngles[2]=0; gEngfuncs.pfnAngleVectors(playerAngles, forward, right, up); forward[2] = -forward[2]; if (!onlyvis && wx_cmd.autowall) penetration = playerItems.CurPenetration(); bullettype = playerItems.CurBulletType(); damage = playerItems.CurDamage(); distance = playerItems.CurDistance(); wallpierce = playerItems.CurWallPierce(); for (;si!=end;++si) { targetspot[0] = PlayerOrigin[0] + up[0] * si->h + forward[0] * si->f + right[0] * si->r; targetspot[1] = PlayerOrigin[1] + up[1] * si->h + forward[1] * si->f + right[1] * si->r; targetspot[2] = PlayerOrigin[2] + up[2] * si->h + forward[2] * si->f + right[2] * si->r; hitdamage = CanPenetrate(me.pmEyePos, targetspot, distance, penetration, bullettype, damage, wallpierce); if (hitdamage > 0) return hitdamage; } targetspot[0] = PlayerOrigin[0] + up[0] * defaultvec[0] + forward[0] * defaultvec[1] + right[0] * defaultvec[2]; targetspot[1] = PlayerOrigin[1] + up[1] * defaultvec[0] + forward[1] * defaultvec[1] + right[1] * defaultvec[2]; targetspot[2] = PlayerOrigin[2] + up[2] * defaultvec[0] + forward[2] * defaultvec[1] + right[2] * defaultvec[2]; return CanPenetrate(me.pmEyePos, targetspot, distance, penetration, bullettype, damage, wallpierce); } //================================================== ============================ void OriginAimbot::CalcTargetSpot(float *out) { vec3_t vecEnd, up, right, forward, EntViewOrg, playerAngles; cl_entity_s* ent = vPlayers[target].getEnt(); PredictTarget(target,out); playerAngles[0]=0; playerAngles[1]=ent->angles[1]; playerAngles[2]=0; gEngfuncs.pfnAngleVectors (playerAngles, forward, right, up); aimvec* si = TargetRegion(target); float h=0,r=0,f=0; if (si) { f = si->f; h = si->h; r = si->r; } else { if (ent->curstate.usehull==0) { if (AimVecsS.size() > 0) { f = AimVecsS[0].f; h = AimVecsS[0].h; r = AimVecsS[0].r; } } else { if (AimVecsD.size() > 0) { f = AimVecsD[0].f; h = AimVecsD[0].h; r = AimVecsD[0].r; } } } // add aim vecs. (out=predicted origin) out[0] = out[0] + forward[0]*f + up[0]*h + right[0]*r; out[1] = out[1] + forward[1]*f + up[1]*h + right[1]*r; out[2] = out[2] + forward[2]*f + up[2]*h + right[2]*r; } //================================================== ============================ void OriginAimbot::CalcVec_MeToTarget(float *view) { float EntViewOrg[3]; CalcTargetSpot(EntViewOrg); VectorCopy(EntViewOrg,aim_spot); view[0] = EntViewOrg[0] - me.pmEyePos[0]; view[1] = EntViewOrg[1] - me.pmEyePos[1]; view[2] = EntViewOrg[2] - me.pmEyePos[2]; } //================================================== ============================ void OriginAimbot::CalcViewAngles() { float vec_to_target[3]; vec_to_target[0] = vPlayers[target].damagespot[0] - me.pmEyePos[0]; vec_to_target[1] = vPlayers[target].damagespot[1] - me.pmEyePos[1]; vec_to_target[2] = vPlayers[target].damagespot[2] - me.pmEyePos[2]; VectorAngles(vec_to_target,aim_viewangles); aim_viewangles[0] *= -1; if (aim_viewangles[0]>180) aim_viewangles[0]-=360; if (aim_viewangles[1]>180) aim_viewangles[1]-=360; } Aimbot.h * Credits: - SniPiTy ( NoSpread + Awall ) - Elbek ( Great Great Help, You Own ) - w00t - P4tr!ck - Ret4rT - StreetMedic ( Helped Alot, This Guy OwnZ ) - LTFX : Hack: WeeD X Next Genaration Version: WeeD X NG - BeTa 2 Dll Name: WeeD X NG.dll TiMe & DaTe: 3:56 13-07-2003 Made By: TuP4c Source's Used: TuP4c Hook, SnIpItY HooK, BiOhAzArD Original Source: TuP4c HooK Beta 1 */ #ifndef AIMBOT_H #define AIMBOT_H #include "client.h" #include "engine/r_studioint.h" #include "engine/studio.h" #include <map> using namespace std; struct aimvec { float h; float f; float r; }; int CanPenetrate( float *start, float *end, int power ); //bool CorrectGun( ); int PathFree( float *from, float *to ); void VectorAngles( const float *forward, float *angles ); class OriginAimbot { public: virtual void FindTarget(); virtual void CalcViewAngles(); vec3_t aim_viewangles, aim_spot; vector<aimvec> AimVecsS; vector<aimvec> AimVecsD; virtual void Draw(); int target; int firstaimspot; virtual void CalcFovangleAndVisibility (int ax); protected: int GetDamageVec(int ax, float *targetspot, bool onlyvis); virtual void CalcVec_MeToTarget ( float* out ); virtual void CalcTargetSpot ( float *out ); virtual aimvec* TargetRegion ( int ax); virtual void Draw_Player_Vecs ( int ax ); virtual float GetAimingFov (int ax); virtual bool GetPlayerVisX (int ax){ return (wx_cmd.aimthru || vPlayers[ax].visible); } virtual bool GetAimingTeam (int ax) { if (wx_cmd.team<=0 && (me.team != vPlayers[ax].team)) return true; if (wx_cmd.team==1) return true; if (wx_cmd.team>1 && (me.team == vPlayers[ax].team)) return true; return false; } public: OriginAimbot() : target(-1), firstaimspot(0) {} virtual ~OriginAimbot(){} }; extern OriginAimbot gAimbot; #endif Das ist schon mal ein beispiel!!! [red]Und noch was dann sage ich OGC das ihr euren x-con ohne credits von ihnen habt!!!! weil jeder hack basiert ein bischen auf OGC client!!![/red] |
|
23.09.2003, 14:54 | - 12 | |
Neuer Benutzer Registriert seit: 20.09.2003
Beiträge: 0
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
| Zitat:
| |
|
23.09.2003, 17:23 | - 13 | ||
Neuer Benutzer Registriert seit: 29.04.2003
Beiträge: 0
Abgegebene Danke: 0
Erhielt 0 Danke für 0 Beiträge
| Zitat:
:-) | ||
|
| |