PHP Code:
new szPlayer = pev(pFlag, pev_aiment);
// a bunch of code through here, all the stuff matches and is correct, trus me.
AddHealthCheckMax(szPlayer, 50.0);
PHP Code:
// adds health, not exceeding max, returns 1 if any health was added
AddHealthCheckMax(pEntity, const Float:iValue)
{
// raise us to max health, don't reduce health if health is above max (from medic boost)
if(entity_get_float(pEntity, EV_FL_health) < entity_get_float(pEntity, EV_FL_max_health))
{
//pEntity->v.health = min(pEntity->v.max_health, pEntity->v.health + iValue);
entity_set_float(pEntity, EV_FL_health, floatmin(entity_get_float(pEntity, EV_FL_health), (entity_get_float(pEntity, EV_FL_health) + iValue)) )
return true;
}
else
return false;
return pEntity;
}
__________________