Question

I'm trying to get the health of a player but I'm getting a tag mismatch error on the code below.

new health;
GetPlayerHealth(playerid, health);

Hopefully someone can help me, this is important to my server.

Was it helpful?

Solution

This is a common problem in SA:MP (which I presume is what you're developing for). GetPlayerHealth gives the player's health as a float, but you're saving it as an untagged variable.

To fix this, simply change new health; to new Float:health;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top