Hey there, Guille. I am from California, in the US, and I haven't heard people use "pal" to refer to an annoying person. Cambridge books, however, are British publications, so I imagine it must be used that way in the UK. To answer your question, you can tell the difference by the context. For example, if someone is speaking with a sarcastic tone, they problem mean 'annoying person', but if they sound genuine, they likely mean 'friend'.