C# plane script doesn't work...

Hi…
This script doesn’t work:

using UnityEngine;
using System.Collections;

public class Samolot : MonoBehaviour {
	public float speed;
	public float min;
	public float max;
	public float off;

	void Start () {
		speed = 0;
		min = 0;
		max = 1000;
		off = 70;
	}
	void Update () {
		if (Input.GetKey(KeyCode.W)) speed = speed +1;
		if (Input.GetKey(KeyCode.S)) speed = speed -1;
		if (speed <= min) speed = min;
		if (speed >= max) speed = max;

		#region rotation off

			if (speed <= off) {
			if (Input.GetAxis("Horizontal")) ;
			if (Input.GetAxis("Vertical")) ;
}
		#endregion

		#region rotation on
			if (speed <= off) {
			if (Input.GetAxis("Horizontal") < 0)
			transform.Rotate (0,0,60 * Time.deltaTime);
			if (Input.GetAxis("Horizontal") > 0)
			transform.Rotate (0,0,-60 * Time.deltaTime);
			if (Input.GetAxis("Vertical") < 0)
			transform.Rotate (60 * Time.deltaTime,0,0);
			if (Input.GetAxis("Vertical") > 0)
			transform.Rotate (-60 * Time.deltaTime,0,0);
		}
		#endregion

	}
}

Assets/Samolot.cs(25,25): error CS0029: Cannot implicitly convert type float' to bool’
Assets/Samolot.cs(26,25): error CS0029: Cannot implicitly convert type float' to bool’

console says what’s wrong… Input.GetAxis() method returns float values between -1…0…1 (e.g. -0.96, -0.13, 0.14) but IF statement accepts boolean values (0 and 1 or other words true and false)…
You should try to do something like this: if (Input.GetAxis(“Horizontal”) != 0) ; which will return boolean value in IF statement.

bool IsJumping = false;   //check if a player is jumping
int jumpheight = 5;         //assign 5 meters as maximum jump height


void Update()
{
     if (IsJumping)           //if you pass only a boolean in a if statement it gets converted to this if ( IsJumping == "true" ) and if it's true
        { /*do something */ } //the code can start executing


     if (jumpheight)         //compile error, you cannot pass an integer value like a boolean, jumpheight is 5, not true or false
        { /*do something */ } 

     if (jumpheight == 5)   //legit, this time you're asking the compiler if jumpheight is 5, not true or false
        { /*do something */ }

}

GetAxis method returns a float, not a boolean

Thanks _rolands…