31.08.2012, 11:42
Well.. when i set a player health to 110.. it should be then 100.. but it's not, it's still 110.0 Anyone can check the stock?
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
stock SetPlayerHealthEx(playerid, Float:health)
{
new Float:Health;
GetPlayerHealth(playerid, Health);
Health = (Health + health < 100.0) ? Health + health : 100.0;
SetPlayerHealth(playerid, health);
return true;
}
#define SetPlayerHealth SetPlayerHealthEx
CMD:hp(playerid, params[])
{
new Float:health;
if(sscanf(params, "f", health))return SendClientMessage(playerid, -1, "Wpisz: /hp (ilość)");
{
SetPlayerHealthEx(playerid, health);
}
return true;
}
CMD:gethp(playerid, params[])
{
new Float:Health;
GetPlayerHealth(playerid, Health);
new string[64];
format(string, sizeof(string), "Your current health is: %0.f", Health);
SendClientMessage(playerid, -1, string);
return true;
}