문제

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.

도움이 되었습니까?

해결책

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;

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top