Example #1
0
void check_player_model()
{
	// common variables
	Player player = PLAYER::PLAYER_ID();
	Ped playerPed = PLAYER::PLAYER_PED_ID();

	if (!ENTITY::DOES_ENTITY_EXIST(playerPed)) return;

	if (ENTITY::IS_ENTITY_DEAD(playerPed) && is_player_reset_on_death() )
	{
		bool found = false;
		Hash model = ENTITY::GET_ENTITY_MODEL(playerPed);

		for (int i = 0; i < (sizeof(player_models) / sizeof(player_models[0])); i++)
		{
			if (GAMEPLAY::GET_HASH_KEY((char *)player_models[i]) == model)
			{
				found = true;
				break;
			}
		}

		if (!found)
		{
			set_status_text("Resetting player model");
			applyChosenSkin("player_zero");
		}

		// wait until player is ressurected
		while (ENTITY::IS_ENTITY_DEAD(PLAYER::PLAYER_PED_ID()))
		{
			WAIT(0);
		}
	}
}
bool onconfirm_skinchanger_choices_misc(int selection, std::string caption, std::string value)
{
	skinTypesMenuPositionMemory[2] = selection;
	applyChosenSkin(value);
	return false;
}