This is the final part to my train vehicle
//Ripped from speedgui which was ripped from greekbots
if(!$SubwayVehicle_Binded)
{
$remapDivision[$remapCount] = "Trains";
$remapName[$remapCount] = "Toggle Bell";
$remapCmd[$remapCount] = "togglebellcommand";
$remapCount++;
$SubwayVehicle_Binded = 1;
}
function togglebellcommand()
{
commandtoserver('togglebell');
}
function AddBind(%division, %name, %command)
{
for(%i=0;%i<$remapCount;%i++)
{
if($remapDivision[%i] $= %division)
{
%foundDiv = 1;
continue;
}
if(%foundDiv && $remapDivision[%i] !$= "")
{
%position = %i;
break;
}
}
if(!%foundDiv)
{
error("Division not found: " @ %division);
return;
}
if(!%position)
{
$remapName[$remapCount] = %name;
$remapCmd[$remapCount] = %command;
$remapCount++;
return;
}
for(%i=$remapCount;%i>%position;%i--)
{
$remapDivision[%i] = $remapDivision[%i - 1];
$remapName[%i] = $remapName[%i - 1];
$remapCmd[%i] = $remapCmd[%i - 1];
}
$remapDivision[%position] = "";
$remapName[%position] = %name;
$remapCmd[%position] = %command;
$remapCount++;
}
The problem is it keeps send the command to the server when I release it AND when I press it.
I only want it to be sent when I release w/e key.