28.08.2012, 23:16
This is my code:
Obv it isn't going to output that message when I'm done scripting... But it was just put there to test to see if the values work. Thing is, they don't, and I have no idea why. Health becomes something like 12332435 or something crazy. Everything else is 0.
I have no idea why. Help?
Код:
CMD:heal(playerid, params[]) { new Float:health, Float:tbhealedhealth, Float:healprice, Float:healtime, string[128]; GetPlayerHealth(playerid, Float:health); tbhealedhealth = 100-health; healprice = tbhealedhealth*10; healtime = tbhealedhealth*100; format(string, sizeof(string), "health: %d | tbhealedhealth: %d | healprice: %d | healtime: %d", health, tbhealedhealth, healprice, healtime); SendClientMessage(playerid, -1, string); /*if(IsPlayerInRangeOfPoint(playerid, 5, HealPos1X, HealPos1Y, HealPos1Z)) { if(health < 100) { SendClientMessage(playerid, GREY, "test"); } }*/ return 1; }
I have no idea why. Help?