While I agree with Black Rose, I'll give you some advice that you need to know for scripting in general.
Saying "it doesn't work" rarely helps. You have to explain what about it doesn't work. That being said, you need to learn to debug your plugins to find out which part of the plugin is not working. If neither outcome is occurring then your plugin is not running (this is why you have to tell us exactly what is happening instead of saying "it doesn't work").
Once you know if the plugin is running and the function is being called, you should verify the data that you are trying to check. In this case, you need to find out what IP is actually being obtained by get_user_ip().
These are some steps that you should get used to doing (it's called debugging).