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";
appVersion = appVersionStream.str();

and put this line of code right after it:

appVersion = "";

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.

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:

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;

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. ;)

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;

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.

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);


if ((fromTank == myTank) || (toTank == myTank))

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)

You'll probably want to make this cheat toggleable (see "Quick Guide to Toggling Cheats and Wallwalking").

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();

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

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();
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.
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) {
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


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.