Author Topic: Jet pack toggle code failing  (Read 1783 times)

Anyone see anything wrong with it?:

Code: [Select]
function serverCmdjet(%client)
{
if ("PlayerRacingArmor.canJet = 1;")
{
PlayerRacingArmor.canJet = 0;
messageClient(%client, '', "Jet is now ON");
}
else
{
PlayerRacingArmor.canJet = 1;
messageClient(%client, '', "Jet is now OFF");
}
}

erm i think 1 is on and 0 is off

When I type /togglejet in game it only turns it off, it never turns it on.

In the if you dont need the "=1;" and dont listen to mario he knows Jack all.

If you meant to change it to
Code: [Select]
if ("PlayerRacingArmor.canJet") I did and now it just says unknown server command in the console.


if ("PlayerRacingArmor.canJet")
if (PlayerRacingArmor.canJet = 1;)
if (PlayerRacingArmor.canJet)

All give me buffer overruns, only if ("PlayerRacingArmor.canJet = 1;") works but it doesn't even turn off the jet, it just says "Jet is now OFF" in the chat.

So...

("%PlayerRacingArmor.canJet == 1;") ?

Code: [Select]
function serverCmdjet(%client)
{
if (PlayerRacingArmor.canJet == 1)
{
PlayerRacingArmor.canJet = 0;
messageClient(%client, '', "Jet is now OFF.");
}
else
{
PlayerRacingArmor.canJet = 1;
messageClient(%client, '', "Jet is now ON.");
}
}

Hopefully that should work.

Success! Thanks for the help!