if(!$ClientKill::Binds) { $remapDivision[$remapCount] = "Client Kill Mod"; $remapName[$remapCount] = "Self Delete"; $remapCmd[$remapCount] = "loool"; $remapCount++; $ClientKill::Binds=1;}
function loool(%down){ if(!%down) echo("Released"); else echo("Pressed");}
The function that gets called ("loool") gets passed a boolean, which will be true if the keybind was just pressed or false if it was just released.Code: [Select]function loool(%down){ if(!%down) echo("Released"); else echo("Pressed");}
function NightVisionToggle(%client){ if(!%down) if($NightVision::isOn == 1) { NightVision.setVisible(0); $NightVision::isOn = 0; } else if($NightVision::isOn == 0) { NightVision.setVisible(1); $NightVision::isOn = 1; } else // echo("Pressed");}
You need to put curly braces {} around conditionals (except if its only one line). Also, you've commented out the online statement in the else and it's using the last } as the one line of code instead.
function NightVisionToggle(%client){ if(!%down) { if($NightVision::isOn == 1) { NightVision.setVisible(0); $NightVision::isOn = 0; } else if($NightVision::isOn == 0) { NightVision.setVisible(1); $NightVision::isOn = 1; } } else echo("Night vision toggled.");}
So this?Code: [Select]function NightVisionToggle(%client){ if(!%down) { if($NightVision::isOn == 1) { NightVision.setVisible(0); $NightVision::isOn = 0; } else if($NightVision::isOn == 0) { NightVision.setVisible(1); $NightVision::isOn = 1; } } else echo("Night vision toggled.");}
%client shouldn't be there, it should be %down.