?? autowall.txt.txt
字號:
Sup d4wGs... lots of people have been having problems.. etc with adding
autowall
to hacks so this is basically a tutorial.. it's made for
people who know what there doing AND for n00bs ;x .. Enjoy :)
1. Ok first thing we do is after u've done "winmm.lib" and "Win32 Debug"
shit then add all da files
2. Ok after u've added the files open up client.cpp and type #include
"autowall.h" where all the others are
3a. K leave client.cpp open and head down a bit till u see the line of
coding labeled
// The Method of blocking used
enum { CMDBLOCK_ALL, CMDBLOCK_RELPATH };
3b. Under that is where your going to be pasting the autowall in...
3c. Ok now u have to PASTE all of this coding in...
// autowall
int penetrate;
int currentWeaponID=0;
bool CorrectGunX()
{
if(currentWeaponID==WEAPON_DEAGLE)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_SCOUT)
{
penetrate = WALL_PEN2;
return true;
}
else if(currentWeaponID==WEAPON_AWP)
{
penetrate = WALL_PEN2;
return true;
}
else if(currentWeaponID==WEAPON_SIG)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_COLT)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_PARA)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_AUG)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_AK)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_SG550)
{
penetrate = WALL_PEN1;
return true;
}
else if(currentWeaponID==WEAPON_G3SG1)
{
penetrate = WALL_PEN1;
return true;
}
else
{
penetrate = WALL_PEN0;
return true;
}
}
int GetCurPenetration(void)
{
if (CorrectGunX())
return penetrate;
return WALL_PEN0;
}
3d. K, after thats pasted just exit and save in client.cpp
4. Ya with me so far? good.. ok now go to Project>Add To Project> and click
NEW
4a. Highlight C/C++ Source File and name it "autowall"
4b. It should be open as "autowall.cpp" and now u are going to paste this...
#pragma warning (disable:4800)
#include <math.h>
#include <string.h>
#include "engine/wrect.h"
#include "engine/cl_dll.h"
#include "engine/pmtrace.h"
#include "engine/cl_entity.h"
#include "engine/pm_defs.h"
#include "common/com_model.h"
#include "common/event_api.h"
#include "cvar.h"
#include "attack.h"
#include "autowall.h"
mnode_t *GetNodeFromPoint(float *point)
{
struct cl_entity_s *ent;
mnode_t *node;
float d;
mplane_t *plane;
ent = gEngfuncs.GetEntityByIndex(0);
if (!ent || !ent->model)
return NULL;
node = ent->model->nodes;
while (node)
{
if (node->contents < 0)
{
if (!node->parent)
return NULL;
return node->parent;
}
plane = node->plane;
d = DotProduct(point, plane->normal) - plane->dist;
if (d > 0)
node = node->children[0];
else
node = node->children[1];
}
return NULL;
}
//===================================================================================
mleaf_t *GetLeafFromPoint(float *point)
{
struct cl_entity_s *ent;
mnode_t *node;
float d;
mplane_t *plane;
ent = gEngfuncs.GetEntityByIndex(0);
if (!ent || !ent->model)
return NULL;
node = ent->model->nodes;
while (node)
{
if (node->contents < 0)
return (mleaf_t *)node;
plane = node->plane;
d = DotProduct(point, plane->normal) - plane->dist;
if (d > 0)
node = node->children[0];
else
node = node->children[1];
}
return NULL;
}
//===================================================================================
void TraceThickness(float *start, float *end, float thickness, strace_t *tr)
{
mleaf_t *startleaf, *endleaf, *prevleaf;
int numsteps, count = 0;
float move[3], step[3], position[3];
float stepdist, depth = 0;
memset(tr, 0, sizeof(strace_t));
if ((start[0] < -4095) || (start[0] > 4095) || (start[1] < -4095) ||
(start[1] > 4095) || (start[2] < -4095) || (start[2] > 4095))
{
tr->hitsky = true;
tr->startsolid = true;
tr->finished = false;
tr->fraction = 0.0f;
return;
}
startleaf = GetLeafFromPoint(start);
endleaf = GetLeafFromPoint(end);
if (startleaf->contents == CONTENTS_SOLID)
{
tr->startsolid = true;
VectorCopy(start, tr->endpos);
tr->finished = false;
if (endleaf->contents == CONTENTS_SOLID)
tr->allsolid = true;
}
else
{
tr->startsolid = false;
tr->allsolid = false;
}
VectorSubtract(end, start, move);
tr->dist = (float)VectorLength(move);
if (tr->startsolid)
return;
if (startleaf == endleaf)
{
tr->finished = true;
tr->fraction = 1.0f;
VectorCopy(end, tr->endpos);
}
if (tr->dist > 1.0f)
numsteps = (int)tr->dist;
else
numsteps = 1;
VectorScale(move, 1.0f / (float)numsteps, step);
stepdist = (float)VectorLength(step);
VectorCopy(start, position);
endleaf = NULL;
for (;numsteps;numsteps--)
{
VectorAdd(position, step, position);
prevleaf = endleaf;
endleaf = GetLeafFromPoint(position);
if (prevleaf != endleaf && endleaf->contents == CONTENTS_SOLID)
count++;
if (count == 1 && endleaf->contents == CONTENTS_SOLID)
depth += stepdist;
if (endleaf->contents == CONTENTS_SKY)
tr->hitsky = true;
if (count > 1 || depth > thickness || tr->hitsky)
{
VectorCopy(position, tr->endpos);
VectorSubtract(position, start, move);
tr->fraction = (float)VectorLength(move) / tr->dist;
tr->finished = false;
return;
}
}
if (numsteps == 0)
{
tr->finished = true;
tr->fraction = 1.0f;
VectorCopy(end, tr->endpos);
}
}
//===================================================================================
bool CanPenetrate(float *start, float *end)
{
int maxhits = 10, count = 0;
float damage = 120;
strace_t tr;
pmtrace_t beam_tr, beam_tr1, *tmptr;
float srcorigin[3];
float diff[3], length, viewvec[3], unityview[3], position[3];
viewvec[0] = end[0] - start[0];
viewvec[1] = end[1] - start[1];
viewvec[2] = end[2] - start[2];
length = VectorLength(viewvec);
unityview[0] = viewvec[0] / length;
unityview[1] = viewvec[1] / length;
unityview[2] = viewvec[2] / length;
srcorigin[0] = start[0];
srcorigin[1] = start[1];
srcorigin[2] = start[2];
while (damage > 10 && maxhits > 0)
{
maxhits--;
TraceThickness(srcorigin,end,0,&tr);
if( tr.finished )
break;
if( srcorigin[0] != tr.endpos[0] || srcorigin[1] != tr.endpos[1] ||
srcorigin[2] != tr.endpos[2])
count++;
if (count >= 2 && !tr.finished)
{
damage = 0;
break;
}
position[0] = tr.endpos[0] + unityview[0] * 8.0;
position[1] = tr.endpos[1] + unityview[1] * 8.0;
position[2] = tr.endpos[2] + unityview[2] * 8.0;
tmptr = gEngfuncs.PM_TraceLine(position, end, PM_TRACELINE_PHYSENTSONLY,
2, -1);
memcpy(&beam_tr, tmptr, sizeof(pmtrace_t));
if (!beam_tr.allsolid)
{
tmptr = gEngfuncs.PM_TraceLine(beam_tr.endpos, tr.endpos,
PM_TRACELINE_PHYSENTSONLY, 2, -1);
memcpy(&beam_tr1, tmptr, sizeof(pmtrace_t));
diff[0] = beam_tr1.endpos[0] - tr.endpos[0];
diff[1] = beam_tr1.endpos[1] - tr.endpos[1];
diff[2] = beam_tr1.endpos[2] - tr.endpos[2];
length = VectorLength(diff);
if (length < damage)
{
damage -= length;
srcorigin[0] = beam_tr1.endpos[0] + unityview[0];
srcorigin[1] = beam_tr1.endpos[1] + unityview[1];
srcorigin[2] = beam_tr1.endpos[2] + unityview[2];
}
}
else
damage = 0;
}
if( maxhits == 0 && damage )
{
tr.finished = false;
while (!tr.finished)
{
TraceThickness(srcorigin,end,0,&tr);
if( tr.allsolid )
return false;
if( !tr.startsolid )
{
if (tr.finished)
return damage > 0.0;
return false;
}
srcorigin[0] = tr.endpos[0] + unityview[0];
srcorigin[1] = tr.endpos[1] + unityview[1];
srcorigin[2] = tr.endpos[2] + unityview[2];
}
}
return damage > 0.0;
}
4c. Ok now exit it and save
5. Now Make a new C/C++ Header File this time and name it the Same Thing
5a. Now your going to paste this coding in autowall.h ...
#ifndef AUTOWALL_H
#define AUTOWALL_H
#include "engine/wrect.h"
#include "engine/cl_dll.h"
#include "common/com_model.h"
typedef struct strace_s
{
bool finished;
bool allsolid;
bool startsolid;
float dist;
float fraction;
float endpos[3];
bool hitsky;
} strace_t;
inline float VectorLength(const vec3_t v)
{
return (float)sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
}
#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];}
#define VectorScale(a,b,c) {(c)[0]=(b)*(a)[0];(c)[1]=(b)*(a)[1];(c)[2]=(b)*(a)[2];}
#define WALL_PEN0 0
#define WALL_PEN1 1
#define WALL_PEN2 2
void TraceThickness(float *start, float *end, float thickness, strace_t
*tr);
bool CanPenetrate(float *from, float *to);
mleaf_t *GetLeafFromPoint(float *point);
mnode_t *GetNodeFromPoint(float *point);
int GetCurPenetration(void);
#endif
5b. Now exit and save
6. Now open up both Cvar.cpp and Cvar.h in your source file
6b. In Cvar.h go to where it says "CVAR INT COMMANDS" or something and type
in "int autowall;" without " marks
6c. In Cvar.cpp go to the bottom and type "REGISTER_CVAR_INT( autowall
,0)" wihtout the " marks
6d. Exit and save it
7. Now open up the file labeled "com_model.h"
7a. Search for "Minmaxs" and you should see this come up
// common with leaf
int contents; // 0, to differentiate from leafs
int visframe; // node needs to be traversed if current
short minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
7b. you should change the "short" to "float" so now it looks like this
// common with leaf
int contents; // 0, to differentiate from leafs
int visframe; // node needs to be traversed if current
float minmaxs[6]; // for bounding box culling
struct mnode_s *parent;
7c. There are 2 MinMaxS in there so change em both :)
8. Now compile and if u get ne Nasty erras then make sure that all the files
specified as being #included in both autowall.h and autowall.cpp are in the
places they need to :)
9. Replace the .dlls and go 0wn those nubz0rs :)
10. P.S If it keeps saying that "cannot find file autowall.h or
autowall.cpp" or ne of those files u may need to actually copy like
client.cpp and client.h in open those up and then just delete all the coding
and paste what i told you to paste instead of doing Project>Add To Project
file :)
** CREDITS **
-> Snipity for actually making autowall ;x
-> [Advanced] For helping me make it work right :)
-> |L|IQUI[D] for giving me loads of shit.. helping me out a ton and being a
kick-ass d00d
-> |egend for also helpin meh out :)
-> Lucif3r for also helpin me out :)
-> -]OsH[-Blazin and -]OsH[-Varsity* for being kick ass c00l dud3s
** NOTE **
My Nuclear Explosives v2 is already being coded by some L337 ass coders
here and its going to have a smoother Nospread + Autowall and recoil will
combine together so that it wont spray through the walls like any other
hack. Btw it has a new PI aiming method wich will be guaranteeing only HS
Im Still thinking whether or not to release that when its done :P
~~ Peace
~~ [L337-H@X]DaRrYL
This tutorial was made by [L337-H@X]DaRrYL on saturday at 12:03 A.M (ya i
rlly need a life ;x)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -