Ok this code is pretty nice, just lock onto your opponent and it shoots in the direction they're going or right at them pretty accurately. I didn't create this code, but I'm not sure who gave it to me but here it is:
You might have trouble if you have guided lasers.
In src/bzflag/playing.cxx find:
// see if it's inside lock-on angle (if we're trying to lock-on)
if (a <>getFlag() == Flags::GuidedMissile) // am i locking on?
tankHasShotType(myTank, Flags::GuidedMissile)) &&
player[i]->getFlag() != Flags::Stealth && // can't lock on stealth
!player[i]->isPaused() && // can't lock on paused
!player[i]->isNotResponding() && // can't lock on not responding
d < besttarget =" player[i];" bestdistance =" d;" lockedon =" true;">getFlag() == Flags::GuidedMissile) // am i locking on?
To:
(1 // am i locking on?
In src/bzflag/LocalPlayer.cxx find:
// Set _shotsKeepVerticalVelocity on the server if you want shots
// to have the same vertical velocity as the tank when fired.
// keeping shots moving horizontally makes the game more playable.
firingInfo.shot.vel[2] = 0.0f;
Add this after it:
if (getTarget()) {
const Player * targ = getTarget();
double myx = LocalPlayer::getMyTank()->getPosition()[0];
double myy = LocalPlayer::getMyTank()->getPosition()[1];
double myz = LocalPlayer::getMyTank()->getPosition()[2] +
LocalPlayer::getMyTank()->getMuzzleHeight();
double hisx = targ->getPosition()[0];
double hisy = targ->getPosition()[1];
double hisz = targ->getPosition()[2] + targ->getMuzzleHeight();
double hisvx = targ->getVelocity()[0];
double hisvy = targ->getVelocity()[1];
double hisvz = targ->getVelocity()[2];
double deltax = hisx - myx;
double deltay = hisy - myy;
double distance = hypotf(deltax,deltay)- BZDBCache::tankRadius;
// - BZDB.eval(StateDatabase::BZDB_MUZZLEFRONT);
if (distance <= 0) distance = 0; double shotspeed = BZDB.eval(StateDatabase::BZDB_SHOTSPEED)*( LocalPlayer::getMyTank()->getFlag() == Flags::Laser ?
BZDB.eval(StateDatabase::BZDB_LASERADVEL) :
LocalPlayer::getMyTank()->getFlag() == Flags::RapidFire ?
BZDB.eval(StateDatabase::BZDB_RFIREADVEL) :
LocalPlayer::getMyTank()->getFlag() == Flags::MachineGun ?
BZDB.eval(StateDatabase::BZDB_MGUNADVEL) : 1);
double errdistance = 1.0;
float tx, ty, tz;
for (int tries=0 ; errdistance > 0.05 && tries < t =" (float)distance" omega="fabs(targ-">getAngularVelocity());
double sx,sy;
if ((targ->getStatus() & PlayerState::Falling) fabs(omega)
< sx="t*hisvx;" sy="t*hisvy;" hisspeed =" hypotf(hisvx," alfa =" omega" r =" hisspeed" dx =" r" dy2 =" r" beta =" atan2(dy2,">getAngularVelocity() >
0 ? 1 : -1);
double gamma = atan2(hisvy, hisvx);
double rho = gamma+beta;
sx = hisspeed * t * cos(rho);
sy = hisspeed * t * sin(rho);
}
tx=(float)hisx+(float)sx;
ty=(float)hisy+(float)sy;
tz=(float)hisz+(float)hisvz*t;
if (targ->getStatus() & PlayerState::Falling)
tz += 0.5f * BZDBCache::gravity * t * t;
if (tz < 0) tz = 0;
double distance2 = hypotf(tx - myx, ty - myy);
errdistance = fabs(distance2-distance) / (distance + ZERO_TOLERANCE);
distance = distance2;
}
float projpos[3];
projpos[0] = tx; projpos[1] = ty; projpos[2] = tz;
float heading = atan2f(projpos[1] - myy, projpos[0] - myx);
firingInfo.shot.vel[0] = cosf(heading) *
BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
firingInfo.shot.vel[1] = sinf(heading) *
BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
firingInfo.shot.vel[2] = sinf(atan2f(projpos[2]-myz,
hypotf(projpos[1]-myy,
projpos[0]-myx)))*BZDB.eval(StateDatabase::BZDB_SHOTSPEED);
firingInfo.shot.pos[0] = myx;
firingInfo.shot.pos[1] = myy;
firingInfo.shot.pos[2] = myz;
}
There you go.
-NightMare
Monday, December 31, 2007
Choose your tank size
Ok this is posted in a comment by "person" but "someone" is the one who came up with this cheat I just think it should be posted so more people can see it and don't have to go looking through comments to find it so here it is.
At top of src/bzflag/CommandsImplementation.cxx:
extern float sizeCheat;
class SizeCommand : LocalCommand {
public:
SizeCommand();
bool operator() (const char *commandLine);
};
static SizeCommand sizeCommand;
SizeCommand::SizeCommand() : LocalCommand("/size") {}
bool SizeCommand::operator() (const char *commandLine)
{
sizeCheat = atof(commandLine+6);
return true;
}
At top of src/bzflag/Player.cxx:
#include "LocalPlayer.h"
float sizeCheat = 1.0f;
Find:
else if (effectFlag == Flags::Narrow) {
dimensionsTarget[1] = 0.001f;
}
Add this after:
if (id == LocalPlayer::getMyTank()->getId())
{
dimensionsTarget[0] *= sizeCheat;
dimensionsTarget[1] *= sizeCheat;
}
And that should be it. Now just type /size .1 to /size 1. You must either be killed or pick up or drop a flag for the size to change. Sizes range from 0.0 (Can't be shot by a bullot) to 1.0 (Normal tank size). Sometimes just a /size .7 is nice to give yourself an "edge" =].
-NightMare
At top of src/bzflag/CommandsImplementation.cxx:
extern float sizeCheat;
class SizeCommand : LocalCommand {
public:
SizeCommand();
bool operator() (const char *commandLine);
};
static SizeCommand sizeCommand;
SizeCommand::SizeCommand() : LocalCommand("/size") {}
bool SizeCommand::operator() (const char *commandLine)
{
sizeCheat = atof(commandLine+6);
return true;
}
At top of src/bzflag/Player.cxx:
#include "LocalPlayer.h"
float sizeCheat = 1.0f;
Find:
else if (effectFlag == Flags::Narrow) {
dimensionsTarget[1] = 0.001f;
}
Add this after:
if (id == LocalPlayer::getMyTank()->getId())
{
dimensionsTarget[0] *= sizeCheat;
dimensionsTarget[1] *= sizeCheat;
}
And that should be it. Now just type /size .1 to /size 1. You must either be killed or pick up or drop a flag for the size to change. Sizes range from 0.0 (Can't be shot by a bullot) to 1.0 (Normal tank size). Sometimes just a /size .7 is nice to give yourself an "edge" =].
-NightMare
Teleport in FRONT of your opponent.
This is just like the /behind code down below where you teleport behind them, only with this code you will teleport in front of them. Kind of a dumb code but fun to mess with people.
Open src/bzflag/composeDefaultKey.cxx:
Find your /behind cheat that you have. It should Look like this:
else if(message=="/behind") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] - 10 * dir[0];
newpos[1] = pos[1] - 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, Other->getAngle());
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
}
Then directly below that add this:
else if(message=="/front") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] + 10 * dir[0];
newpos[1] = pos[1] + 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, TargetingUtils::getTargetAzimuth(newpos , pos ));
}
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
And that is all. Like I said, it is stupid but fun to mess with people when you teleport behind then in front back in forth. Credit for this goes to Phaz =].
-NightMare
Open src/bzflag/composeDefaultKey.cxx:
Find your /behind cheat that you have. It should Look like this:
else if(message=="/behind") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] - 10 * dir[0];
newpos[1] = pos[1] - 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, Other->getAngle());
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
}
Then directly below that add this:
else if(message=="/front") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] + 10 * dir[0];
newpos[1] = pos[1] + 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, TargetingUtils::getTargetAzimuth(newpos , pos ));
}
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
And that is all. Like I said, it is stupid but fun to mess with people when you teleport behind then in front back in forth. Credit for this goes to Phaz =].
-NightMare
Shot prediction.
This will draw a line on your radar to predict where your shots will go. Its almost exactly perfect. It doesn't work on all servers for some reason, but it should work on most. It is very helpful for 3 shot no jump servers. This code was found through a chat between mrmolez and someone else. So here it is for everyone else to see lol.
Open RadarRenderer.cxx
Find:
//draw world weapon shots
Add this right before it:
FiringInfo myInfo(*myTank, 0);
if (myInfo.flagType != Flags::ShockWave) {
if (!BZDB.isTrue(StateDatabase::BZDB_SHOTSKEEPVERTICALV))
myInfo.shot.vel[2] = 0.0f;
myInfo.flagType = Flags::Laser;
myInfo.lifetime /= 100;
const float cs = colorScale(myInfo.shot.pos[2], muzzleHeight);
glColor3f(1.0f * cs, 1.0f * cs, 1.0f * cs);
LocalShotPath myPath(myInfo);
myPath.radarRender();
}
Let me know how this works for you guys. If you don't like it just take it out lol.
-NightMare
Open RadarRenderer.cxx
Find:
//draw world weapon shots
Add this right before it:
FiringInfo myInfo(*myTank, 0);
if (myInfo.flagType != Flags::ShockWave) {
if (!BZDB.isTrue(StateDatabase::BZDB_SHOTSKEEPVERTICALV))
myInfo.shot.vel[2] = 0.0f;
myInfo.flagType = Flags::Laser;
myInfo.lifetime /= 100;
const float cs = colorScale(myInfo.shot.pos[2], muzzleHeight);
glColor3f(1.0f * cs, 1.0f * cs, 1.0f * cs);
LocalShotPath myPath(myInfo);
myPath.radarRender();
}
Let me know how this works for you guys. If you don't like it just take it out lol.
-NightMare
Sunday, December 30, 2007
Choose Who Kills You
Ok this is a very very powerful cheat. With this cheat you send a PM to the player saying "/kill" and you will instantly be killed by that person. It is very useful and funny when you do it to teammates and they get booted for TKing or their score drops immedietly.
In src/bzflag/playing.cxx:
Add to top:
int killMe;
Find:
// used later
float waterLevel = World::getWorld()->getWaterLevel();
Add this after:
if (killMe)
{
gotBlowedUp(myTank,GotShot,killMe);
killMe = 0;
}
In src/bzflag/composeDefaultKey.cxx:
Add to top:
extern int killMe;
Find:
else if (message.length() > 0) {
Add this before that:
else if(message=="/kill") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{ killMe = Other->getId();
}
}
And that is it. Now type /kill in a messege to someone and you will be killed by them. Make sure you do NOT have god mode on when you try to do this otherwise it won't work. Also there is usually 1 random player everytime you log into a server that the code doesn't work against. But other than that one player it should work against everyone else. Let me know if this code works for you guys.
-NightMare
In src/bzflag/playing.cxx:
Add to top:
int killMe;
Find:
// used later
float waterLevel = World::getWorld()->getWaterLevel();
Add this after:
if (killMe)
{
gotBlowedUp(myTank,GotShot,killMe);
killMe = 0;
}
In src/bzflag/composeDefaultKey.cxx:
Add to top:
extern int killMe;
Find:
else if (message.length() > 0) {
Add this before that:
else if(message=="/kill") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{ killMe = Other->getId();
}
}
And that is it. Now type /kill in a messege to someone and you will be killed by them. Make sure you do NOT have god mode on when you try to do this otherwise it won't work. Also there is usually 1 random player everytime you log into a server that the code doesn't work against. But other than that one player it should work against everyone else. Let me know if this code works for you guys.
-NightMare
Monday, September 24, 2007
Clientquery spoofing
Here's something somebody showed me a long time ago, but I haven't put it up until now. Do people keep recognizing your client as a cheat client because of the "clientquery" command? This will make your client appear to be the same as others, or you can make it say whatever you want.
In buildDate.cxx find these lines of code:
#ifdef HAVE_SDL
appVersionStream << "-SDL";
#endif
appVersion = appVersionStream.str();
and put this line of code right after it:
appVersion = "2.0.8.20060513-MAINT-W32VC71";
This makes your client look like the regular, Windows 2.0.8 version. Of course, you could even change appVersion to be anything you want, like "A BZFLAG CHEAT CLIENT, PUNK!" and if I remember correctly, it may not filter out swear words.
So that's the cheat. So stop bugging me Nightmare.
-phasmophage
In buildDate.cxx find these lines of code:
#ifdef HAVE_SDL
appVersionStream << "-SDL";
#endif
appVersion = appVersionStream.str();
and put this line of code right after it:
appVersion = "2.0.8.20060513-MAINT-W32VC71";
This makes your client look like the regular, Windows 2.0.8 version. Of course, you could even change appVersion to be anything you want, like "A BZFLAG CHEAT CLIENT, PUNK!" and if I remember correctly, it may not filter out swear words.
So that's the cheat. So stop bugging me Nightmare.
-phasmophage
Monday, September 17, 2007
No Gravity
By: Phasmophage
Okay, this is a very useless cheat, but because randomdude wants it, I thought I'd post it. =]
We definitely want this cheat to be toggleable. So in playing.cxx, add a line near the beginning (it doesn't matter where, as long as it's not in a function or anything) that says this:
bool bCheatGravity = false;
Now, open LocalPlayer.cxx and put this line of code near the top.
extern bool bCheatGravity;
This will let us use the variable we declared in playing.cxx.
Now, also in LocalPlayer.cxx find these lines:
newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;
lastSpeed = speed;
} else {
newVelocity[2] += BZDBCache::gravity * dt;
And replace them with this:
if(bCheatGravity && oldVelocity[2] <= 0.0)newVelocity[2] = 0;
else newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;
lastSpeed = speed;
} else {
//newVelocity[2] += BZDBCache::gravity * dt;
if(bCheatGravity && oldVelocity[2] <= 0.0 )newVelocity[2] = 0;
else newVelocity[2] += BZDBCache::gravity * dt;
Now, to add the toggle function, open up ComposeDefaultKey.cxx and add this line near the top:
extern bool bCheatGravity;
And add these lines where your other commands are:
if(message=="/gravity")
{
bCheatGravity = !bCheatGravity;
LocalPlayer *myTank = LocalPlayer::getMyTank();
const float * oldVel = myTank->getVelocity();
float newVelocity[3];
newVelocity[0] = oldVel[0];
newVelocity[1] = oldVel[0];
newVelocity[2] = 0;
myTank->setVelocity(newVelocity);
}
If you don't know where to put this, look for these lines and put it above it:
if (message.length() > 0) {
const char* cmd = message.c_str();
if (LocalCommand::execute(cmd)) {
;
} else if (serverLink) {
and put an "else" in front of " if (message.length() > 0) {"
That's all there is to it. It's pretty useless, I know. But it is funny to see a tank in midair not moving. Which reminds me, you'll need your wings cheat working if you want to drive around in the air.
Hope this is what you were looking for randomdude. ;)
-phaz
Okay, this is a very useless cheat, but because randomdude wants it, I thought I'd post it. =]
We definitely want this cheat to be toggleable. So in playing.cxx, add a line near the beginning (it doesn't matter where, as long as it's not in a function or anything) that says this:
bool bCheatGravity = false;
Now, open LocalPlayer.cxx and put this line of code near the top.
extern bool bCheatGravity;
This will let us use the variable we declared in playing.cxx.
Now, also in LocalPlayer.cxx find these lines:
newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;
lastSpeed = speed;
} else {
newVelocity[2] += BZDBCache::gravity * dt;
And replace them with this:
if(bCheatGravity && oldVelocity[2] <= 0.0)newVelocity[2] = 0;
else newVelocity[2] += BZDB.eval(StateDatabase::BZDB_WINGSGRAVITY) * dt;
lastSpeed = speed;
} else {
//newVelocity[2] += BZDBCache::gravity * dt;
if(bCheatGravity && oldVelocity[2] <= 0.0 )newVelocity[2] = 0;
else newVelocity[2] += BZDBCache::gravity * dt;
Now, to add the toggle function, open up ComposeDefaultKey.cxx and add this line near the top:
extern bool bCheatGravity;
And add these lines where your other commands are:
if(message=="/gravity")
{
bCheatGravity = !bCheatGravity;
LocalPlayer *myTank = LocalPlayer::getMyTank();
const float * oldVel = myTank->getVelocity();
float newVelocity[3];
newVelocity[0] = oldVel[0];
newVelocity[1] = oldVel[0];
newVelocity[2] = 0;
myTank->setVelocity(newVelocity);
}
If you don't know where to put this, look for these lines and put it above it:
if (message.length() > 0) {
const char* cmd = message.c_str();
if (LocalCommand::execute(cmd)) {
;
} else if (serverLink) {
and put an "else" in front of " if (message.length() > 0) {"
That's all there is to it. It's pretty useless, I know. But it is funny to see a tank in midair not moving. Which reminds me, you'll need your wings cheat working if you want to drive around in the air.
Hope this is what you were looking for randomdude. ;)
-phaz
Sunday, September 16, 2007
Super Jump
By: Phasmophage
In winged fights, it's hard to catch up with people that are above you, and are continuously jumping. So here's a cheat that will amplify your jump speed by a factor of 8 (or whatever you want it to be, just change it) if you type "/jump".
Add these lines of code in composeDefaultKey.cxx before other commands (See "Quick Guide to Toggling Cheats and Wallwalking"):
if (message=="/jump"){
LocalPlayer *myTank = LocalPlayer::getMyTank();
const float* oldVelocity = myTank->getVelocity();
float newVelocity[3];
newVelocity[0] = oldVelocity[0];
newVelocity[1] = oldVelocity[1];
newVelocity[2] = BZDB.eval(StateDatabase::BZDB_WINGSJUMPVELOCITY);
newVelocity[2] *= 8;
myTank->setVelocity(newVelocity);
}
You will probably want to have your wings cheat turned on when you use this, as you may continue to soar until you are kicked. If you're going too fast, make sure you have you're wings cheat turned on and jump. This will slow you down to regular jump speed.
Questions? Is this working for you? Leave a comment.
-Phasmophage
In winged fights, it's hard to catch up with people that are above you, and are continuously jumping. So here's a cheat that will amplify your jump speed by a factor of 8 (or whatever you want it to be, just change it) if you type "/jump".
Add these lines of code in composeDefaultKey.cxx before other commands (See "Quick Guide to Toggling Cheats and Wallwalking"):
if (message=="/jump"){
LocalPlayer *myTank = LocalPlayer::getMyTank();
const float* oldVelocity = myTank->getVelocity();
float newVelocity[3];
newVelocity[0] = oldVelocity[0];
newVelocity[1] = oldVelocity[1];
newVelocity[2] = BZDB.eval(StateDatabase::BZDB_WINGSJUMPVELOCITY);
newVelocity[2] *= 8;
myTank->setVelocity(newVelocity);
}
You will probably want to have your wings cheat turned on when you use this, as you may continue to soar until you are kicked. If you're going too fast, make sure you have you're wings cheat turned on and jump. This will slow you down to regular jump speed.
Questions? Is this working for you? Leave a comment.
-Phasmophage
Protect against "/send"
By: Phasmophage
"/send" is fun, but it can be horrible if it is used against you. So here's a cheat that will send the flag right back to the person who sent it to you.
In playing.cxx, find these lines of code:
static void handleFlagTransferred( Player *fromTank, Player *toTank, int flagIndex)
{
Flag f = world->getFlag(flagIndex);
fromTank->setFlag(Flags::Null);
toTank->setFlag(f.type);
if ((fromTank == myTank) || (toTank == myTank))
updateFlag(myTank->getFlag());
and put this line of code right under it to send the flag back:
if(toTank == myTank)
serverLink->sendTransferFlag(myTank->getId(), fromTank->getId());
Or you can add this line instead to immediately drop it:
if(toTank == myTank)
serverLink->sendDropFlag(myTank->getPosition());
You'll probably want to make this cheat toggleable (see "Quick Guide to Toggling Cheats and Wallwalking").
-Phaz
"/send" is fun, but it can be horrible if it is used against you. So here's a cheat that will send the flag right back to the person who sent it to you.
In playing.cxx, find these lines of code:
static void handleFlagTransferred( Player *fromTank, Player *toTank, int flagIndex)
{
Flag f = world->getFlag(flagIndex);
fromTank->setFlag(Flags::Null);
toTank->setFlag(f.type);
if ((fromTank == myTank) || (toTank == myTank))
updateFlag(myTank->getFlag());
and put this line of code right under it to send the flag back:
if(toTank == myTank)
serverLink->sendTransferFlag(myTank->getId(), fromTank->getId());
Or you can add this line instead to immediately drop it:
if(toTank == myTank)
serverLink->sendDropFlag(myTank->getPosition());
You'll probably want to make this cheat toggleable (see "Quick Guide to Toggling Cheats and Wallwalking").
-Phaz
Send a flag
By: Someone (but I had this one too, before ^_^)
What this cheat will do is simulate your flag being stolen by someone and thus sent to them, causing them to drop their flag, and pick up yours. You can send people bad flags, or OO and force them inside buildings with this cheat.
To do this, edit composeDefaultKey.cxx and add these lines of code:
if(message=="/send") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
serverLink->sendTransferFlag(LocalPlayer::getMyTank()->getId(),Other->getId());
}
}
In front of your other slash commands. (See previous tutorials)
And that's it. PM "/send" to anybody to send them the flag.
What this cheat will do is simulate your flag being stolen by someone and thus sent to them, causing them to drop their flag, and pick up yours. You can send people bad flags, or OO and force them inside buildings with this cheat.
To do this, edit composeDefaultKey.cxx and add these lines of code:
if(message=="/send") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
serverLink->sendTransferFlag(LocalPlayer::getMyTank()->getId(),Other->getId());
}
}
In front of your other slash commands. (See previous tutorials)
And that's it. PM "/send" to anybody to send them the flag.
Monday, September 10, 2007
Teleport Behind Somebody
By:Phasmophage
Okay then, this is my first original post in quite a while. Most of the new cheats have been posted by Someone.
Are you tired of having to catch up with others to get a good shot at them? Do you wish that you could just appear behind someone (not the contributor Someone), and automatically aim at them? Well now you can! What this cheat will allow you to do is teleport behind somebody (Kind of like what I heard Agent Smith used to be able to do) by sending them a special private message (Using the period key) like "/behind" or "/b".
To do this, we will need to edit the "composeDefaultKey.cxx" in the directory "/src/bzflag/". Now what you'll need to do is find this line of code:
if (message.length() > 0) {
and change it to this:
else if (message.length() > 0) {
and put this above it:
if(message=="/behind") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() | int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] - 10 * dir[0];
newpos[1] = pos[1] - 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, Other->getAngle());
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
}
You can change the command "/behind" to anything you want. You may want to make it shorter. I also don't think that the "setStatus" functions really do anything important, so you may want to get rid of those, but they don't do any harm anyway.
If you're really into coding, what you can do, like I've done, is instead of having the "Other" player be the recipient of a message, you can make it the closest enemy through using the "findBestTarget()" function in TargetingUtils. You may also want to bind this action to a key, making it quicker to use. I won't go into the details on this, but for one method of binding keys, see Someone's comment on "Quick Guide to Toggling Cheats and Wallwalking". This method doesn't work for me, so I replace some commands I don't use, like "w" for "toggle console".
Questions? Comments? If I missed anything, or if you have any ideas on improvement *cough* Someone *cough*, post a comment.
Have fun with this one.
-phasmophage
aka phaz
Okay then, this is my first original post in quite a while. Most of the new cheats have been posted by Someone.
Are you tired of having to catch up with others to get a good shot at them? Do you wish that you could just appear behind someone (not the contributor Someone), and automatically aim at them? Well now you can! What this cheat will allow you to do is teleport behind somebody (Kind of like what I heard Agent Smith used to be able to do) by sending them a special private message (Using the period key) like "/behind" or "/b".
To do this, we will need to edit the "composeDefaultKey.cxx" in the directory "/src/bzflag/". Now what you'll need to do is find this line of code:
if (message.length() > 0) {
and change it to this:
else if (message.length() > 0) {
and put this above it:
if(message=="/behind") {
const Player *Other = LocalPlayer::getMyTank()->getRecipient();
if(Other)
{
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() | int(PlayerState::Teleporting));
const float* pos = Other->getPosition();
const float* dir = Other->getForward();
const float* vel = Other->getVelocity();
float newpos[3];
float newvel[3];
newpos[0] = pos[0] - 10 * dir[0];
newpos[1] = pos[1] - 10 * dir[1];
newpos[2] = pos[2] + 0.01;
newvel[0] = vel[0];
newvel[1] = vel[1];
newvel[2] = vel[2];
LocalPlayer::getMyTank()->move(newpos, Other->getAngle());
LocalPlayer::getMyTank()->setStatus(LocalPlayer::getMyTank()->getStatus() & ~int(PlayerState::Teleporting));
}
}
You can change the command "/behind" to anything you want. You may want to make it shorter. I also don't think that the "setStatus" functions really do anything important, so you may want to get rid of those, but they don't do any harm anyway.
If you're really into coding, what you can do, like I've done, is instead of having the "Other" player be the recipient of a message, you can make it the closest enemy through using the "findBestTarget()" function in TargetingUtils. You may also want to bind this action to a key, making it quicker to use. I won't go into the details on this, but for one method of binding keys, see Someone's comment on "Quick Guide to Toggling Cheats and Wallwalking". This method doesn't work for me, so I replace some commands I don't use, like "w" for "toggle console".
Questions? Comments? If I missed anything, or if you have any ideas on improvement *cough* Someone *cough*, post a comment.
Have fun with this one.
-phasmophage
aka phaz
Sunday, September 9, 2007
GM Multi-Lock
By: Someone
"Someone" has an improvement on the previously posted "GMWontUnlock" what this cheat will do is allow individual Guided Missiles to track individual targets, instead of all Guided Missiles following one target.
To do this, open GuidedMissileStrategy.cxx and find these lines of code:
LocalPlayer* myTank = LocalPlayer::getMyTank();
if (myTank)
target = myTank->getTarget();
And replace them with:
if (lastTarget == NoPlayer) {
setTarget();
LocalPlayer* myTank = LocalPlayer::getMyTank();
if (myTank)
target = myTank->getTarget();
} else {
target = lookupPlayer(lastTarget);
}
You can thank "Someone" for this post, see his comment for the post "GMWontUnlock."
"Someone" has an improvement on the previously posted "GMWontUnlock" what this cheat will do is allow individual Guided Missiles to track individual targets, instead of all Guided Missiles following one target.
To do this, open GuidedMissileStrategy.cxx and find these lines of code:
LocalPlayer* myTank = LocalPlayer::getMyTank();
if (myTank)
target = myTank->getTarget();
And replace them with:
if (lastTarget == NoPlayer) {
setTarget();
LocalPlayer* myTank = LocalPlayer::getMyTank();
if (myTank)
target = myTank->getTarget();
} else {
target = lookupPlayer(lastTarget);
}
You can thank "Someone" for this post, see his comment for the post "GMWontUnlock."
Saturday, September 8, 2007
"GuidedMissileWontUnlock"
Here's an old one that I believe Mr_Molez had on a private site, but I haven't seen it anywhere else so I'll post it here.
Normally, when one dies after shooting a guided missile, the missile no longer tracks the target. This cheat is listed as one of the "Subtle Cheats" of BZFlag, and what it does is it continues to track the target, even after dying. Here's how to do it.
In LocalPlayer.cxx, find this line:
target = NULL; // lose lock when dead
And delete it.
Normally, when one dies after shooting a guided missile, the missile no longer tracks the target. This cheat is listed as one of the "Subtle Cheats" of BZFlag, and what it does is it continues to track the target, even after dying. Here's how to do it.
In LocalPlayer.cxx, find this line:
target = NULL; // lose lock when dead
And delete it.
Monday, August 20, 2007
Reduce laser reload
By: Someone
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Laser fast-reload
In src/bzflag/SegmentedShotStrategy.cxx, find:
---
setReloadTime(_path->getReloadTime()
/ BZDB.eval(StateDatabase::BZDB_LASERADRATE));
---
Replace with:
---
setReloadTime(_path->getReloadTime()
* BZDB.eval(StateDatabase::BZDB_LASERADLIFE))
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Laser fast-reload
In src/bzflag/SegmentedShotStrategy.cxx, find:
---
setReloadTime(_path->getReloadTime()
/ BZDB.eval(StateDatabase::BZDB_LASERADRATE));
---
Replace with:
---
setReloadTime(_path->getReloadTime()
* BZDB.eval(StateDatabase::BZDB_LASERADLIFE))
Enable Autopilot all the time
By: Someone
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Want to use autopilot on maps that disable it?
In src/bzflag/clientCommands.cxx, find:
---
if (BZDB.isTrue(StateDatabase::BZDB_DISABLEBOTS)) {
hud->setAlert(0, "autopilot not allowed on this server", 1.0f, true);
return std::string();
}
---
Remove it.
(Copied straight off his comment from "Wings Gravity Fix for Bloodbath.")
Want to use autopilot on maps that disable it?
In src/bzflag/clientCommands.cxx, find:
---
if (BZDB.isTrue(StateDatabase::BZDB_DISABLEBOTS)) {
hud->setAlert(0, "autopilot not allowed on this server", 1.0f, true);
return std::string();
}
---
Remove it.
Subscribe to:
Posts (Atom)