The function always has to return something, the standard is 1.. you could check it, and if is doesn't work you can return 0..
Many functions in samp api have "return value of this function is not defined" in wiki. Also there is warning 209, which will tell you that you tried to use return value of function which simply doesn't have one.