Forums Index >> Modding >> TMO's Tank Toggler script
Page : <1> :
Rather obviously, it will also only work if you have a scrollwheel on your mouse. XD
NICE WORK!! Hey I've updated my version so I can enable/disable the changers by right clicking and it wont go through all the tanks as fast as the light.
It will wait 0,2 seconds till it changes again the tank. If you want I could post it (don't forget u get 90% of the credit! I didnt know how to get that scrollwheel working with TT!!)
Else I could just send it to you
Oh well I must say again, CONGRATS for the work!
PS: How many time did it take to find that out?
Last edited: Tuesday, November 09, 2004 at 1:18:20 PM
It really only took me a day or so to finally get the script working the way I wanted. The hardest part was determining the code for the wheel. Many Google/Yahoo searches were needed before I finally found a page that gave me what I needed. XD
I use my right mouse button for other tasks, but it might not be a bad idea to assign the enable/disable to clicking the mousewheel. Although I personally don't have any problems with accidentally scrolling while playing.
//Tanktoggler script by Master TMO
//Load this script into your main.cs file.
//this script will only work on servers that have the tankchanger code enabled, such as Dash's Modserver.
function TankChgControl(%val)
{
if($TankChg==0)
{
$TankChg=1;
MoveMap.bind(mouse, zaxis, handleMouseWheel);
} else {
$TankChg=0;
MoveMap.bind(mouse, zaxis, "");
}
}
Function handleMouseWheel(%val)
{
// Check if the wheel scrolled up or down
if( %val > 0 )
{
//scroll up
$TankSize = $TankSize++;
if ($TankSize > 5)
{
$TankSize = 1;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Up
} else {
//scroll down
$TankSize = $TankSize--;
if ($TankSize < 1)
{
$TankSize = 5;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Down
}
}
$TankSize = "2"; //set to whatever type of tank you normally use
$TankChg = 0; //0 = Disabled (default), 1 = Enabled
$Tanks[1] = "/ufo";
$Tanks[2] = "/light";
$Tanks[3] = "/med";
$Tanks[4] = "/heavy";
$Tanks[5] = "/boss";
MoveMap.bind(mouse. Button2, TankChgControl);
That's off the top of my head. I'll check it tonight, but I think it should work.
I know but I tried button 2 and it stopped working lol
Use my version (working completly):
//Tanktoggler script by Master TMO ------ Upgraded by ArtCrazy
//Load this script into your main.cs file.
//this script will only work on servers that have the tankchanger code enabled, such as Dash's Modserver.
function handleMouseWheel(%val)
{
if($tankchangerenabled)
{
// Check if the wheel scrolled up or down
if( %val > 0 )
{
//scroll up
$TankSize = $TankSize++;
if ($TankSize > 5)
{
$TankSize = 1;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Up
}
else
{
//scroll down
$TankSize = $TankSize--;
if ($TankSize < 1)
{
$TankSize = 5;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Down
}
$tankchangerenabled = false;
schedule(200,false,"enablechanger");
}
else
{
}
}
$TankSize = "2"; //set to whatever type of tank you normally use
$Tanks[1] = "/ufo";
$Tanks[2] = "/light";
$Tanks[3] = "/med";
$Tanks[4] = "/heavy";
$Tanks[5] = "/boss";
MoveMap.bind(mouse, zaxis, handleMouseWheel);
moveMap.bind(mouse, button1, enablechanger);
Function enablechanger()
{
$tankchangerenabled = true;
}
Last edited: Tuesday, November 09, 2004 at 5:05:59 PM
I'll take a look at it and see if I can't work out a compromise. I do like your version a bit better, just setting the variable rather than mapping and remapping the scrollwheel.
Where do you put it? I dought that I will get a response though :[
4. Dont bump old topics... This is old as... My grandmother?
It's a cool script though, I think I'll try it :P
It work in shockwave?
my blaster will destroy u!
Probaly...try it and find out! %)
It only works on servers with the Tank Toggle codes enabled.
Well..... All u should have to do is /light /med /heavy /ufo /boss and not be lazy.
my blaster will destroy u!
Page : <1> :
//Tanktoggler script by Master TMO
//Load this script into your main.cs file.
//this script will only work on servers that have the tankchanger code enabled, such as Dash's Modserver.
function handleMouseWheel(%val)
{
// Check if the wheel scrolled up or down
if( %val > 0 )
{
//scroll up
$TankSize = $TankSize++;
if ($TankSize > 5)
{
$TankSize = 1;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Up
} else {
//scroll down
$TankSize = $TankSize--;
if ($TankSize < 1)
{
$TankSize = 5;
}
commandToServer('messageSent',$Tanks[$TankSize]); //Mwheel Down
}
}
$TankSize = "2"; //set to whatever type of tank you normally use
$Tanks[1] = "/ufo";
$Tanks[2] = "/light";
$Tanks[3] = "/med";
$Tanks[4] = "/heavy";
$Tanks[5] = "/boss";
MoveMap.bind(mouse, zaxis, handleMouseWheel);
Last edited: Tuesday, November 09, 2004 at 1:43:09 AM