Пример #1
0
cell AMX_NATIVE_CALL Natives::GetDynamicVehicleHealth(AMX *amx, cell *params)
{
	CHECK_PARAMS(2, "GetDynamicVehicleHealth");
	boost::unordered_map<int, Item::SharedVehicle>::iterator v = core->getData()->vehicles.find(static_cast<int>(params[1]));
	if (v != core->getData()->vehicles.end())
	{
		float health;
		boost::unordered_map<int, int>::iterator i = core->getData()->internalVehicles.find(v->first);
		if (i != core->getData()->internalVehicles.end())
		{
			GetVehicleHealth(i->second, &health);
		}
		else
		{
			health = v->second->health;
		}
		Utility::storeFloatInNative(amx, params[2], health);
		return 1;
	}
	return 0;
}
Пример #2
0
	float GetHealth() const {
		float health;
		GetVehicleHealth(id_, &health);
		return health;
	}
Пример #3
0
	bool GetHealth(float &health) const
		{ return GetVehicleHealth(id_, &health); }