Culture has been called "The Silent Language." Unfortunately, telling whether someone is insulting you involves a good understanding of the culture as well as the language. I'm sure it is the same in Spanish.
A famous incident in Owen Wister's 1902 novel, "The Virginian," illustrates this.
First, the Virginian's friend calls him a "son-of-a-bitch." In the book they use a dash in place of the rude word (palabrota) "bitch."
"I suppose you have me beat," said Steve, grinning at him affectionately. "You're such a son-of-a——"
A little while later, a character (named "Trampas," an unusual name and I suspect Wister knew Spanish!) uses exactly the same words:
Therefore Trampas spoke. "Your bet, you son-of-a—."
The Virginian's pistol came out, and his hand lay on the table, holding it unaimed. And with a voice as gentle as ever, the voice that sounded almost like a caress, but drawling a very little more than usual, so that there was almost a space between each word, he issued his orders to the man Trampas: "When you call me that, SMILE."
So, unfortunately, the same words can be a friendly joke, or a deadly insult. The difference is in the tone of voice, and the body language.